Changeset 29461 in osm for applications/editors/josm/plugins/imagery-xml-bounds/src/org
- Timestamp:
- 2013-04-02T00:59:43+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds
- Files:
-
- 2 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/ImageryXmlBoundsPlugin.java
r27015 r29461 18 18 import org.openstreetmap.josm.Main; 19 19 import org.openstreetmap.josm.actions.ExtensionFileFilter; 20 import org.openstreetmap.josm.data.Version;21 20 import org.openstreetmap.josm.data.osm.DataSet; 22 21 import org.openstreetmap.josm.gui.MapFrame; … … 24 23 import org.openstreetmap.josm.plugins.Plugin; 25 24 import org.openstreetmap.josm.plugins.PluginInformation; 26 import org.openstreetmap.josm.plugins.imageryxmlbounds.actions.ShowBoundsListAction; 27 import org.openstreetmap.josm.plugins.imageryxmlbounds.actions.ShowBoundsPropertiesAction; 25 import org.openstreetmap.josm.plugins.imageryxmlbounds.actions.ShowBoundsAction; 28 26 import org.openstreetmap.josm.plugins.imageryxmlbounds.actions.ShowBoundsSelectionAction; 29 27 import org.openstreetmap.josm.plugins.imageryxmlbounds.actions.downloadtask.DownloadXmlBoundsTask; … … 46 44 * Action showing bounds of the selected closed ways in Selection dialog 47 45 */ 48 private final ShowBounds ListAction selectionListAction = new ShowBoundsListAction();46 private final ShowBoundsAction selectionListAction = new ShowBoundsAction(); 49 47 50 48 /** 51 49 * Action showing bounds of the selected multipolygons in Properties dialog 52 50 */ 53 private final ShowBounds PropertiesAction propertiesListAction = new ShowBoundsPropertiesAction();51 private final ShowBoundsAction propertiesListAction = new ShowBoundsAction(); 54 52 55 53 /** 56 54 * Action showing bounds of the selected multipolygons in Relations dialog 57 55 */ 58 private final ShowBounds ListAction relationListAction = new ShowBoundsListAction();56 private final ShowBoundsAction relationListAction = new ShowBoundsAction(); 59 57 60 58 /** … … 82 80 Main.toolbar.register(selectionAction); 83 81 // Allow JOSM to download *.imagery.xml files 84 if (Version.getInstance().getVersion() >= 4523) { 85 Main.main.menu.openLocation.addDownloadTaskClass(DownloadXmlBoundsTask.class); 86 } 82 Main.main.menu.openLocation.addDownloadTaskClass(DownloadXmlBoundsTask.class); 87 83 } 88 84 … … 102 98 if (newFrame != null) { 103 99 // Initialize dialogs actions only after the main frame is created 104 newFrame.selectionListDialog.addPopupMenuSeparator(); 105 newFrame.selectionListDialog.addPopupMenuAction(selectionListAction); 106 newFrame.propertiesDialog.addMembershipPopupMenuSeparator(); 107 newFrame.propertiesDialog.addMembershipPopupMenuAction(propertiesListAction); 108 newFrame.relationListDialog.addPopupMenuSeparator(); 109 newFrame.relationListDialog.addPopupMenuAction(relationListAction); 100 newFrame.selectionListDialog.getPopupMenuHandler().addSeparator(); 101 newFrame.selectionListDialog.getPopupMenuHandler().addAction(selectionListAction); 102 newFrame.propertiesDialog.getMembershipPopupMenuHandler().addSeparator(); 103 newFrame.propertiesDialog.getMembershipPopupMenuHandler().addAction(propertiesListAction); 104 newFrame.relationListDialog.getPopupMenuHandler().addSeparator(); 105 newFrame.relationListDialog.getPopupMenuHandler().addAction(relationListAction); 106 } else if (oldFrame != null) { 107 // Remove listeners from previous frame to avoid memory leaks 108 if (oldFrame.relationListDialog != null) { 109 oldFrame.relationListDialog.getPopupMenuHandler().removeAction(relationListAction); 110 } 111 if (oldFrame.propertiesDialog != null) { 112 oldFrame.propertiesDialog.getMembershipPopupMenuHandler().removeAction(propertiesListAction); 113 } 114 if (oldFrame.selectionListDialog != null) { 115 oldFrame.selectionListDialog.getPopupMenuHandler().removeAction(selectionListAction); 116 } 110 117 } 111 118 } -
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsAction.java
r27014 r29461 19 19 import java.awt.Font; 20 20 import java.awt.event.ActionEvent; 21 import java.util.Collection; 21 22 22 23 import javax.swing.Box; … … 27 28 28 29 import org.openstreetmap.josm.Main; 30 import org.openstreetmap.josm.actions.OsmPrimitiveAction; 31 import org.openstreetmap.josm.data.osm.OsmPrimitive; 29 32 import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsLayer; 30 33 … … 34 37 */ 35 38 @SuppressWarnings("serial") 36 public class ShowBoundsAction extends ComputeBoundsAction {39 public class ShowBoundsAction extends ComputeBoundsAction implements OsmPrimitiveAction { 37 40 38 41 public ShowBoundsAction() { … … 58 61 JOptionPane.showMessageDialog(Main.parent, box, ACTION_NAME, JOptionPane.PLAIN_MESSAGE); 59 62 } 63 64 @Override 65 public void setPrimitives(Collection<? extends OsmPrimitive> primitives) { 66 updateOsmPrimitives(primitives); 67 } 60 68 }
Note:
See TracChangeset
for help on using the changeset viewer.