Position problem with four zoom areas at a slide

Hi to all,
my problem, i've made a slide, containing a single picture (periodic table). Then, i added four zoom areas at the elements C, H, S and N. Source areas are 45 by 45 px, target areas are 180 to 180 px. I try to set fixed postions for the targets (Target || position X || Position Y):
Target 1
90
330
Target 2
290
330
Target 3
490
330
Target 4
690
330
The result looks really ugly, size and positions went totally wrong. This is just an examples, sometimes, the target areas are overlap each other, looks like a silly randomizer at work...
Maybe anyone can give me a idea/solution to fix this?
Thanks in advance
Marc

If you use CP5 or CP5.5 I would use Effects in this case: a combination of a motion path and scaling. Try to find the correct combination, save as a custom effect and apply to all the elements where you want the Zoom.
Lilybiri

Similar Messages

  • Buttons Position Problem with IE

    Hi,
    I'm having a problem with my buttons position. I was testing my application with other display configurations like 800 x 600.
    When I resize the browser my region button seems to get lost with its original position, its placed on the right of the region. All other items are Ok(Tabs, Parent Tabs, Region), and this problem only occurs in IE, when I'm testing with Firefox everything is fine.
    One interesting thing is that if I take off the Region Title, the button gets back to the right place. It's like the Title pushes the button out of its position, despite if they(Title and Button) are away from each other.
    Does anyone knows what's the problem?
    PS. Sorry for my poor english.
    Tks,
    Rafael

    Also i wonder if u could help me, id like to make the video of the home page to be the size of the frame, any idea of how i can do that?

  • Problem with the zoom effect

    I have five images in a row and I have added a zoom effect to
    the rollover and rollout effects. What I have noticed is that the
    image only zooms out when I bring the mouse out from the bottom of
    the image. If I try to bring the mouse from left to right across
    the images the first image zooms in but not out, and this happens
    for all five images. Can anyone identify what I am doing wrong?
    Here is my code:
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:Image source="@Embed('images/bistro9-1.jpg')"
    scaleX=".05" scaleY=".05" rollOver="doZoom(event)"
    rollOut="doZoom(event)"
    click="showImage('images/bistro9-1.jpg')"/>
    <mx:Image source="@Embed('images/bistro9-2.jpg')"
    scaleX=".05" scaleY=".05" rollOver="doZoom(event)"
    rollOut="doZoom(event)"
    click="showImage('images/bistro9-2.jpg')"/>
    <mx:Image source="@Embed('images/bistro9-3.jpg')"
    scaleX=".05" scaleY=".05" rollOver="doZoom(event)"
    rollOut="doZoom(event)"
    click="showImage('images/bistro9-3.jpg')"/>
    <mx:Image source="@Embed('images/bistro9-4.jpg')"
    scaleX=".05" scaleY=".05" rollOver="doZoom(event)"
    rollOut="doZoom(event)"
    click="showImage('images/bistro9-4.jpg')"/>
    <mx:Image source="@Embed('images/bistro9-5.jpg')"
    scaleX=".05" scaleY=".05" rollOver="doZoom(event)"
    rollOut="doZoom(event)"
    click="showImage('images/bistro9-5.jpg')"/>
    </mx:HBox>
    <mx:Zoom id="zoomAll" zoomWidthTo="0.06"
    zoomHeightTo="0.06" zoomWidthFrom=".05" zoomHeightFrom=".05" />
    public function doZoom(event:MouseEvent):void {
    if (zoomAll.isPlaying) {
    zoomAll.reverse();
    else {
    // If this is a ROLL_OUT event, play the effect backwards.
    // If this is a ROLL_OVER event, play the effect forwards.
    zoomAll.play([event.target], event.type ==
    MouseEvent.ROLL_OUT ? true : false);

    I figured out the problem I was having with my zoom effect.
    It worked when I added a specific number for height and width.
    Before I had a percent. Try adding a height and width number, it
    worked for me.

  • Problem with multiple content areas

    Hi,
    I'm stuck with following problem. I need to build the form that should contain two logical areas on the each page. Main area should handle main form content (long table) and another area containing barcodes(dynamic list that should be filled from xml). Each area must be flowed cause both table and barcodes data may be longer than their subforms.
    I've made one master page with two content areas on it.
    I've made main form page with two flowed subforms and customize their pagination so that each subform overflow be directed in corresponded content area.
    It's seems like all ok, but here's the problem:
    While the table data gets overflowed to next page, the barcodes data starts to filled ONLY when the table data ends.
    e.g. I've got 3 pages of table data first and more 2 pages of barcode data next instead of only 3 pages with all data compiled together.
    Can you help me with this issue?
    Thanks!

    Thank you for quick answer!
    sad to hear that such a logical way of solving the problem is impossible in LC..
    Maybe you can help me to find a right way?
    little more details about my issue:
    I need to manage the form so that it could include both table and barcodes(list) items (while each of them may flow onto multiple pages of the form). E.g. table lasts 4 pages and barcodes lasts only 2 pages.
    Table and barcode items are filled from xml file.
    e.g.
        123456
    I've make a sketch of desired form layout:
    http://www.ljplus.ru/img4/_/a/_a_lexx/form.gif
    Please, help me to find right way of doing this?
    Thank you!!

  • Problem with pen zoom

    Hi,
    I've a problem while zooming with wacom tablet. When I try to rezoom after the first zoom the image freezes for a while, then when I move the cursor the zoom jumps as if I were still holding the alt+pen button and then jumps to intended zoom. Sometimes I have to switch to spring hand tool to fix this and the hand tool stays active...
    I'm using scrubby zoom with wacom bamboo tablet on snow leopard

    Yeah, I think this is a bug. I encountered this error.
    I need to wait for a long time to bundle my folios and after that zoom didn't work, so i need to rebundle again, still dont work.
    What i do is get the first page(with working zoom) and put it in all the stacks folder, and bundle it. It work, then I need to copy paste all the correct pages in each pages and rebundle it again.
    Got so much work and time consuming, not very nice.
    I hope Adobe will fix this, their updating the functions to worst. I just noticed.

  • Constructions in Progress - Problem with CIAP evaluation area 50.

    Good day
    Experts
    I'm having a problem with the assets in progress. The GST credit in the area 50 should only be done on the liquidation of fixed assets in progress for the final asset.
    As the 4000 class, has no GST when transferring (here is transferred through the liquidation order, or modify the standard order of appropriation and appropriating the assets underway for the definitive asset).
    Logically, the area 50 is not fed.
    How can I leave the class of fixed assets in progress and no tax when you transfer to the ultimate ownership of the GST.
    Thanks already.
    The SAP version is 4.7 and were used as the basis of SAP standard solution for CIAP.
    Thanks in advance.
    Diego

    Hi Diego,
    What do you mean with 'GST' or 'GST credit'?
    Also, I am not clear what you refer to with 'CIAP'? From the asset class 4000 I take that you are referring to 'asset under construction' (AuC) issue.
    Can you maybe provide more details to describe the problem, if possible?
    I then will try if I can help you.
    Thanks and best regards,
    Brigitte Kuehni

  • Problem with Pinch & Zoom

    Hi there, I have set up my folio with multiple articles, each with a horizontal and vertical orientation. I imported each article seperately as PDF format. When I view on my iPad the pinch & zoom only works on the first page, but not on the rest. However, if I set up a folio with just horizontal orientation and PDF format the pinch & zoom works on all pages. Is this a bug or is there something else I should be doing to enable pinch & zoom on all pages?

    Yeah, I think this is a bug. I encountered this error.
    I need to wait for a long time to bundle my folios and after that zoom didn't work, so i need to rebundle again, still dont work.
    What i do is get the first page(with working zoom) and put it in all the stacks folder, and bundle it. It work, then I need to copy paste all the correct pages in each pages and rebundle it again.
    Got so much work and time consuming, not very nice.
    I hope Adobe will fix this, their updating the functions to worst. I just noticed.

  • Problems with "filter","zoom""#position""-moz-opacity""right""width""verical-align""ignored declaration"

    Are these problems related to any add-ons? I use Mac latest OS and version 4.0 Firefox.All my extensions and plugins are as far as I know updated to latest version.

    I am sorry, but you have changed the CSS beyound recognition; I do not want to spend my time going through it to correct it.
    One example that has angered me is
    BROWSER HACKS: the hacks below should not be changed unless you are an expert
    /* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
    ul.MenuBarVertical iframe
        position: absolute;
        z-index: 1010;
        filter:alpha(opacity:0.1);
        margin: 0;
        padding: auto;
        list-style-type: katakana;
        font-size: 100%;
        cursor: default;
        width: 13em;
        border-top-color: #edeeee;
        border-top-style:groove;
        border-bottom-color:#313132;
            border-bottom-style:groove;
        border-left-color:#cbcccd;
            border-left-style:groove;
        border-right-color:#3d3d3e;
        border-right-width: thin;
            border-right-style:groove;
    Changing this has not made you an expert
    Another example on or about line 155 is this line which is sure to upset the browser.
    ul.MenuBarVertical a:focus
    Yet another one
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
    ul.MenuBarVertical ul.MenuBarSubmenuVisible
       left: -11px;
        border-top-color: #edeeee;
        border-top-style:groove;
        border-bottom-color:#313132;
        border-bottom-style:solid;
            border-bottom-style:groove;
        border-left-color:#cbcccd;
            border-left-style:groove;
        border-right-color:#3d3d3e;
        border-right-width: thin;
            border-right-style:groove;
    I suggest you start with a new widget, but before you do, read this http://www.dwcourse.com/dreamweaver/ten-commandments-spry-menubars.php#one
    Gramps

  • CS4 - problem with timeline zoom bar

    I am in process of updating my systems from PPro2 to CS4.
    The timeline navigation (zoom/pan) bar above the timeline seems to be functionally inoperable.
    When I try to zoom in or out of the timeline by grabbing the right or left end of the bar and dragging, the timeline view jumps erratically from very wide to very small... with no in-between. 
    I realize that there are similar (but much smaller) controls to perfrom the same functions located at the lower left of the timeline,
    but after years of using of this timeline navigation function through several versions of the software, It has become my preferred method. 
    Am I missing something... or just another bug to report?

    Thanks for the replies... I have solved my problem.
    I was using the Synergy virtual KVM for keyboard/mouse control from system #1 while I configure CS4 on system #2.
    http://synergy2.sourceforge.net/
    Premiere doesn't like that, so I connected the mouse directly to system #2 and the problem is solved.
    Thanks again for your attention.

  • Not posted Treasury transactions- problem with new Business area (NewGL)

    Hi all,
    I have to change the Treasury account assignment objects due to a restructure. Currently, all TR transactions are assigned to one business area only.
    In future, there will be 3 (different) business areas.
    I have added new products, transaction tpyes etc and I have made further customising
    settings. It looks ok and I can enter new transactions, settle and post them.
    Problems I do have with already existing deals (fixed term and Forex transactions).
    In here I get posting errors with message:
    Balancing field "Business Area" in line item 001 not filled
    Message no. GLT2201
    I have added additional account assignment references for the new Business Areas
    and assigned to product types and account assignment
    What happens when I create a deal?
    Is that information (product type/ transaction/ account assignment) alreaedy stored in a table and used, when processing the deal further?
    Can I somehow change that original assignment per deal now?
    I think my problem lies in that the system wants to use the old assignment but also the new and it comes to conflict in field business area.
    Any hints much appreciated and will be reqarded as usual.
    Thanks
    Hein

    Assign Business area in the following step (ECC 6.0)
    SPRO - Financial Supply Chain Management - Treasury and Risk Management -  Transaction Manager - General Settings - Accounting - Link to Other Accounting Components - Allocate Additional Account Assignments to Account Assignment References
    Kalyan

  • Problems with Marquee Zoom

    So it appears that in Acrobat 8, Adobe has changed or done away with a function that I use at least 40 gazillion times a day.
    When I'm using any tool and want to zoom in on a specific area on the page without having to first manually select the magnifying glass tool, I am used to holding down the Command key + space bar, which changes the active tool into a magnifying glass, which I can then use to draw a border around the area I want to zoom in on. (This is called a marquee zoom.) Release keys and mouse, and presto, I'm zoomed in on that area. But I didn't have to manually select the marquee zoom tool first, and I don't have to manually go back and reselect whatever tool I was working with before the zoom.
    I've been using this Command key + space bar zoom function in Adobe products for ages -- I dunno, I think this goes way back to the early days of Illustrator. And it still works in CS3 versions of both Illustrator and InDesign.
    So why doesn't it work in Acrobat 8? Did Adobe disable this function? Why in the world would they disable it in one product but not others?
    So maybe they didn't disable it, but it doesn't work on my computer. Anybody have any info about this?
    Thanks,
    Laurie

    Russell -- thanks! Y'know, I hadn't even thought about trying this. My brain is on autopilot after all these years and I'm going to have to retrain it to specifically think about pressing space first.
    What's interesting is that sometimes it works, and sometimes it doesn't. So I think it's just buggy. I don't have to specifically think about pressing either key first in Illustrator or InDesign -- it works fine both ways in CS3.
    Again, thanks for your idea. I don't know if I'd have ever thought of this on my own yet in hindsight it seems obvious. Duh.

  • Problem with creating specific area by using BDT

    Hi Experts, i need some help plz,
    I have finished all the steps in note690900. But, there are 2 problems:
    1. I created a field called "PLU" (it has a matchcode), which must be displayed in a sub-screen (I create the sub-screen also) in TCODE REBDAO -> general data
    Now, the problem is that it is always display under both 'CHANGE' and 'DISPLAY' (That means, I can always modify the value of this field, but normally, we can't modify any value under 'DISPLAY')
    It is strange, I think the Filed Status must be modified, but I don't know how, do u have any idea for that?
    2. In TCODE REBDPR, I need to add a new reference/index,(just like 'general data', 'building law and usage' u2026) so in TCODE RECACUST -> Usage View -> Property -> Dialog -> Screen Sequences -> Screen Sequences Category u2013 Screen, I copied the standard to 'Z*', and added the new reference/index, then in Screen Sequences Category - Screen Sequences, defined the 'Z*' be displayed as standard.
    But the problem is: in TCODE REBDPR, the screen always displays the version of standard but not my 'Z*', how can I let the transaction display my screen 'Z*'?
    thanks

    Hi,
    please try the following.
    1.
    I assume you have set the field status according to the activities (display/change) for your field group.
    Please check if the PBO and PAI modules are created as described in note 690900 and assigned to the field group.
    note 690900: 
    c) Create a view for your fields by choosing 'Dialog -> Screen            
       Layout -> Views'. For this purpose, copy an existing entry, for        
       example REGC02. The name of the new view must begin with the           
       application, for example ZZZZ01 with the text 'Contract: File          
       number'.                                                               
       In 'Application' field, enter the name of your application.            
       In the 'Subscreen' area, enter the program name (SAPLaaaaaa with       
       aaaaaa being the name of your function group) and the screen           
       number of the subscreen created before:                                
       Program name: SAPLY_REGC_EXT                                           
       Screen number: 0901                                                                               
    In the 'Function module' area, enter the name of your PBO module       
       in field 'Before Output' (for example, ZZZZ_REGC_PBO_Z901), and        
       enter the name of your PAI module in the 'After Entry' field (for      
       example, ZZZZ_REGC_PAI_Z901). Leave the values of the remaining        
       fields for the view unchanged. NEVER use the function modules          
       from the standard view in your own screens. If you do so, a            
       program termination will occur because the subroutine to be            
       called is determined dynamically by the standard module.        
    Please assure that the function modules are created and assigned to   the view you have created.
    Please check also if the fields in your field group are assigned to the right table.
    e.g. PROPERTY
    The right one is REBD_PROPERTY_CI, not CI_VIBDPR!
    Please check also in your screen that your new fields have assigned the right structure (REBD_PROPERTY_CI) with dictionary reference!!
    2.
    Please check your entries in Screen Sequences Category - Screen Sequences.
    There should be both(!) entries the standard REBDPR and your Z* entry. Then you set the button 'standard' for your screen sequence and it should work. (I checked it in my system and at least there it worked)
    Hope this helps.
    Regards, Franz

  • Problems with how fonts are displayed across CS 6 since updating to OS X Yosemite

    I have recently updated CS 6 to its newest versions and also upgraded to OS X Yosemite and now the fonts in the preview panel don't show up as they used to. I don't think this is a major problem but it's just annoying. Does anyone know what the problem is or how i can fix it?
    I've included a screen shot of how it looks on illustrator and how it looks on microsoft word to show the difference.
    Any help at all would be appreciated.
    Thanks.

    "lauragilbertdesign  (in response to gtbernstein) "
    thanks to you both, mine the same, in the middle somewhere, and now a message to Adobe;
    You know it really gives me the pip (replaced extreme expletive with "pip" since expletives make Adobe wince) when I have to search through here for solutions to Adobe problems.
    Why does Adobe support have a lovely walled garden going on and no place for me to report bugs ?
    These type of bugs should be put on a list for Adobe developers to fix, but they don't, this "pip" software just goes on & on & I have to pay for this "pip" and live in pain all day while I try to make a living using this "pip".
    Adobe, you are "pip".

  • Problem With Sliders and Area of a circle-

    Hey everyone--
    New to Java and trying to work on an application where an oval is being manipulated by a slider and i have to caluculate and display the semi major(basically the diameter) and semi minor axes and caluculate the area of the ellipse. The center of the ellipse. should be on the center of the panel. A JSlider should be provided to alter the length of the major axis of the array. Note: the major axis may be along the x-axis (horizontal) or y-axis (vertical). The slider should be set up to represent percentage of the major axis. When the slider is at 0%, the major axis length would be equal to zero. When the slider is at 100%, the major axis length should be equal to the length of the JPanel.
    The major part I am having trouble with is how to get the oval to start at the center of the JFrame and how to get the circle to stop at the ends of the width of the JFrame and the ends of the Height of the JFrame.
    I have two different classes here they are below: the ovalPanel just draws a circle on it self and then the slider demo is an extension of that and is being used to calculate the area and semi major etc...
    import java.awt.*;
    import javax.swing.*;
    public class ovalPanel extends JPanel
    {  int diameter = 10;
    public void paintComponent(Graphics g)
    super.paintComponent(g);
    g.fillOval(246,237,diameter,diameter);
    public void setDiameter(int newDiameter)
    diameter = (newDiameter >= 0 ? newDiameter : 10);
    repaint();
    public Dimension getPreferredSize()
    return new Dimension(500,500);
    public Dimension getMinimumSize()
    return getPreferredSize();
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class sliderDemo extends JFrame
    {  private JSlider diameterSlider;
    private ovalPanel myPanel;
    private JPanel textPanel;
    private JTextField textField1, textField2, textField3;
    private JLabel label1, label2, label3;
    public sliderDemo()
    super("Slider & Ellipse Demo");
    myPanel = new ovalPanel();
    myPanel.setBackground(Color.YELLOW);
    diameterSlider= new JSlider(SwingConstants.HORIZONTAL, 0, 400, 10);
    diameterSlider.setMajorTickSpacing(10);
    diameterSlider.setPaintTicks(true);
    diameterSlider.addChangeListener(
    new ChangeListener()
         public void stateChanged(ChangeEvent e)
         myPanel.setDiameter(diameterSlider.getValue());
    textField1= new JTextField(5);
    textField2= new JTextField(5);
    textField3= new JTextField(5);
    label1=new JLabel("semiMajor: ");
    label2=new JLabel("semiMinor: ");
    label3=new JLabel(" Area: ");
    textPanel = new JPanel();
    textPanel.add(label1);
    textPanel.setLayout(new GridLayout (1,3));
    textPanel.add(textField1);
    textPanel.add(label2);
    textPanel.add(textField2);
    textPanel.add(label3);
    textPanel.add(textField3);
    Container container = getContentPane();
    container.add(diameterSlider, BorderLayout.SOUTH);
    container.add(myPanel, BorderLayout.CENTER);
    container.add(textPanel, BorderLayout.NORTH);
    setSize(500, 500);
    setVisible(true);
    public static void main(String args [])
    sliderDemo application = new sliderDemo();
    application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Anyone help out with this--would be greatly appreciated
    rich_crush

    Here is a better description of what is needed :
    Write a GUI application that displays an ellipse (oval) of variable size and calculates and displays the semi-major and semi-minor axes and the area of the ellipse. The size of an ellipse is determined by two constants, conventionally denoted a and b. The constant a equals the length of the semi-major axis (i.e. half of the length of the major axis); the constant b equals the length of the semi-minor axis (i.e. half of the length of minor axis).
    The area enclosed by an ellipse is , where � is Math.PI.
    All drawings must be done on a subclass of JPanel, and the result of the calculations should be displayed in JLabels. The center of the ellipse. should be on the center of the panel. A JSlider should be provided to alter the length of the major axis of the array. Note: the major axis may be along the x-axis (horizontal) or y-axis (vertical). The slider should be set up to represent percentage of the major axis. When the slider is at 0%, the major axis length would be equal to zero. When the slider is at 100%, the major axis length should be equal to the length of the JPanel. The initial major axis length should be at 1/2 of the panel length.
    As the ellipse. changes, the lengths of the semi-major axis, semi-minor axis, and the area should be updated and displayed.
    The animation below illustrates the Ellipse Slider program in motion. As you see, the drawn shape will be a circle until it grows big enough to touch the long sides of the JPanel, after which, it will grow as an ellipse (oval) until it touches the narrow sides of the panel.
    Please help--very confused :)
    rich_crush

  • Problem with jpanel zooming

    friends,
    i have a jpanel with image as background and i am adding jlabels dynamically to the jpanel. i have to move the jlabel on the image so i added mouse listener to jlabel. now i want to add zooming functionality to the jpanel.
    now if zoom out jpanel everything works well but jlabel mouse listener location is not changing so if i click on jlabel its not activating listener - i need to click outside of jlabel/jpanel (its original location when its 100% zoom) to activate the listener. how can i correct this ?
    thanks in advance
    i will add example after i cutdown (its part of big application)

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.net.*;
    import java.util.ArrayList;
    import java.util.List;
    import javax.imageio.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    public class PP3 extends JFrame {
        private JButton btnStart;
        private JButton btnStop;
        private JLabel logoLabel;
        private JSlider zoom;
        private JPanel mainPanel;
        private JPanel btnPanel;
        private JScrollPane jspane;
        private BackPanel3 secondPanel;
        private boolean start = false;
        public PP3() {
            initComponents();
            setVisible(true);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
        private void initComponents() {
            logoLabel = new JLabel();
            mainPanel = new JPanel();
            btnPanel = new JPanel();
            btnStart = new JButton();
            btnStop = new JButton();
            zoom = new JSlider(0,100,100);
            setBackground(Color.white);
            setLayout(new BorderLayout());
            mainPanel.setBackground(Color.white);
            mainPanel.setBorder(new EtchedBorder());
            mainPanel.setPreferredSize(new Dimension(650, 600));
            mainPanel.setLayout(new CardLayout());
            jspane = new JScrollPane(getSecondPanel());
            mainPanel.add(jspane,"Second Panel");
            add(mainPanel, BorderLayout.CENTER);
            btnPanel.setLayout(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(2,2,2,2);
            gbc.weighty = 1.0;
            gbc.gridwidth = gbc.REMAINDER;
            btnPanel.setBackground(Color.white);
            btnPanel.setBorder(new EtchedBorder());
            btnPanel.setPreferredSize(new Dimension(150, 600));
            btnStart.setText("Start Labelling");
            btnPanel.add(btnStart, gbc);
            btnStart.setEnabled(true);
            btnStart.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent ae){
                    start = true;
                    btnStart.setEnabled(false);
                    btnStop.setEnabled(true);
                    if(secondPanel != null){
                        secondPanel.setStart(start);
                        Cursor moveCursor = new Cursor(Cursor.TEXT_CURSOR);
                        secondPanel.setCursor(moveCursor);
            btnStop.setText("Done Labelling");
            btnPanel.add(btnStop, gbc);
            btnStop.setEnabled(false);
            btnStop.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent ae){
                    start = false;
                    btnStart.setEnabled(true);
                    btnStop.setEnabled(false);
                    if(secondPanel != null){
                        secondPanel.setStart(start);
                        Cursor moveCursor = new Cursor(Cursor.DEFAULT_CURSOR);
                        secondPanel.setCursor(moveCursor);
            final JLabel zoomLabel = new JLabel("Zoom");
            zoomLabel.setBorder(BorderFactory.createEtchedBorder());
            gbc.weighty = 0;
            gbc.weightx = 1.0;
            gbc.fill = GridBagConstraints.HORIZONTAL;
            btnPanel.add(zoomLabel, gbc);
            btnPanel.add(zoom, gbc);
            zoom.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent ce) {
                    JSlider source = (JSlider)ce.getSource();
                    if(secondPanel != null) {
                        secondPanel.setZoomFactor((double)source.getValue());
                        zoomLabel.setText("Zoom = " + source.getValue()/100.0);
            String id = "<html><nobr>show label</nobr><br><center>locations";
            JCheckBox check = new JCheckBox(id, secondPanel.showLocations);
            check.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    secondPanel.toggleShowLocations();
            gbc.weighty = 1.0;
            gbc.fill = GridBagConstraints.NONE;
            btnPanel.add(check, gbc);
            add(btnPanel, BorderLayout.EAST);
            pack();
        public JPanel getSecondPanel() {
            if(secondPanel == null) {
                secondPanel = new BackPanel3("images/cougar.jpg", 850, 1100);
                secondPanel.setStart(false);
            return secondPanel;
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new PP3();
    class BackPanel3 extends JPanel implements MouseListener,
                                               MouseMotionListener{
        String imgPath = null;
        BufferedImage image;
        private int width = 0;
        private int height = 0;
        private double zoomFactor = 1.0;
        private boolean start = false;
        private boolean same = false;
        Cursor hourglassCursor = new Cursor(Cursor.MOVE_CURSOR);
        // choose a declaration according to your java version
        List<JLabel> labels;     // declaration for j2se 1.5+
    //    List labels;           // j2se 1.4-
        JLabel lastSelected;
        boolean showLocations;
        JLabel selectedLabel;
        boolean dragging;
        Point offset;
        int count = 0;
        private static String SELECTED = "selected";
        public BackPanel3(String path, int width, int height){
            setLayout(null);
            this.width = width;
            this.height = height;
            setPreferredSize(new Dimension(width,height));
            addMouseListener(this);
            addMouseMotionListener(this);
            // chose an instantiation according to your java version
            labels = new ArrayList<JLabel>();    // j2se 1.5+
    //        labels = new ArrayList();          // j2se 1.4-
            lastSelected = new JLabel();
            lastSelected.putClientProperty(SELECTED, Boolean.FALSE);
            showLocations = true;
            dragging = false;
            offset = new Point();
            this.imgPath = path;
            setImage();
        public void setImage(){
            try{
                image = getImage(imgPath);
            }catch(Exception e){
                System.out.println(" (init) ERROR: " + e);
                e.printStackTrace();
        public void setStart(boolean flag){
            start = flag;
        public void setZoomFactor(double zoom){
            zoomFactor = (zoom/100);
            setPreferredSize(new Dimension((int)(850*zoomFactor), (int)(1100*zoomFactor)));
            repaint();
            revalidate();
        public double getZoomFactor(){
            return zoomFactor;
        public void toggleShowLocations() {
            showLocations = !showLocations;
            repaint();
        public void mouseClicked(MouseEvent e) {
            if(start){
                JLabel msgLabel = new JLabel("Test " + count++);
                this.add(msgLabel);
                Dimension d = msgLabel.getPreferredSize();
                msgLabel.setBounds(e.getX(), e.getY(), d.width, d.height);
                labels.add(msgLabel);
                msgLabel.putClientProperty(SELECTED, Boolean.FALSE);
                return;
        public void mousePressed(MouseEvent e) {
            Point p = e.getPoint();
            for(int j = 0; j < labels.size(); j++) {
                JLabel label = (JLabel)labels.get(j);
                Rectangle bounds = label.getBounds();
                AffineTransform at =
                    AffineTransform.getScaleInstance(zoomFactor, zoomFactor);
                Shape xs = at.createTransformedShape(bounds);
                if(xs.contains(p)) {
                    selectedLabel = label;
                    Rectangle r = xs.getBounds();
                    offset.x = p.x - r.x;
                    offset.y = p.y - r.y;
                    dragging = true;
                    break;
        public void mouseReleased(MouseEvent e) {
            dragging = false;
        public void mouseDragged(MouseEvent me){
            if(dragging) {
                Rectangle bounds = selectedLabel.getBounds();
                AffineTransform at =
                    AffineTransform.getScaleInstance(1.0/zoomFactor, 1.0/zoomFactor);
                Point2D p = at.transform(me.getPoint(), null);
                int x = (int)(p.getX() - offset.x);
                int y = (int)(p.getY() - offset.y);
                selectedLabel.setLocation(x, y);
                repaint();
        public void mouseMoved(MouseEvent me){
            if(labels.size() == 0)
                return;
            Point p = me.getPoint();
            boolean hovering = false;
            boolean selectionChanged = false;
            for(int j = 0; j < labels.size(); j++) {
                final JLabel label = (JLabel)labels.get(j);
                Rectangle r = label.getBounds();
                AffineTransform at =
                    AffineTransform.getScaleInstance(zoomFactor, zoomFactor);
                Shape scaledBounds = at.createTransformedShape(r);
                if(scaledBounds.contains(p)) {
                    hovering = true;
                    if(!((Boolean)label.getClientProperty(SELECTED)).booleanValue()) {
                        label.putClientProperty("selected", Boolean.TRUE);
                        setCursor(hourglassCursor);
                        if(lastSelected != label)  // for only one JLabel
                            lastSelected.putClientProperty(SELECTED, Boolean.FALSE);
                        lastSelected = label;
                        selectionChanged = true;
                        break;
            // reset lastSelected when there is no selection/hovering
            if(!hovering &&
                ((Boolean)lastSelected.getClientProperty(SELECTED)).booleanValue()) {
                lastSelected.putClientProperty(SELECTED, Boolean.FALSE);
                setCursor(Cursor.getDefaultCursor());
                selectionChanged = true;
            if(selectionChanged)
                repaint();
        public void mouseEntered(MouseEvent e) { }
        public void mouseExited(MouseEvent e) { }
        protected void paintComponent(Graphics g){
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.scale(zoomFactor, zoomFactor);
            g2.drawImage(image, 0, 0, this);
            if(showLocations) {
                // show bounds of the actual JLabel children
                // components as they exist on this component
                AffineTransform at = AffineTransform.getScaleInstance(1.0/zoomFactor,
                                                                      1.0/zoomFactor);
                g2.setPaint(Color.blue);
                Component[] c = getComponents();
                for(int j = 0; j < c.length; j++)
                    g2.draw(at.createTransformedShape(c[j].getBounds()));
            // show selected label
            g2.setPaint(Color.red);
            for(int j = 0; j < labels.size(); j++) {
                JLabel label = (JLabel)labels.get(j);
                if(((Boolean)label.getClientProperty("selected")).booleanValue()) {
                    g2.draw(label.getBounds());
                    break;
        protected BufferedImage getImage(String path){
            try{
                URL imgURL = BackPanel3.class.getResource(path);
                if (imgURL == null &&
                       (path.indexOf(":\\") > 0 || path.indexOf(":/") > 0))
                    imgURL = new URL("file:///"+path);
                return getImage(imgURL);
            }catch(MalformedURLException mue){
                System.out.println("error "+mue);
            return null;
        protected BufferedImage getImage(URL url){
            try{
                if (url != null) {
                    BufferedImage source = ImageIO.read(url);
                    double xScale = (double)width / source.getWidth();
                    double yScale = (double)height / source.getHeight();
                    double scale = Math.min(xScale, yScale);
                    int w = (int)(scale*source.getWidth());
                    int h = (int)(scale*source.getHeight());
                    BufferedImage scaled = new BufferedImage(w, h, source.getType());
                    Graphics2D g2 = scaled.createGraphics();
                    g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                        RenderingHints.VALUE_INTERPOLATION_BICUBIC);
                    // scales faster than getScaledInstance
                    AffineTransform at = AffineTransform.getScaleInstance(scale, scale);
                    g2.drawRenderedImage(source, at);
                    g2.dispose();
                    return scaled;
                }else{
                    return null;
            }catch(IOException ioe){
                System.out.println("read error "+ioe);
                return null;
    }

Maybe you are looking for

  • How do you lock the name of a hard drive?

    I have looked quite a bit through the forums and cannot find an exact answer concerning locking the HD name not the entire drive, just its name. Over the years I have several times, I quess parked the cursor over the name of the hard drive and some h

  • Problem when creating configuration Scenario

    hi all when i Create configuration Scenario use sap XI then it warning that "Error initializing key service (COULD_NOT_GET_KEYSERVICE)" and "The log file for database 'N4S' is full. Back up the transaction  log for the database to free up some log sp

  • HTMLDB 1.6 - 'Create Application' button results in Error

    Hi, I've downloaded and installed HTMLDB 1.6 from OTN and have followed the instructions from the OBE tutorial. After fighting with the dads.conf file and the HTTP server, I've managed to log in and complete the tutorial. The problem I now have is th

  • Can't add Credit Card funds

    hello,I'm trying to purchase this $2 in app purchase for "Marvel:Contest Of Champions" but I can't add funds though,there is no Edit button on the Apple ID option,and I also changed Emails.HELP

  • "Max Actions" as described by Mark Galer

    In the new book Adobe Photoshop Elements 5.0 Maximum Performance by Mark Galer - iTunes Tutorial shows how to use the new "Maximum Actions" features. This is supposed to be an option under Special Effects along with Filters and PHoto Effects. However