Reset canvas?

I clicked something by accident in CS4 and now the canvas stretches all the way to the right, with a couple of panels floating over the upper right part of the expanded canvas, with right scroll bar obscured by those floating panels. I want it back to what I believe is default, with the panels in their own static section on the right, separate from the canvas.
Can't find how to do this. Where is "reset" or something else to restore?

What operating system are you using?
Usually you can go to Window>Workspace and click on Essentials (Default) to straighten things out.

Similar Messages

  • Playing on viewer is fine but not on output

    I play timeline and out put to vcr to record my project. The canvuas show playing but not on output. It freezes. I read other people that happen to them. I try to reset canvas fit to window but it still happen freeze again. Is there anyway other to reset? I have project that are due.

    It would help to know what format(s) you're working with and how you're outputting from FCP. Do you have a card (ie AJA/Kona) or just using Firewire with DV25?
    Many things can cause playback problems, among them are:
    Canvas and Viewer window set larger than "Fit to Window"
    Too many overlays turned on; Image+Wireframe, Title Safe, Excess Luma, etc.
    Any of FCP's windows overlapping - even slightly
    Any of FCP's windows partially off screen
    Items in Timeline not fully rendered
    Playback quality set incorrectly
    -DH

  • Resetting the browser, viewer, canvas and time line to standard sizes

    Beginners Qs
    Q.1. What is the simple keyboard command (or other method) to reset the window sizes to normal after the have been manually adjusted. I moved the size of the canvas and can't seem to get it back to the snug fit showing full image?
    Q.2 What is the command to review Canvas in full screen and what is the command to revert to editing mode?

    1. Control-U
    2. Cmd-F12, but you have to set it up first in the View menu. Escape to revert to the interface.

  • Safari doesn't load pages containing html5 canvas on iMac

    Suddenly Safari either is very slow to load or doesn't load some pages at all.
    I have tracked it down to be pages containing html5 canvas element.
    This happens only on iMac and Macbook Air. It doesn't happen on iPad nor on Safari on a Pc. It will happen on the Mac computer both when the pages are out on the internet and when the pages ar locally stored. It's driving me absolutely mad!
    I've tried emptying cache both through Safari menu and by removing Safari's Cache.db, I've reset Safari preferences, restarted, and changed DNS to Open DNS (though it seems strange it should be an issue since the problem also occurs when I run the site on localhost).
    If I open the page directly entering the url in the adressbar it works fine, it is when I try to access it from a link on another page on the site it doesn't load. If I press reload it will load fine. The link from other pages can be either an html <a href="url"> tag or javascript window.location or window.location.href neither works. The weird thing is it worked fine until just yesterday. And it works fine on every other machine except the Macintoshes. WHY

    Hi Carolyn,
    Thanks for the quick reply. I've tried everything you wrote now, however the problem remains.
    One thing I've noted though is that the page actually loads but it takes very very long time, and sometimes when the pages have been loaded the images doesn't look quite right until I hit the reload button.
    I've been thinking about another thing, there are a lot of effects like round corner, shape and text shadow, can it be these that cause the problem? I still think it is very strange though that it all of a sudden stopped working and that running it on PC or iPad everything is just fine.
    Another thing to add is that the computer is very new just got it like 2-3 weeks ago, and haven't hardly added anything except got Xcode, macVim, firefox and Filezilla.
    Also just before the problem appeared I ran a page with javascript that had me caught in an endless loop of alerts. Got that fixed, but ever since that some pages won't load correclty...
    Is there possibly anything else I can do to fix this?

  • A script to increase the minimum canvas size? (Like Fit Image, but with just my canvas)

    For starters to be clear, I'm looking to manipulate canvas size. Not image size.
    I want to create a script to automatically increase the width and height of my canvas in Photoshop to a specific size when necessary. I only want this to happen if my canvas is less than that specified size. For example: Let's say my canvas size is 300x250. I want the canvas to be at LEAST 600x600. If I run my action it will increase the canvas size to 600x600 for me. If I run this same script on an image where the canvas size is already 700x700, it won't do anything at all to it because both the width and height are equal to or greater than my target size.
    It would also need to work with the height and width on an individual basis. If my image is 400x800, the action would increase my width from 400 to 600, but it would leave the height of 800 alone. So the final canvas size will end up being 600x800.
    It's kind of like the "Fit Image" option in Photoshop, but I only want to manipulate my canvas size, NOT my image size.

    It is possible.
    But if you hope that the dialog remembers the last settings that would require storing those values (which could be done with a txt-file at some pre-defined location), but it would make the Script a bit more complicated.
    // resize canvas in either direction if it is below a defined minimum;
    // 2011; use it at your own risk;
    #target photoshop
    if (app.documents.length > 0) {
    // dialog;
    var dlg = new Window("dialog", "increase width and height if under", [500,300,750,380]);
    // filter for checking if entry is numeric, thanks to xbytor;
    numberKeystrokeFilter = function() {
              if (this.text.match(/[^\-\.\d]/)) {
                        this.text = this.text.replace(/[^\d]/g, "")
              if (Number(this.text <= 0)) {this.text = 5};
              this.text = Math.round(Number(this.text));
    // fields for entry;
    dlg.hor = dlg.add("edittext", [14,15,88,35], "600", {multiline:false});
    dlg.hor.onChange = numberKeystrokeFilter;
    dlg.horText = dlg.add("statictext", [93,15,118,35], "px", {multiline:false});
    dlg.ver = dlg.add("edittext", [129,15,210,35], "600", {multiline:false});
    dlg.ver.onChange = numberKeystrokeFilter;
    dlg.verText = dlg.add("statictext", [215,15,240,35], "px", {multiline:false});
    dlg.hor.active = true;
    // ok- and cancel-button;
    dlg.buildBtn = dlg.add("button", [13,45,118,68], "OK", {name:"ok"});
    dlg.cancelBtn = dlg.add("button", [128,45,240,68], "Cancel", {name:"cancel"});
    // show dialog;
    dlg.center();
    // show dialog;
    var myReturn = dlg.show ();
    // proceed if ok-ed;
    if (myReturn == 1) {
    var myDocument = app.activeDocument;
    // set to pixels;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    // set the minimum values;
    var minWidth = Number(dlg.hor.text);
    var minHeight = Number(dlg.ver.text);
    // get current ones;
    var theWidth = myDocument.width;
    var theHeight = myDocument.height;
    // resize canvas;
    myDocument.resizeCanvas(Math.max(minWidth, theWidth), Math.max(minHeight, theHeight), AnchorPosition.MIDDLECENTER);
    // reset;
    app.preferences.rulerUnits = originalRulerUnits;

  • Problem with combo boxes and the reset button in certain situations

    Hi Everyone,
    i have a problem to make the reset-button function properly in an what-if analysis dashboard.
    The dashboard uses two combo boxes that are not visible at the same time. In my application the second combo box only appears when a dedicated menu (label based menu button) has been activated.
    So i have combo box 1 when menu A is active an dand combo box 2 when menu 2 is active.
    After starting the dashboard initial values are fine. If you then directly change to menu 2 (seeing combo box 2 with
    the correct default value) and press the reset button, the dashboard returns to the initial view, showing
    the menu 1 with the correct default value. If you now switch back  to menu 2, you will see, that the combo box 2
    is empty (i.e. nothing selected).
    I also tracked the destination cells for the combo box value results as well as the source cells for the "selected item" and the
    destination cells for the "Insert Selected Item". All this values seem to be correct. Therefore i assume that
    this is an issue of event handling. Maybe the combo box 2 does not refresh its selected value because it is already
    invisible when the values are restored.
    This case can easily be simulated by placing two combo boxes and a push button (that changes the visibility of
    the combo boxes) and the reset button on the canvas.
    Maybe someone can help. I am able to provide a test xlf, if neccessary.
    Thanks,
    Oliver
    P.S. I am using Xcelsius SP4 (Version 5.4.0.0)

    Hello Debjit_Singha_86,
    thank you for your support. At the moment i have the following setting:
    label based menu
    - General: Insertion Type "value" from a list of ID's for the menu-items to a dedicated cell (current menu ID, say tab1!$A$1)
    - Behavior: Selected item (position) fixted to item 1
    hidden combo box
    - General: Insertion Type "position" to a dedicated cell with the current choice (say tab1!$B$1)
    - Behavior: Selected item (position) to the same cell (tab1!$B$1)
    Can you give me a hint on how to connect the two components according to your solution, so that the label based menu sets the default for the hidden combox box only in case, that the reset button is pressed?
    Thanks,
    Oliver

  • Video size in Canvas

    Hi,
    I was messing around sizing the Canvas and quite by accident I pressed the CMD + combination and zoomed in on the Canvas video frame. I can use CMD + or - to resize but it never "fits". I can still drag the corner of the Canvas but the proportion remains the same (to large or to small). I have tried using the 100%, 50% and resetting to Standard layout but it remains the same. Any help? Thanks

    Please read the thread - it does no one any good to post the same answer already posted and acknowledged as the solution 10 hours later.
    Thanks,
    Patrick

  • Another Drag and Drop from horizontal list to canvas problem

    Hi,
    This is vaguely similar to the this
    topic
    but I seem to have made things even more complicated.
    Basic set up is a horizontal list that uses a custom
    component itemrenderer to display a thumbnail and label:
    <?xml version="1.0"?>
    <!-- Thumbnail.mxml -->
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="100" height="120" verticalAlign="top" verticalGap="3"
    verticalScrollPolicy="off" horizontalAlign="center"
    backgroundAlpha="0.0" alpha="1.0">
    <mx:Image id="img" height="60" width="80"
    source="assets/{data.file}" scaleContent="true"/>
    <mx:Label text="{data.text}" fontWeight="bold"
    width="100%" textAlign="center"/>
    </mx:VBox>
    The data is loaded up from an external XML file with this
    sort of format:
    <?xml version="1.0" encoding="UTF-8"?>
    <thumbnails>
    <thumb>
    <file>thumb_image_1.jpg</file>
    <text>Thumb 1</text>
    <url>
    http://www.blah.com</url>
    <id>thumb1</id>
    </thumb>
    </thumbnails>
    That's loaded up using the HTTPService and stored in a Model
    thing.
    I've got the dragging from the HL happening quite nicely and
    it drops fine on to the canvas area, code all hack off from the
    help files. The problem I'm having is finding out the data about
    the item I've just dropped, I should at least be able to get the
    source url for the thumbnail and the label text string, but I just
    don't know how to get it. The call back I'm using looks like this:
    private function doDragDrop(event:DragEvent,
    target1:Canvas):void {
    var vX:int = target1.mouseX;
    var vY:int = target1.mouseY;
    var vW:int = target1.width;
    var vH:int = target1.height;
    // follow variables give relative coordinate values so that
    if window size is altered
    // we don't have to do tricky calulations to reset rating
    positions.
    var vRx:Number = vX/vW;
    var vRy:Number = vY/vH;
    Alert.show(event.dragSource + " " + vX + " " + vY + " " +
    vRx + " " + vRy, 'Mouse drop loc', mx.controls.Alert.OK);
    I just don't know how to get the info out of the
    event.dragSource.
    Here's the full mxml:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="srv.send()">
    <mx:Script>
    <![CDATA[
    private function xmlLoaded():void {
    thumbAC = srv.lastResult.thumbnails;
    import mx.core.DragSource;
    import mx.managers.DragManager;
    import mx.events.*;
    import mx.containers.Canvas;
    import mx.controls.Alert;
    // Called when the user clicks the mouse on either colored
    canvas.
    // Initializes the drag.
    private function dragIt(event:MouseEvent, text:String,
    format:String):void {
    // Get the drag initiator component from the event object.
    var dragInitiator:Canvas=Canvas(event.currentTarget);
    // Called if the user dragged a proxy onto the drop target
    canvas.
    private function doDragEnter(event:DragEvent):void {
    // Get the drop target component from the event object.
    var dropTarget:Canvas=Canvas(event.currentTarget);
    DragManager.acceptDragDrop(dropTarget);
    // Called if the target accepts the dragged object and the
    user
    // releases the mouse button while over the canvas.
    // Handles the dragDrop event for the List control.
    private function doDragDrop(event:DragEvent,
    target1:Canvas):void {
    var vX:int = target1.mouseX;
    var vY:int = target1.mouseY;
    // follow variables give relative coordinate values so that
    if window size is altered
    // we don't have to do tricky calulations to reset rating
    positions.
    Alert.show(event.dragSource + " " + vX + " " + vY, 'Mouse
    drop loc', mx.controls.Alert.OK);
    ]]>
    </mx:Script>
    <mx:HTTPService id="srv" url="assets/thumbnails.xml"
    useProxy="false" result="xmlLoaded();"/>
    <mx:Model id="thumbAC"/>
    <mx:Panel height="160" layout="absolute" title="Thumbnail
    Browser" cornerRadius="10" id="thumbScrollBrowser" bottom="10"
    left="10" right="10">
    <mx:HorizontalList x="0" y="10" width="100%"
    height="110" id="thumbBrowser"
    dataProvider="{thumbAC.thumb}"
    dragEnabled="true" rollOverColor="#FFFFFF"
    selectionColor="#ffffff" borderColor="#FFFFFF"
    borderSides="0" borderStyle="none" alpha="1"
    backgroundAlpha="1.0"
    itemRenderer="Thumbnail">
    </mx:HorizontalList>
    </mx:Panel>
    <!-- THIS IS THE WALL -->
    <mx:ArrayCollection id="wallAC"/>
    <mx:Canvas id="myCanvas" backgroundColor="#ffffff"
    cornerRadius="10"
    borderStyle="solid"
    dragEnter="doDragEnter(event);"
    dragDrop="doDragDrop(event, myCanvas);" left="10" right="10"
    top="10" bottom="180">
    </mx:Canvas>
    </mx:Application>
    Thanks for any thoughts.
    Cheers,
    Rob

    This in the drop handler should give you back the XML you
    just dropped:
    var getListData:XML=
    evtDrag.dragSource.dataForFormat("items");

  • My Canvas Window wont show a display

    I don't know what happened but when I opened my FCP today my canvas display will only show black. Is there a setting i hit on accident. Is there a way to reset my Final Cut Pro to the default settings. Not sure what is happening. Any help would be greatly appreciated. Thanks

    Hi,
    welcome to the arena,
    just hit W. You have accidentally selected wireframe view.

  • Nothing come out from Canvas, pls help!

    No error but nothing come out. Please help!
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class StGeorgeFlag extends Applet implements ActionListener{ //, MouseListener, MouseMotionListener{
         Panel p;
         MyCanvas mycanvas;
         PlayButton play;
         ConfirmButton confirm;     
         SolutionButton solution;
         Dimension d;
         Graphics g;
         public void init(){
              int width = getSize().width;
              int height= getSize().height;
              p = new Panel();               
              setBackground(Color.lightGray);
              MyCanvas mycanvas = new MyCanvas();  // create the canvas          
              mycanvas.setSize(width-4, height-4);
              play = new PlayButton(this);
              confirm = new ConfirmButton(this);
              solution = new SolutionButton(this);
              add(play);
              add(confirm);
              add(solution);
              p.setLayout(new GridLayout(1,4,3,3));
              p.add(play);
              p.add(confirm);
              p.add(solution);
              setLayout(new BorderLayout(3,3));       // button border
              add("Center",mycanvas);             // add canvas and controls to the applet
              add("South",p);
         public void actionPerformed(ActionEvent e){
             if (e.getSource() == play) mycanvas.rectangle();                       
                  else if (e.getSource() == confirm) mycanvas.rectangle();
                   else if (e.getSource() == solution) mycanvas.solution();
         public void mousePressed(MouseEvent me){}
         public void mouseDragged(MouseEvent evt) {}
         public void mouseReleased(MouseEvent me){}
         public void mouseClicked(MouseEvent me){}  
         public void mouseEntered(MouseEvent me){}       
         public void mouseExited(MouseEvent me) {}
    }  // end Class StGeorgFlag
    class MyCanvas extends Canvas {
         Dimension d;
         public void paint (Graphics g){
               rectangle();
         public void rectangle() {
              Graphics g = getGraphics();
              Dimension d = getSize();
              int width = d.width;
              int height = d.height;
              g.setColor(Color.red);
              g.fillRect(2,2,width-4,height-4);
              int y = 2;          // width
              for (int row=0; row<2; row++){                         
                   int x = 2;     // height               
                   for (int col=0; col<2; col++){     
                        g.setColor(Color.white);
                        g.fillRect(x,y, width/5, height/5);                              
                        x = (x + width-(width/5+4));               
                   y = y+height-(height/5+4);                                        
         } // end method rectangle
         public void solution() {
                   Graphics g = getGraphics();
                   int width = d.width;
                   int height = d.height;
                   g.setColor(Color.red);
                   g.fillRect(2,2,width-4,height-4);
                   int y = 2;          // width
                   for (int row=0; row<2; row++){                         
                        int x = 2;     // height               
                        for (int col=0; col<2; col++){     
                             g.setColor(Color.white);
                             g.fillRect(x,y, width/8*3, height/3);                              
                             x = (x + (width/8*5)+4);               
                        y = y+(height/3*2+4);                                        
                   g.setColor(Color.black);
                   g.drawString("Solution" , width/5,height/3);
                   g.drawString("========"      , width/5,height/3+20);
                   g.drawString("- find the length diagonal (from corner to corner)" , width/5,(height/3)+40);
                   g.drawString("- divide diagonal by 2 to find the mid point" , width/5,(height/3)+60);
                   g.drawString("- find a quarter of the area of the flag " , width/5,(height/3)+80);
                   g.drawString("- So, the white are is: [(3m/8*2)*(2m/3)]*4 = 6 (half of flag area)", width/5,(height/3)+100);
         }// end method solution
    } // end class MyCanvas
    class PlayButton extends Button {
         PlayButton(StGeorgeFlag sgf) {
              super("Play/Reset");
              addActionListener(sgf);
    } // end Class PlayButton
    class ConfirmButton extends Button {     
         ConfirmButton(StGeorgeFlag sgf) { 
              super("Confirm");
              addActionListener(sgf);
    } // end class ResetButton
    class SolutionButton extends Button {
         SolutionButton(StGeorgeFlag sgf) { 
              super("Solution");
              addActionListener(sgf);
    } // end class SolutionButton

    NewJava wrote:
    No error Not sure that I agree with this. I get an NPE when I try to run this.
    but nothing come out. Please help!You're declaring your MyCanvas object twice, once in the class, and once in the init method, and only construct the second of the two. Declare this object only once -- in the class, and construct this same object once, and you're program will be closer to completion:
    Change this:
        MyCanvas mycanvas;
        public void init()
            int width = getSize().width;
            int height = getSize().height;
            p = new Panel();
            setBackground(Color.lightGray);
            MyCanvas mycanvas = new MyCanvas(); // create the canvas to this:
        MyCanvas mycanvas;
        public void init()
            int width = getSize().width;
            int height = getSize().height;
            p = new Panel();
            setBackground(Color.lightGray);
            //MyCanvas mycanvas = new MyCanvas(); // create the canvas
            mycanvas = new MyCanvas(); // create the canvas

  • Can QT 7.3 Upgrade Be Making My Final Cut Pro Canvas Green?

    Here is a problem that has suddenly, with no apparent cause, appeared. I have read through dozens of posts complaining of a similar problems and hundreds of posts that offer advice on how to fix it.
    My system is FCP 5.0.4, running on a Power Mac G5 Quad, with 4 gigs of memory. I am editing HDV. I have plenty of unused room on my scratch disk.
    THE PROBLEM
    Two days ago, when I started up the program after a hiatus of 2 months, I found that my canvas was green. It is green everywhere there isn’t a clip. It is green whether I start a brand new project or open an old project. The only thing that I can think of that has changed is that I installed the QT 7.3 upgrade.
    In addition, I am suddenly getting dropped-frame error messages that advise me to change my RT setting from Unlimited to Safe. I have never gotten this message before. I have fast enough processors and enough memory to handle my sequences, which aren’t that complex.
    I am also losing audio intermittently. My audio functions perfectly in other applications, so it is definitely an FCP problem.
    SOLUTIONS I HAVE ATTEMPTED
    The first thing everyone says is to trash my preferences. I have done this, both with the FCPRescue program and manually. I have trashed the three files under the FCP Preferences folder as well as the one other file in the preferences folder, as indicated on the Larry Jordan web site. One time I did this, it seemed to fix the problem, but the next time I started up FCP, the problem was back.
    Here is the sequence in which I did this: (1) I closed out of my project in FCP; (2) I quit FCP; (3) I trashed 4 preferences files; (4) I emptied the trash; (5) I re-started the computer; (6) I started up FCP; (7) I went in and reset my preferences; and (8) I opened my main project. Green canvas. Green canvas. Green canvas.
    I have checked to see that the channel is set to RGB, not Alpha.
    I have tried to make sure the background is set to black. It is, but remains green.
    I have checked to make sure my scratch disk is set properly.
    I have, in short, tried every solution suggested on a variety of forums. The problem persists.
    QUESTIONS
    Does anyone have any idea what CAUSES this problem? IS IT POSSIBLE IT IS QT 7.3?
    If I trash QT 7.3, will there be dire consequences?
    Thanks in advance for any suggestions.
    Giraut

    So why didn't you repost it here?!?!?!

  • My Canvas and Timeline are gone and I can't get them back

    Hey everyone.
    I've been using a new HD camera and i have had to change a billion settings on FCP. Now that I am no longer using HD it was time to go back to the way they were, but I must have done something wrong. My canvas and timeline are gone and I can't get them back. I tried going to window and just pulling them up but I can't click on the canvas and timeline buttons...
    Please help!!! I am fairly new at final cut pro and I need help. I have a film festival deadline approaching and only hope that some kind person out there can help!!

    Trash your FCP preferences. This will reset FCP to it's defaults.
    Close Final Cut Pro and open a Finder window.
    Click on your user name in the side bar.
    Open the following sub folders Library, Preferences, Final Cut Pro User Data.
    Place the following files in the Trash:
    Final Cut Pro 6.0 Prefs, Final Cut Pro Obj Cache, Final Cut Pro Prof Cache.
    Empty the Trash.
    Open Final Cut Pro. You will be asked to choose your working format (Easy Setup) and designate your scatch disks.

  • Re: creating zoom for my canvas

    HI
    I am trying to add zoom feature to the canvas which is the super class of the class zoom. As you can see when you run the code below. I have partially succeded in zooming in and zooming out with mouse drag. Although, the shapes dont zoom about the center of the canvas which is the my custom origin. Insted they zoom about the default origin(left top corner).
    Also as I zoom in and out the thickness of the shape's border changes. I have tried to use g2.setStroke(thickness) in paint method. But it seems to have no affect.
    Could any one suggest changes please.
    import java.awt.Canvas;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import java.awt.geom.AffineTransform;
    import java.awt.geom.Line2D;
    import javax.swing.JFrame;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    public class Zoom extends Canvas implements MouseMotionListener,MouseListener,ChangeListener{
           AffineTransform at = new AffineTransform();
        int x0, y0, x1, y1;
        double cx,cy;
        double zoom;
        Line2D.Double line;
         public Zoom(JFrame f){
             f.add(this);
             this.setBackground(Color.BLACK);
             addMouseListener(this);
             addMouseMotionListener(this);
        public void stateChanged(ChangeEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
        @Override
        public void paint(Graphics g){
             super.paint(g);
             Graphics2D g2 = (Graphics2D)g;
             g2.translate(cx, cy);
             g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);        
             g2.setPaint(Color.WHITE);
             AffineTransform orig = g2.getTransform();
           // at.translate(cx, cy);
          g2.setStroke(new BasicStroke(1));      
             g2.setTransform(at);        
             g2.drawLine(100, 200, 300, 200);
            // System.out.print("\n"+x0+"\n"+y0+"\n"+x1+"\n"+y1+"\n");
             line = new Line2D.Double(x0, y0, x1, y1);
             //g2.draw(line);     
             g2.setTransform(orig);
            // g2.translate(-cx, -cy);
         public static void main(String[] args) {
            JFrame f = new JFrame();
            Zoom z = new Zoom(f);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setSize(400, 400);
            f.setVisible(true);       
        public void mouseDragged(MouseEvent e) {
            e.consume();
            x1 = e.getX();
            y1 = e.getY();
            cx = this.getWidth()/2;
            cy = this.getHeight()/2;
            at.setToTranslation(0,0);
            at.scale(setZoom(), setZoom());
          //  at.createTransformedShape(line);
            this.repaint();
        public void mouseMoved(MouseEvent e) {
        public void mouseClicked(MouseEvent e) {
        public void mousePressed(MouseEvent e) {
            e.consume();
            x0 = e.getX();
            y0 = e.getY();
        public void mouseReleased(MouseEvent e) {
        public void mouseEntered(MouseEvent e) {
        public void mouseExited(MouseEvent e) {
        double setZoom(){
            return(getDrag());   
        double getDrag(){       
            double max,linelen;
            max = Math.sqrt(Math.pow(this.getWidth(), 2) + Math.pow(this.getHeight(), 2));
            linelen = Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2));
            return(linelen/max);
    }

    Here is your corrected code. It also takes care of the scaling of the stroke width problem, by applying the affine transformation to the shape and not to the canvas.
    import java.awt.BasicStroke; //JV: inserted
    import java.awt.Canvas;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import java.awt.Shape;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import java.awt.geom.AffineTransform;
    import java.awt.geom.Line2D;
    import java.awt.geom.Path2D;
    import javax.swing.JFrame;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    public class Zoom extends Canvas implements MouseMotionListener, MouseListener, ChangeListener {
        AffineTransform atf = new AffineTransform();
        int x0, y0, x1, y1;
        double cx, cy;
        double zoom;
        static Line2D line0 = new Line2D.Double(100.0, 200.0, 300.0, 200.0); //JV: inserted
        public Zoom(JFrame f) {
            f.add(this);
            this.setBackground(Color.BLACK);
            addMouseListener(this);
            addMouseMotionListener(this);
        public void stateChanged(ChangeEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
        @Override
        public void paint(Graphics g) {
            super.paint(g);
            Graphics2D g2 = (Graphics2D) g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                    RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setPaint(Color.WHITE);
            Shape transformedLine = new Path2D.Double(line0, atf);
            g2.setStroke(new BasicStroke(1)); //Note: stroke not affected by atf
            g2.draw(transformedLine);
        public static void main(String[] args) {
            JFrame f = new JFrame();
            Zoom z = new Zoom(f);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setSize(400, 400);
            f.setVisible(true);
        public void mouseDragged(MouseEvent e) {
            e.consume();
            x1 = e.getX();
            y1 = e.getY();
            cx = this.getWidth() / 2;
            cy = this.getHeight() / 2;
            atf.setToTranslation(cx, cy); //Reset atf
            atf.scale(setZoom(), setZoom());
            atf.translate(-cx, -cy);
            repaint();
        public void mouseMoved(MouseEvent e) {
        public void mouseClicked(MouseEvent e) {
        public void mousePressed(MouseEvent e) {
            e.consume();
            x0 = e.getX();
            y0 = e.getY();
        public void mouseReleased(MouseEvent e) {
        public void mouseEntered(MouseEvent e) {
        public void mouseExited(MouseEvent e) {
        double setZoom() {
            return (getDrag());
        double getDrag() {
            double max, linelen;
            max = Math.sqrt(Math.pow(this.getWidth(), 2) + Math.pow(this.getHeight(), 2));
            linelen = Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2));
            return (linelen / max);
    }

  • Resetting Background Color to default

    I made a change to the Background Color Property for the Canvas and now want to reset it to the default (so that it will use the color scheme set in the formsweb.cfg file). How do I do this? Typing in "<unspecified>" or "DEFAULT" does not work (it won't allow these values). I can't tell which of the swatches in the color picker would be the default value.
    thanks,
    sharlene
    [email protected]

    Guys, the original issue is to re-set the canvas
    background color without drop and re-create it. Thus
    that 'Inherit' button on top of the property will not
    work for canvas, but for items on the canvas!
    Worked for me. (Forms 6i Version 6.0.8.22.1, patch 13)
    In fact, I was about to ask how to set the background color of radio buttons, and just saw this topic. I tried the same thing for the radio buttons, and the Inherit button works there, too. (Thank you, Kevin!)

  • Move Field from Stacked Canvas to Tab Canvas

    Forms R2 10.1.2.0.2. Adding tab canvas to an existing form and want to retrofit a tab canvas into the form. When I move an existing field via the property sheet by changing Canvas and Tab page to Page, the field does not show. I can create a new field on the tab canvas with no problem. Is there a trick here that I am missing?

    I figured it out. You have to reset the X & Y position with an offset of the 0,0 position. The Tab Canvas has it own Grid separate from the Main Canvas, which starts at 0,0. I should have seen it before creating this post.

Maybe you are looking for

  • How can you block production for a specific product in SNP planning book

    Hi All, Looking for a way to manually indicate a decision to prevent production in a specific cell for a product in the SNP planning book utilizing the supply planning and capacity leveling heuristics.  For this requirement the resource would have av

  • How to delete keyboad language?

    When I switch the language on the  BB 9860 keyboard i must to choose from three languages "US UK RU". How I can delete one of English, no matter which. In the settings they not aviable to select and highlighted grey. Solved! Go to Solution.

  • Navigator-view limitations: what if there are too many buttons to show?

    I have a page that is really bad design, but I use it to fire up various dialog-paths into my application. For that I've got for every dialog-path a button that is only there to get me to the first page of a series of one business process. This is wh

  • Skipping Selection Screen

    Dear All,             My report looks like this,(ex.,). kpi                       month headcount              34 When i click on 34 it will calls standard transaction which is done by bdc program in zprogram., In my main program i called that zprogr

  • Satellite Pro A200 - System won't start

    Hi, was wondering if anyone could help? My Satellite Pro A200 with windows XP won't start. It begins with the Toshiba screen. Then goes to a black screen with text where it says "PXEE61 media test failure - check cable" (I have no cables) then says e