Protecting regions

I am currently mixing 10 songs. Because logic lacks an easy way to apply global changes in a mix to a group of related songs, I have all of the tracks for all 10 songs loaded into a single logic "song" file. The songs appear in the arrange window consecutively with about 10 seconds of silence in between songs.
Working this way is great for when I make small tweaks to the fx or mix of a particular track, as my changes instantaneously affect all songs.
The problem is when I am mixing an individual song.
Here's an example: sometimes I will accidentally click the track (selecting all regions from all songs on that track) and then make an adjustment to a region length. Then, I realize later after 50 or so more changes that I messed up all the regions in the other songs.
QUESTION: How can I make sure that when I am working on one song that the changes I am making will NOT affect the adjacent songs which are all in the same song file. Essentially I am asking how do I limit changes to a certain time interval in the arrange window and prevent changes to regions outside of that time window?
Alternatively, is there a preference option for giving me a warning when regions I cannot see in the current zoom level will be affected by whatever it is I am about to do?

"I am currently mixing 10 songs. Because logic lacks an easy way to apply global changes in a mix to a group of related songs, I have all of the tracks for all 10 songs loaded into a single logic "song" file. The songs appear in the arrange window consecutively with about 10 seconds of silence in between songs."
Y'know, I would question this working method myself. It's based on an incorrect assumption that Logic "lacks an easy way to apply global changes in a mix". I don't think that's correct at all. There are inserts on the master output object where I can put any effect I want that controls the entire mix.
Also, if you put each song on a separate track, then the whole selecting regions question goes out the window. With that, you would have both track-level plugins and automation as well as a master output object inserts for overall changes to the entire mix. Typically, you'd want separate EQ and compression for each song anyways. I've done mastering projects for years in Protools that way. You simply solo the song/track you're working on.
Bounce them down and drag them into Waveburner. In fact, why not just use Waveburner to start with? You can use all your Logic plugins on a track-by-track basis as well as a master effect. Then you can also control the the timing between tracks, etc.
Why do your mastering on a DAW when you have a mastering application, Waveburner?
What did I miss?

