Changeset 27168 in osm
- Timestamp:
- 2011-11-28T11:47:56+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/piclayer
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/piclayer/build.xml
r27166 r27168 22 22 --> 23 23 <project name="PicLayer" default="dist" basedir="."> 24 <property name="commit.message" value="PicLayer - removed hiding buttons from PicLayer main menu - this is in core responsibility now"/>24 <property name="commit.message" value="PicLayer - now markers are visible only when they are needed - active Layer and transform/add marker mapmode"/> 25 25 <property name="plugin.main.version" value="4549"/> 26 26 <!-- -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java
r27166 r27168 130 130 btn.setVisible(false); 131 131 } 132 if (oldLayer != null) 133 ((PicLayerAbstract)oldLayer).setDrawPoints(false); 132 134 } 133 135 if (!oldPic && newPic) { // enter picture layer - reset visibility of controls -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/GenericPicTransformAction.java
r27120 r27168 54 54 if ( Main.map.mapView.getActiveLayer() instanceof PicLayerAbstract ) { 55 55 currentLayer = (PicLayerAbstract)Main.map.mapView.getActiveLayer(); 56 56 57 57 if ( currentLayer != null && e.getButton() == MouseEvent.BUTTON1 ) { 58 58 isDragging = true; … … 88 88 return l instanceof PicLayerAbstract; 89 89 } 90 91 90 91 protected void updateDrawPoints(boolean value) { 92 Layer active = Main.map.mapView.getActiveLayer(); 93 if (active instanceof PicLayerAbstract) { 94 ((PicLayerAbstract)active).setDrawPoints(value); 95 } 96 Main.map.mapView.repaint(); 97 } 98 92 99 } -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/affine/MovePointAction.java
r27120 r27168 32 32 } 33 33 } 34 34 35 35 @Override 36 36 public void mouseClicked(MouseEvent e) { 37 37 if (currentLayer == null) 38 38 return; 39 39 40 40 try { 41 41 Point2D pressed = currentLayer.transformPoint(e.getPoint()); … … 47 47 Main.map.mapView.repaint(); 48 48 } 49 50 @Override 51 public void enterMode() { 52 super.enterMode(); 53 updateDrawPoints(true); 54 } 55 56 @Override 57 public void exitMode() { 58 super.exitMode(); 59 updateDrawPoints(false); 60 } 49 61 } -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/affine/TransformPointAction.java
r27120 r27168 34 34 } 35 35 } 36 @Override 37 public void enterMode() { 38 super.enterMode(); 39 updateDrawPoints(true); 40 } 36 41 42 @Override 43 public void exitMode() { 44 super.exitMode(); 45 updateDrawPoints(false); 46 } 37 47 } -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java
r27154 r27168 77 77 private Icon layerIcon = null; 78 78 79 private boolean drawPoints = true; 80 81 public void setDrawPoints(boolean value) { 82 drawPoints = value; 83 } 84 79 85 private PictureTransform transformer; 80 86 … … 239 245 ); 240 246 } 241 // draw points for selection 242 Graphics2D gPoints = (Graphics2D)g2.create(); 243 244 gPoints.translate(pic_offset_x, pic_offset_y); 245 246 gPoints.setColor(Color.RED); // red color for points output 247 248 AffineTransform tr = AffineTransform.getScaleInstance(scalex, scaley); 249 tr.concatenate(transformer.getTransform()); 250 251 for (Point2D p : transformer.getOriginPoints()) { 252 Point2D trP = tr.transform(p, null); 253 int x = (int)trP.getX(), y = (int)trP.getY(); 254 gPoints.drawOval(x-2, y-2, 5, 5); 255 gPoints.drawImage(pinImage, x, y, null); 247 if (drawPoints ) { 248 // draw points for selection 249 Graphics2D gPoints = (Graphics2D)g2.create(); 250 251 gPoints.translate(pic_offset_x, pic_offset_y); 252 253 gPoints.setColor(Color.RED); // red color for points output 254 255 AffineTransform tr = AffineTransform.getScaleInstance(scalex, scaley); 256 tr.concatenate(transformer.getTransform()); 257 258 for (Point2D p : transformer.getOriginPoints()) { 259 Point2D trP = tr.transform(p, null); 260 int x = (int)trP.getX(), y = (int)trP.getY(); 261 gPoints.drawOval(x-2, y-2, 5, 5); 262 gPoints.drawImage(pinImage, x, y, null); 263 } 256 264 } 257 258 265 } else { 259 266 // TODO: proper logging
Note:
See TracChangeset
for help on using the changeset viewer.