Ignore:
Timestamp:
2009-08-28T17:53:09+02:00 (15 years ago)
Author:
tstelmach
Message:

Scaling in one axis, new icons

Location:
applications/editors/josm/plugins/piclayer
Files:
6 added
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/piclayer/README

    r14774 r17321  
    1010Step 2b) If you chose a clipboard, please wait. For some reason it takes time. To be fixed later.
    1111NOTE) If something failed, you should get a message box. If not - check the console for messages (Linux only?)
    12 Step 3) Once the image is visible you may start positioning it. For that - select the PicLayer in the layers list.
     12Step 3) Once the image is visible you may start positioning it. For that - select the PicLayer in the layers list and activate it (!).
    1313Step 4) Start aligning the image.
    1414Step 4a) Move the image by choosing 'Move' from the toolbar and draggin the mouse around with left button pressed.
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/HelpAction.java

    r14779 r17321  
    6464            + "NOTE) If something failed, you should get a message box. If not - check the console for messages (Linux only?)"
    6565            + "\n"
    66             + "Step 3) Once the image is visible you may start positioning it. For that - select the PicLayer in the layers list."
     66            + "Step 3) Once the image is visible you may start positioning it. For that - select the PicLayer in the layers list and activate it (!!!)."
    6767            + "\n"
    6868            + "Step 4) Start aligning the image."
     
    7373            + "\n"
    7474            + "Step 4c) Scale the image by choosing 'Scale' from the toolbar and draggin the mouse up/down with left button pressed."
     75            + "\n"
     76            + "Step 4d) You can also choose to scale in just one axis by selecting the proper button."
    7577            + "\n"
    7678            + "NOTE) If it does not work - make sure the right layer is selected."
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java

    r16302 r17321  
    6060    private double m_angle = 0.0;
    6161    // Scale of the image
    62     private double m_scale = 1.0;
     62    private double m_scalex = 1.0;
     63    private double m_scaley = 1.0;
    6364    // The scale that was set on the map during image creation
    6465    private double m_initial_scale = 0;
     
    190191            g.rotate( m_angle * Math.PI / 180.0 );
    191192            // Scale
    192             double scale = m_scale * m_initial_scale / Main.map.mapView.getDist100Pixel();
    193             g.scale( scale, scale );
     193            double scalex = m_scalex * m_initial_scale / Main.map.mapView.getDist100Pixel();
     194            double scaley = m_scaley * m_initial_scale / Main.map.mapView.getDist100Pixel();
     195            g.scale( scalex, scaley );
    194196
    195197            // Draw picture
     
    222224     * Scales the picture. Scaled in... don't know but works ok :)
    223225     */
    224     public void scalePictureBy( double scale ) {
    225         m_scale += scale;
     226    public void scalePictureBy( double scalex, double scaley ) {
     227        m_scalex += scalex;
     228        m_scaley += scaley;
    226229    }
    227230
     
    244247     */
    245248    public void resetScale() {
    246         m_scale = 1.0;
     249        m_scalex = 1.0;
     250        m_scaley = 1.0;
    247251    }
    248252
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java

    r14779 r17321  
    4242        private IconToggleButton m_movePictureButton = null;
    4343        private IconToggleButton m_rotatePictureButton = null;
    44         private IconToggleButton m_scalePictureButton = null;
     44        private IconToggleButton m_scalexPictureButton = null;
     45        private IconToggleButton m_scaleyPictureButton = null;
     46        private IconToggleButton m_scalexyPictureButton = null;
    4547       
    4648        // Menu actions
     
    8183                MovePictureAction movePictureAction = new MovePictureAction(newFrame);
    8284                RotatePictureAction rotatePictureAction = new RotatePictureAction(newFrame);
    83                 ScalePictureAction scalePictureAction = new ScalePictureAction(newFrame);
     85                ScaleXYPictureAction scaleXYPictureAction = new ScaleXYPictureAction(newFrame);
     86                ScaleXPictureAction scaleXPictureAction = new ScaleXPictureAction(newFrame);
     87                ScaleYPictureAction scaleYPictureAction = new ScaleYPictureAction(newFrame);
    8488                // Create plugin buttons and add them to the toolbar
    8589                m_movePictureButton = new IconToggleButton(movePictureAction);
    86                 m_rotatePictureButton = new IconToggleButton(rotatePictureAction);
    87                 m_scalePictureButton = new IconToggleButton(scalePictureAction);
     90            m_rotatePictureButton = new IconToggleButton(rotatePictureAction);
     91            m_scalexyPictureButton = new IconToggleButton(scaleXYPictureAction);
     92            m_scalexPictureButton = new IconToggleButton(scaleXPictureAction);
     93            m_scaleyPictureButton = new IconToggleButton(scaleYPictureAction);
    8894            newFrame.addMapMode(m_movePictureButton);
    8995            newFrame.addMapMode(m_rotatePictureButton);
    90             newFrame.addMapMode(m_scalePictureButton);
    91             newFrame.toolGroup.add(m_movePictureButton);
    92             newFrame.toolGroup.add(m_rotatePictureButton);
    93             newFrame.toolGroup.add(m_scalePictureButton);
    94             // Hide them by default
     96            newFrame.addMapMode(m_scalexyPictureButton);
     97            newFrame.addMapMode(m_scalexPictureButton);
     98            newFrame.addMapMode(m_scaleyPictureButton);
     99//            newFrame.toolGroup.add(m_movePictureButton);
     100//            newFrame.toolGroup.add(m_rotatePictureButton);
     101//            newFrame.toolGroup.add(m_scalePictureButton);
     102            // Show them by default
    95103            m_movePictureButton.setVisible(true);
    96104            m_rotatePictureButton.setVisible(true);
    97             m_scalePictureButton.setVisible(true);
     105            m_scalexyPictureButton.setVisible(true);
     106            m_scalexPictureButton.setVisible(true);
     107            m_scaleyPictureButton.setVisible(true);
    98108        }
    99109    }
     
    103113         */
    104114        public void activeLayerChange(Layer oldLayer, Layer newLayer) {
    105                 m_movePictureButton.setEnabled( newLayer instanceof PicLayerAbstract );         
    106                 m_rotatePictureButton.setEnabled( newLayer instanceof PicLayerAbstract );               
    107                 m_scalePictureButton.setEnabled( newLayer instanceof PicLayerAbstract );
    108115        }
    109116
Note: See TracChangeset for help on using the changeset viewer.