Similar Messages

  • Error in protecte region blk_mem_gen_v8_2_vhsyn_rfs.vhd

    I created the IP Example Design for the AXI Memory Mapped to PCIe core and when I compiled it with Modelsim, I get following error:
    -- Loading package STANDARD
    ** Error: ./sources_1/ip/axi_bram_ctrl_0/blk_mem_gen_v8_2/hdl/blk_mem_gen_v8_2_vhsyn_rfs.vhd(46)): in protected region.
    ** Error: ./sources_1/ip/axi_bram_ctrl_0/blk_mem_gen_v8_2/hdl/blk_mem_gen_v8_2_vhsyn_rfs.vhd(46)): in protected region.
    ** Error: ./sources_1/ip/axi_bram_ctrl_0/blk_mem_gen_v8_2/hdl/blk_mem_gen_v8_2_vhsyn_rfs.vhd(46)): in protected region.
    I get the same error when using Aldec's RivieraPro. I tried this with Vivado 2015.1 and 2015.2. Is this a known issue?
    Thank you!
    Daniel

    Hi 
    I doubt that you are not using the correct set of IP files for simulation.
    Use below commands to generate scripts which can be used in modelsim.
    set_property TARGET_SIMULATOR Modelsim [current_project]
    launch_simulation -scripts_only -of_objects [get_files ip_name.xci]
    or you can use the below command too
    get_files -compile_order sources -used_in simulation -of_objects [get_files <ip_name>.xci]
    Thanks,
    Deepika.

  • Unlocking protected regions-LE 8

    Greetings,
    I'm running Logic Express 8.0.2 on an iMac Intel I5 quad (Snow Leopard 10.6.8), and I've encountered an issue that I've never faced before.
    I punched in some guitar spots using autopunch at a band members house (where we were tracking for the day), saved my work, broke down my gear, reset my gear at my place, went to back up my work when I noticed that my punch spots were off by a few beats, overlapping the existing audio on the main track at the starting point and leaving a blank gap at the ending point until the original track kicked back in. I figured it would be an easy fix-drag the punch take region to its appropriate spot, save, and be done.
    The kicker is, I cannot drag the audio because it is locked in the audio bin. Again, no biggie, unlock the audio, move into place, and be on my way.
    I cannot unlock this take, or any of my takes in the five songs I am working on, thus leaving me unable to drag my punch take regions back to their intended spots. The "click on the lock incon to unprotect" per the user manual does nothing.
    Any ideas on how to unlock my takes so they can be moved or edited? Is there a master setting I am missing? I would rather not re-cut these entire guitar tracks for what should be in theory a very quick and easy fix.
    Other possible pertinent info: The soundcard/interface I am using is the Presonus FP10, and everything-including the computer and interface-is going through a Furman M-8X2 power conditioner.
    Any help/ideas would be greatly appreciated!

    Nevermind, I found a workaround that works for me, and I wanted to share.
    I took the comp track which included the locked out of place punch in regions (see above post), and exported it to a new track. I did this by clicking the arrow at the very end of the comp track. This made an exact duplicate of the comp track but it split the punch in spots on the same track The punch in regions (now split regions on the same track) can then be moved back into their proper place and crossfades were automatically added.
    The disadvantage: you lose the comp editing feature as it condenses the takes down to one split track as opposed to multiple takes of the same track. This was not an issue for me as the punch ins were replacing errors, but for those who like to do multiple takes to compare, contrast, and comp (without the assumption of errors), I can see how that would be a major problem.  
    Maybe this can help anyone who's having similar problems.

  • Router reloaded due to an unknown failure, PC 0x60B38674

    Hi Team,
    One of our production router got reload and we are getting the unknown failure message in the version
    Router reloaded due to an unknown failure, PC 0x60B38674
    Model: Cisco 3845
    Please help to sort out the issue.
    Regards,
    Arun

    Hi
    ------------------ show region ------------------
    Region Manager:
          Start         End     Size(b)  Class  Media  Name
    0x0FFFFE00  0x0FFFFFFF         512  Iomem  R/W    BCM region
    0x2D900000  0x2FFFFDFF    40893952  Iomem  R/W    iomem
    0x60000000  0x6D8FFFFF   227540992  Local  R/W    main
    0x6001105C  0x6244BCAF    37989460  IText  R/O    main:text
    0x6244C000  0x6451E2BF    34415296  IData  R/W    main:data
    0x6451E2C0  0x6498DFBF     4652288  IBss   R/W    main:bss
    0x6498DFC0  0x6D8FFFFF   150413376  Local  R/W    main:heap
    0x70000000  0x7FFFFFFB   268435452  Local  R/W    Main memory 1
    0x7FFFFFFC  0x7FFFFFFF           4  Local  R/W    Protected region
    0x80000000  0x8D8FFFFF   227540992  Local  R/W    main:(main_k0)
    0xA0000000  0xAD8FFFFF   227540992  Local  R/W    main:(main_k1)
    This is the show region found in the router.

  • Adding Encrypted IP Cores Standalone Modelsim

    Hello,
    I realise this was covered here:
    http://forums.xilinx.com/t5/Simulation-and-Verification/modelsim-simulation-of-Vivado-encrypted-IP/td-p/330391
    but I still can't get it to work.
    I have these libraries included:
    LIBRARY IEEE;
    USE IEEE.STD_LOGIC_1164.ALL;
    USE ieee.numeric_std.ALL;
    USE ieee.std_logic_misc.ALL;
    LIBRARY unisim;
    USE unisim.VComponents.ALL;
    And this is the block I'm trying to use:
    dsp: entity work.dsp_c -- a*b+c, 12bit
    port map
    clk => clk_i,
    a => a_dsp,
    b => b_dsp,
    c => c_dsp,
    p => p_dsp -- full precision
    I went into vivado in tcl mode and got it to compile, it created a dsp_c folder:
    dsp_c.dcp dsp_c_funcsim.vhdl dsp_c_stub.v dsp_c.xci synth xbip_dsp48_wrapper_v3_0 xbip_utils_v3_0
    dsp_c_funcsim.v dsp_c_ooc.xdc dsp_c_stub.vhdl dsp_c.xml xbip_dsp48_macro_v3_0 xbip_pipe_v3_0
    I have a tcl script which looks like this, it fails on mydsp_c.vhd saying:
    source firmware/cfg/lib_mappings.tcl
    vlib work
    vcom firmware/hdl/mydsp_c.vhd
    It compains saying it can't find the dsp block, so I added:
    src dsp_c/dsp_c.vhd
    Throws up this error:
    dsp_c/dsp_c.vhd(56): Library xbip_dsp48_macro_v3_0 not found.
    Tried sourcing the libraries:
    src dsp_c/xbip_dsp48_macro_v3_0/hdl/xbip_dsp48_macro_v3_0_vh_rfs.vhd
    src dsp_c/xbip_dsp48_macro_v3_0/hdl/xbip_dsp48_macro_v3_0.vhd
    Tells me they are protected:
    dsp_c/xbip_dsp48_macro_v3_0/hdl/xbip_dsp48_macro_v3_0.vhd(46)): in protected region.
    That's when I stumbled across that forum post above.
    I tried the method in the post before whereby you try a vmap, my tcl script now looks like this:
    vlib work
    vlib dsp_c/xbip_dsp48_macro_v3_0
    vmap dsp_c/xbip_dsp48_macro_v3_0
    # do mkProject.tcl
    # Modifying modelsim.ini
    # ** Warning: (vlib-34) Library already exists at "work".
    # ** Warning: (vlib-34) Library already exists at "dsp_c/xbip_dsp48_macro_v3_0".
    # Reading modelsim.ini
    # "dsp_c/xbip_dsp48_macro_v3_0" maps to directory ./dsp_c/xbip_dsp48_macro_v3_0. (Default mapping)
    # -- Loading package NUMERIC_STD
    # ** Error: firmware/cgn/dsp_c/dsp_c.vhd(56): Library xbip_dsp48_macro_v3_0 not found.
    # ** Error: firmware/cgn/dsp_c/dsp_c.vhd(57): (vcom-1136) Unknown identifier "xbip_dsp48_macro_v3_0".
    # ** Error: firmware/cgn/dsp_c/dsp_c.vhd(59): VHDL Compiler exiting
    # ** Error: vcom failed.
    Any ideas? I feel like I am almost there - or can you not launch a standalone version of modelsim (I can launch this project via Vivado but for various reasons I can't do this in the longterm).
     

    I did this and the scripts weren't useful for within my current simulation framework. One of the reaosns being our ethernet IPs are real for the Vivado project and they use dumy ones for our simulation system.
    One quick question - what is the difference between Vivado launching modelsim and launching a precompiled version of modelsim? My boss told me something about the Vivado launching method is time driven - so it knows what happenes at exactly what time according to the chip. Our method which he says is older, doesn't care about chip time and hence is much faster. 

  • Silence the camera shutter sound in an E72

    Hi.
    I'm using a software called YBrowser to snoop around my Nokia E72 file system.
    I found out that the sound files for the camera shutter, auto-focus, etc. are located in the following path:
    z:/system/sounds/digital/relevant-sound-file-name.​wav
    So I proceed to create a silence wav file (of about 10 kb).
    My ideia, simple enough, would be to replace the shutter sound file with this silence file and give it the same name, so as not to cause conflicts of any kind.
    Although the YBrowswer allows me to snoop around the whole system files, it doesn't allow me paste new files, or even delete the 'CamcorderJavaCapture.wav' (which is the file I'd like to replce).
    Any idea on how I could access the Z:/ volume of my phone and do this?
    If not through the phone, maybe through a Terminal window and the E72 connected to my Mac via USB?
    Thanks.

    aspergerguy wrote:
    Correct it is in protected region of phone so that you would need File Explorer with enhanced capabilities such as self-sign version of Y-Browser by Dr Jukka as per screenshot:
    But I can access that screen through YBrowser, no question about that. I can snoop inside the folders and files. I just can't paste anything over, or change names, or delete files. I'll probably need some other kind of file browser to do it.
    Anyway, as you say it, if it's a protected part of the phone, that explains why it's difficult to get there without the right tools.
    I'm not really a hacker or anything, so I don't mind not getting into that in depth.
    Best regards, and thanks for your help.
    Toscano

  • Simplifying filter

    There is a lot of good stuff in CS6 but I would love to see a Simplifying filter added.  When making natural media simulations with photo manipulations (and some free hand painting) it is often really helpful to remove, or selectively adjust, the detail in a source photo.  This can give a good starting painterly effect as the basis for adding brushstrokes.  You can get somewhere near this using Filter>Blur>Smart Blur at extreme settings and Filter>Noise>Reduce Noise - but not near enough.  The first third party plugin to enable you to do this was called "Simplify" and was part of the buZZPro range (originally made by a UK company called Segmentis later called fo2Pix). Unfortunately, the company went belly up and the filter is no longer commercially attainable.  But if Adobe are reworking the filters in Photoshop it would be great if they could buy the rights to the Simplify filter and add it in some form to Photoshop.  You can also make very nice pen and pencil contour drawings with it.  I still use it with CS5 32bit - it won't work with 64bit.
    TopazLabs produce their own version of this filter but that presumably doesn't stop Adobe producing theirs in Photoshop.   It would be a wonderful addition to CS6 or a later version and would complement well the more sophisticated brushing tools now available in Photoshop..

    I'm sorry, just got to rave about Oil Paint again. Please stand back in case I gush all over you.
    Let's say you want to create toon inklines for your picture--above all, a stylized animation character, but really, it can be any relatively simple, streamlined image.
    We all know by now that the first filter to use is Photocopy, don't we? Foreground color slot black, background slot white. You can multiply the resulting inklines at 20% over the original image and you get lovely color-coordinated inklines.
    Here's where PB comes in: before copying the Photocopy result, take your black inkline image and run it through Oil Paint, and this will finesse jaggies and other irregularities into graceful brush strokes. Granted, you are guaranteed to smear the eyes, so they will have to be knocked out. If you composite this version over the color original, the results are superb.
    As a result of this pipeline, I would like to ask someone to invent 2 new PixelBenders. The first one I need is a Freeze tool like the freeze/lock tool for protecting regions during Liquify. Think how great this would be for use with every other PB filter.
    The second one I need is a Dilate/Erode filter for my inklines. I downloaded the D/E PixelBender filter for Flash before I realized it's not compatible with Photoshop.
    Thanks, and don't forget to tell users how valuable PixelBender is.

  • BAD ALLOCATION SAPTS_GET_ALL_DATA_RW

    Hi,
    A huge treatment(update macro) is blocking every livecache sessions (
    DB ANALYZER :  UTK1 : user tasks is waiting for CPU in state 'vbegexcl'
                                 UTK...  user tasks is waiting for CPU in state 'command wai')
    triggers 3 erros in sim_session (long runtime..) 'APTS_AGGMULT_TIMESERIES'
    is there a way to isolate livecache session?
    by limiting for a session, parameter like :  data cache, oms_heap_limit?
    thanks for your help.
    chris
    #!!# DbpError exception in S
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   APTS_AGGMULT_TIMESERIES ##########
    COM
    2010-09-16 16:17:28   385 ERR 51000 OBJECT    build 50012.002 CL 374315 (5.0_HOT) on
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   Solaris X86_64
        OMS_Context::GetObjFr
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   omLiveCacheBase_1 (/SAP_DB/76_REL/sunx86
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   64/genopt/sys/wrk/incl/SAPDB/Oms/OMSCo
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   ntext.hpp:44) n
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   omsTerminate will be triggered:
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   SAPTS_AGGMULT_TIMESERIES
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   file: /sapmnt/patch_scratch/ux3102/5.0_H
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   OT/sys/wrk/incl/COMBase/api_functor/cbs_
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   api_obj_functor.h
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   line: 69
    2010-09-16 16:17:28   385 ERR 51000 OBJECT    DbpError -102 errorKind = 0 in SAPTS_AG
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   GMULT_TIMESERIES
    , SQL statement cancell
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   ed ERROR -1000102 in SAPTS_AGGMULT_TIMES
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   ERIES (file: /sapmnt/patch_scratch/ux310
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   2/5.0_HOT/sys/wrk/incl/COMBase/api_funct
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   or/cbs_api_obj_func
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   <a href="lcapo_com_trace_01.txt#$2QIJ000
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   000gdmO06b$w0G">For details see lcapo_co
    2010-09-16 16:17:28   385 ERR 51000 OBJECT   m_trace_01.txt</a>
    2010-09-16 16:17:28   339 ERR 51000 OBJECT   SAPTS_AGGMULT_TIMESERIES
    2010-09-16 16:17:28   339 ERR 51000 OBJECT   file: /sapmnt/patch_scratch/ux3102/5.0_H
    2010-09-16 16:17:28   339 ERR 51000 OBJECT   OT/sys/wrk/incl/COMBase/api_functor/cbs_
    2010-09-16 16:17:28   339 ERR 51000 OBJECT   api_obj_functor.h
    2010-09-16 16:17:28   339 ERR 51000 OBJECT   line: 69
    2010-09-16 16:17:28   339 ERR 51000 OBJECT

    Hello Chris,
    1.
    The liveCache routine SAPTS_AGGMULT_TIMESERIES (resp. the workprocess 
    which has called it) seems to have been manually aborted or canceled due
    unexpectedly long runtime. Please check the system log - /nsm21 and corresponding dev log of WP on your system.   
    DBberror -102 means:                                                   
    The SQL statement currently executed was terminated by user or operator 
    intervention.                                                                               
    User Action:                                                            
    No user action is required in interactive operation. Reset the          
    transaction with a ROLLBACK statement.                                                                               
    The error happens, for example, if a user e.g. use the "stop transaction" command in an application and then the error -102 is written to the current tracefile and to system error messages. (works as designed)   
    2.
    u201CliveCache user tasks in state 'vbegexcl'u2026u201D ::
    Vbegexcl(Enter Region):                
    Task waits to enter a protected region 
    It will be helpful to collect more information during the application run using x_cons tool.
    Also we need to know the system SP stack, LCA build and liveCache version, the data selection during the application run
    => I recommend to create the SAP message to the component u201CBC-DB-LCAu201D
    In general, please review the SAP notes u2013 1081508, 833216 and 936058, 1112046 and 957711.
    Please use the SAP note 1111426 to check the configuration of the liveCache parameters.
    Thank you & best regards, Natalia Khlopina

  • Quick Swipe Comping not working

    I've recorded a few takes of a vocal. The takes show up as a comp, with the disclosure triangle in the upper left and the comp menu in the upper right. But I can't drag any selections in the takes to edit the comp via quick swiping. This used to work just fine and now it just doesn't. The pointer never changes to the quick swipe cursor when I point at the edge of a selection where one take ends and another take begins. It's baffling. Anyone have an idea what I could be missing?

    I also am experiencing this problem. Quick-swipe comping does not work, and then I copy into a new project and it works again. Closing and opening the project back does not fix, rebooting computer does not fix. I have been getting around it by manually dragging a copy of each take from the "Audio Bin" sidebar tab into new tracks in the arrange window, and then doing old-fashioned slicing and comping from there. This has only been happening to me recently (the earliest i can pin it down is maybe jan or feb. 2010).
    For some reason, the problem-take shows up in the Audio Bin tab (& Audio Bin window) with a little lock symbol by it. I looked this up in the user manual (p.292) and it says the lock signifies a "protected" region, which means you can't change the start or end points of the file. This would explain why we can't do quick-swipe comping. However, the manual states you can unlock the region by going to the Audio Bin window (not the tab) and clicking on the lock. THIS IS NOT WORKING. I can lock or unlock other takes at ease, but i cannot unlock my problem take.

  • Problem with editing Editable Region - HELP!

    My website is www.yucholian.com
    I have created a template and have assigned a main body to be
    an Editable Region. However, I can't seem to use different fonts,
    sizes or styles as I wish. If I go to Text drop down, go to size,
    all options are greyed out. Can anyone help?
    BTW, I'm using 30 day trial.
    I find Dreamweaver to be very finicky. Even something simple
    as applying a template that I created, view doesn't update, showing
    doubles...
    Thanks in advance.

    > I find Dreamweaver to be very finicky. Even something
    simple as applying
    > a
    > template that I created, view doesn't update, showing
    doubles...
    The more you know about HTML, the less you will run into such
    things - but I
    have to say, I have no idea what you are describing here. It
    sounds to me
    like user error, but I can't say for sure.
    > However, I can't seem to use different fonts, sizes or
    styles as I
    > wish.
    Show me your template, tell me what you are trying to change,
    and I'll
    explain to you what is happening.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "yucholian" <[email protected]> wrote in
    message
    news:edk7lr$73m$[email protected]..
    > My website is www.yucholian.com
    > I have created a template and have assigned a main body
    to be an Editable
    > Region. However, I can't seem to use different fonts,
    sizes or styles as
    > I
    > wish. If I go to Text drop down, go to size, all options
    are greyed out.
    > Can
    > anyone help?
    > BTW, I'm using 30 day trial.
    > I find Dreamweaver to be very finicky. Even something
    simple as applying
    > a
    > template that I created, view doesn't update, showing
    doubles...
    >
    > Thanks in advance.
    >

  • An editable region, how to keep text formatting?

    Hello fellas.
    Is there any way to keep the text formatting when I paste it
    into my edible region of the template?
    Every time I attempt it - dreamweaver gives me message "
    making this change would require code change which is locked by a
    template". The only way to paste anything into a region is by
    turning off any copy/paste text formatting completely, which is
    painful to edit, especially with a large number of articles.
    Would greatly appreciate any help.

    This is a common alert when the page you are working on
    contains *any*
    coding anomalies (perhaps in a location other than the
    editable region).
    Does the page validate before the paste? Does the code you
    are pasting
    validate?
    The answer is, of course, it's possible to retain formatting
    (provided all
    code is valid). What app are you pasting from?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "dreamweaver_novice" <[email protected]>
    wrote in message
    news:f3s8v2$daj$[email protected]..
    > Hello fellas.
    >
    > Is there any way to keep the text formatting when I
    paste it into my
    > edible
    > region of the template?
    > Every time I attempt it - dreamweaver gives me message "
    making this
    > change
    > would require code change which is locked by a
    template". The only way to
    > paste
    > anything into a region is by turning off any copy/paste
    text formatting
    > completely, which is painful to edit, especially with a
    large number of
    > articles.
    >
    > Would greatly appreciate any help.
    >
    >
    >

  • How can I get  the part image from a rectangle region?

    hi,
    I'm trying to draw a rectagle region on a picture with mouse and crop it. but the rectangle is not vertical along x-axis.that is to say, there is a angle between x-axis and the base of the rectangle. I don't know , how can I do it. Can someone give me some tip or some java-code. Thank you very much in advance.

    I completely misunderstood your question. As I read it again it seems clear and straight-forward. I'm sorry. Let's see if this is closer.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.net.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class CropImage
        BufferedImage original;
        CropPanel cropPanel;
        CropSelector selector;
        public CropImage()
            original = getImage();
            cropPanel = new CropPanel(original);
            selector = new CropSelector(cropPanel);
            cropPanel.addMouseListener(selector);
            cropPanel.addMouseMotionListener(selector);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(getUIPanel(), "North");
            f.getContentPane().add(new JScrollPane(cropPanel));
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
        private BufferedImage getImage()
            String fileName = "images/coyote.jpg";
            BufferedImage image = null;
            try
                URL url = getClass().getResource(fileName);
                image = ImageIO.read(url);
            catch(MalformedURLException mue)
                System.err.println("url: " + mue.getMessage());
            catch(IOException ioe)
                System.err.println("read: " + ioe.getMessage());
            return image;
        private JPanel getUIPanel()
            final JButton
                mask    = new JButton("mask"),
                crop    = new JButton("crop"),
                restore = new JButton("restore");
            ActionListener l = new ActionListener()
                public void actionPerformed(ActionEvent e)
                    JButton button = (JButton)e.getSource();
                    if(button == mask)
                        selector.mask();
                    if(button == crop)
                        selector.crop();
                    if(button == restore)
                        cropPanel.restore(original);
            mask.addActionListener(l);
            crop.addActionListener(l);
            restore.addActionListener(l);
            JPanel panel = new JPanel();
            panel.add(mask);
            panel.add(crop);
            panel.add(restore);
            return panel;
        public static void main(String[] args)
            new CropImage();
    class CropPanel extends JPanel
        BufferedImage image;
        Dimension size;
        GeneralPath clip;
        Point[] corners;
        Area mask;
        boolean showMask;
        Color bgColor;
        public CropPanel(BufferedImage bi)
            image = bi;
            setSize();
            clip = new GeneralPath();
            showMask = false;
            bgColor = getBackground();
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            int w = getWidth();
            int h = getHeight();
            int x = (w - size.width)/2;
            int y = (h - size.height)/2;
            g2.drawImage(image, x, y, this);
            if(showMask)
                g2.setPaint(getBackground());
                g2.fill(mask);
            else
                g2.setPaint(Color.red);
                g2.draw(clip);
        public Dimension getPreferredSize()
            return size;
        public void setClip(Point[] p)
            corners = p;
            clip.reset();
            clip.moveTo(p[0].x, p[0].y);
            clip.lineTo(p[1].x, p[1].y);
            clip.lineTo(p[2].x, p[2].y);
            clip.lineTo(p[3].x, p[3].y);
            clip.closePath();
            repaint();
        public void clearClip()
            clip.reset();
            repaint();
        public void setMask(Area area)
            mask = area;
            showMask = true;
            repaint();
        public void setImage(BufferedImage image)
            this.image = image;
            setSize();
            showMask = false;
            clip.reset();
            repaint();
            revalidate();
        public void restore(BufferedImage image)
            setBackground(bgColor);
            setImage(image);
        private void setSize()
            size = new Dimension(image.getWidth(), image.getHeight());
    class CropSelector extends MouseInputAdapter
        CropPanel cropPanel;
        Point start, end;
        public CropSelector(CropPanel cp)
            cropPanel = cp;
        public void mask()
            Dimension d = cropPanel.getSize();
            Rectangle r = new Rectangle(0, 0, d.width, d.height);
            Area mask = new Area(r);
            Area port = new Area(cropPanel.clip);
            mask.subtract(port);
            cropPanel.setMask(mask);
        public void crop()
            Point[] p = cropPanel.corners;
            int w = p[2].x - p[0].x;
            int h = p[1].y - p[3].y;
            BufferedImage cropped = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
            Graphics2D g2 = cropped.createGraphics();
            g2.translate(-p[0].x, -p[3].y);
            cropPanel.paint(g2);
            g2.dispose();
            cropPanel.setBackground(Color.pink);
            cropPanel.setImage(cropped);
        public void mousePressed(MouseEvent e)
            if(e.getClickCount() == 2)
                cropPanel.clearClip();
            start = e.getPoint();
        public void mouseDragged(MouseEvent e)
            end = e.getPoint();
            // locate high and low points of rectangle from start
            int dy = end.y - start.y;
            int dx = end.x - start.x;
            double theta = Math.atan2(dy, dx);
            double spoke = start.distance(end)/2;
            double side = Math.sqrt(spoke*spoke + spoke*spoke);
            Point[] corners = new Point[4];           // counter-clockwise
            corners[0] = start;                       // left
            int x = (int)(start.x + side * Math.cos(theta + Math.PI/4));
            int y = (int)(start.y + side * Math.sin(theta + Math.PI/4));
            corners[1] = new Point(x, y);             // bottom
            corners[2] = end;                         // right
            x = (int)(start.x + side * Math.cos(theta - Math.PI/4));
            y = (int)(start.y + side * Math.sin(theta - Math.PI/4));
            corners[3] = new Point(x, y);             // top
            cropPanel.setClip(corners);
    }

  • How to delete a write protected file from nokia x7...

    There are some files that i need to delete from my nokia x7 phone memory.  ( one mp3 file and a photo). It says that the file is write protected. Pls advice me

    The files MAY be embedded within the Firmware .. Even NCC can't remove them ...
    The cost of Battery may vary according to Region. You may contact Nokia Care or Authorised dealers in your area to know the exact price ...Anyways to get the battery replaced you need to visit Nokia Care ..

  • Items is a region displayed after a sql report region!

    Hello everybody!
    I have 3 regions :
    1/ HTML text region with some items : sequence 10, column1
    2/ SQL report region : sequence 20, column1
    3/ HTML text region with some items : sequence 30, column1
    I have many problems and errors when submitting the page and saving data into tables, I think that htmldb is not getting the correct values corresponding to the correct items.
    If I change the column diplay of the sql report region to "2", or if I change the sequence of the SQL report region to 40, all is ok!!!
    (I am using wwv_flow.g_f10(i) to retreive data from the report).
    Any idea ?

    Hello Raju,
    Ok, My example is more complexe, but I have succed to reproduce the error in a sample example in my oracle htmldb workspace,
    My access info have bee sect to : [email protected]
    You will find the example in application 21275_TEST page 2.
    I have 3 regions, the second is a report sql region in witch I have a popkeyfrom query item.
    My submit button, update a table with a text field (item P2_IT, region1) and a date(item P2_MONTH ,region3).
    You will see that when submitting, you will get an error : not a valid month....
    I have not understand what is being done at save, but I am sure that the value of P2_MONTH is not correctly setted when updating the table!
    Just, changing the sequence of the report region from 10 to 30 resolve the problem,
    but I must have this region between the two others!!!
    Thanks for the help!

  • Converting SQL Report Region to PLSQL Function Body Returning SQL Query

    All:
    I want to convert my SQL Report Region to a PLSQL-generated SQL Report Region so that I can eliminate where clauses dynamically and speed up my app, and also so that I can provide additional sorting options.
    <br><br>
    My problem is that I have lots of embedded single quotes that already are coded as 3 single quotes in the SQL Report Region. I am not sure at all how to code them within the PLSQL.
    <br><br>
    As example, here is one column from my query:
    <br><br>
    select decode(nvl(g.date_sub_1,g.date_rec_1), null, decode(g.article, 0, 'E', 1, 'U'), '< a href="javascript:unElevate( ' ' ' || g.grid || ' ' ',' ' ' || g.natca || ' ' ')">' || decode(g.article, 0, 'E', 1, 'U') || '< /a>') "Reverse" from g_table g
    <br><br>
    (Note that I added spaces within the code so it would display properly in the browser.)
    <br><br>
    To clarify, that's a double quote before javascript, and then 3 single quotes before the first concatenation group, then 3 single quotes after the second concatenation group, then 3 single quotes before the third, 3 single quotes after the fourth followed by an end-paren followed by a double quote etc.
    <br><br>
    My question is, what do I do with these triple-single quotes within PLSQL? Probably a no-brainer for the experienced folks, but I am thinking like a mobius strip at this point.
    <br><br>
    Bill
    Message was edited by:
    [email protected]
    Message was edited by:
    [email protected]
    Message was edited by:
    [email protected]

    Scott,
    I think that feature was made for my situation! I keep getting
    Function returning SQL query: Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the generic columns checkbox below the region source to proceed without parsing.
    (ORA-20001: Unable to bind :43 verify length of item is 30 bytes or less. Use v() syntax to reference items longer than 30 bytes. ORA-01006: bind variable does not exist)
    I did chop the query up into little bits, i.e.
    p_sql := p_sql || q'! ... !';
    p_sql := p_sql || q'! ... !';
    p_sql := p_sql || q'! ... !';
    return p_sql;
    But I'm not sure what I'm supposed to do here.
    Thank you.
    Bill

Maybe you are looking for

  • Issue with S_TABU_LIN

    Hi, I have implemented S_TABU_LIN object with Z Organisational level ( region specifc) to restrict access to few z tables at line item level. Usually before implementing S_tabu_lin , during execution of Z transactions a pop up used to come to select

  • WebDAv with Iplanet Webserver 4.1

    Hi, I want use Webdav with Iplanet Webserver 4.1 for publication . It's possible ? Regards, herve

  • I just upgraded from Adobe Album 3.2 to Elements 11.  My events and places are listed as keywords, b

    I just upgraded from Adobe Album 3.2 to Elements 11.  My events and places are listed as keywords, but not properly listed under the events an places category. Only people are correct .  How do I fix?

  • Has the hard drive died?

    Hello, My daughter's 2006 intel IMac has problems. Last night, it had frozen, and was playing a strange sound. When I forced a shut down, on restart the strange sound came again, and the folder and question mark icon - showing that the start-up drive

  • In Windows XP, wireless Keyboard freezes, then repeats key over and over

    When I'm working in Windows XP, my wireless apple aluminum keyboard will freeze for a brief second, then it will continue to repeat the last key I typed for while. I've searched through all the forums and cannot find a solution to this problem. Any i