Changeset 12471 in osm for applications
- Timestamp:
- 2008-12-22T14:07:28+01:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/measurement
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/measurement/build.xml
r10439 r12471 42 42 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 43 43 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 44 <attribute name="Plugin-Mainversion" value="1153" /> 44 45 </manifest> 45 46 </jar> -
applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementDialog.java
r10440 r12471 1 1 package org.openstreetmap.josm.plugins.measurement; 2 2 3 import static org.openstreetmap.josm.tools.I18n.marktr; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 4 5 … … 21 22 import org.openstreetmap.josm.data.osm.Node; 22 23 import org.openstreetmap.josm.gui.dialogs.ToggleDialog; 24 import org.openstreetmap.josm.gui.SideButton; 23 25 import org.openstreetmap.josm.tools.ImageProvider; 26 import org.openstreetmap.josm.tools.Shortcut; 24 27 import org.openstreetmap.josm.Main; 25 28 … … 36 39 * The reset button 37 40 */ 38 private JButton resetButton;39 41 private SideButton resetButton; 42 40 43 /** 41 44 * The measurement label for the path length 42 45 */ 43 46 protected JLabel pathLengthLabel; 44 47 45 48 /** 46 49 * The measurement label for the currently selected segments 47 50 */ 48 51 protected JLabel selectLengthLabel; 49 52 50 53 /** 51 54 * The measurement label for area of the currently selected loop 52 55 */ 53 56 protected JLabel selectAreaLabel; 54 57 55 58 /** 56 59 * The measurement label for the segment angle, actually updated, if 2 nodes are selected 57 60 */ 58 61 protected JLabel segAngleLabel; 59 62 60 63 /** 61 64 * Constructor … … 63 66 public MeasurementDialog() 64 67 { 65 super(tr("Measured values"), "measure", tr("Open the measurement window."), KeyEvent.VK_M, KeyEvent.ALT_DOWN_MASK); 66 68 super(tr("Measured values"), "measure", tr("Open the measurement window."), 69 Shortcut.registerShortcut("subwindow:measurement", tr("Toggle: {0}", tr("Measured values")), 70 KeyEvent.VK_M, Shortcut.GROUP_LAYER), 150); 71 67 72 JPanel buttonPanel = new JPanel(new GridLayout(1,2)); 68 69 resetButton = new JButton(tr("Reset"), ImageProvider.get("mapmode/selection/select")); 70 resetButton.setActionCommand("Reset"); 71 resetButton.addActionListener(this); 72 resetButton.setToolTipText(tr("Reset current measurement results and delete measurement path.")); 73 // resetButton.putClientProperty("help", "Dialog/SelectionList/Reset"); 74 73 74 resetButton = new SideButton(marktr("Reset"), "select", "Measurement", 75 tr("Reset current measurement results and delete measurement path."), this); 75 76 buttonPanel.add(resetButton); 76 77 add(buttonPanel, BorderLayout.SOUTH); -
applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementMode.java
r10379 r12471 48 48 return; 49 49 } 50 if (MeasurementPlugin.currentLayer == null){ 51 Main.main.addLayer(new MeasurementLayer("Measurement")); 52 } 53 MeasurementPlugin.currentLayer.mouseClicked(e); 50 MeasurementPlugin.getCurrentLayer().mouseClicked(e); 54 51 } 55 52 } -
applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementPlugin.java
r10379 r12471 6 6 import org.openstreetmap.josm.gui.IconToggleButton; 7 7 import org.openstreetmap.josm.gui.MapFrame; 8 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;9 8 import org.openstreetmap.josm.gui.layer.Layer; 9 import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener; 10 10 import org.openstreetmap.josm.plugins.Plugin; 11 11 … … 26 26 @Override 27 27 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 28 if(newFrame != null) {28 if(newFrame != null) 29 29 newFrame.addToggleDialog(measurementDialog); 30 } 31 if(Main.map != null){ 32 Main.map.toolBarActions.add(btn); 33 Main.map.toolGroup.add(btn); 34 35 Main.map.mapView.addLayerChangeListener(new LayerChangeListener(){ 30 if(Main.map != null) 31 Main.map.addMapMode(btn); 32 } 33 34 public static MeasurementLayer getCurrentLayer(){ 35 if(currentLayer == null){ 36 currentLayer = new MeasurementLayer(tr("Measurement")); 37 Main.main.addLayer(currentLayer); 38 currentLayer.listeners.add(new LayerChangeListener(){ 36 39 public void activeLayerChange(final Layer oldLayer, final Layer newLayer) { 37 40 if(newLayer instanceof MeasurementLayer) … … 44 47 }); 45 48 } 46 }47 48 public static MeasurementLayer getCurrentLayer(){49 if(currentLayer == null){50 currentLayer = new MeasurementLayer("Measurement");51 Main.main.addLayer(currentLayer);52 }53 49 return currentLayer; 54 50 }
Note:
See TracChangeset
for help on using the changeset viewer.