Changeset 20489 in osm for applications/editors/josm/plugins/turnrestrictions/src/org
- Timestamp:
- 2010-03-15T12:48:23+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions
- Files:
-
- 20 added
- 1 edited
- 8 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionsPlugin.java
r20384 r20489 5 5 import org.openstreetmap.josm.plugins.Plugin; 6 6 import org.openstreetmap.josm.plugins.PluginInformation; 7 import org.openstreetmap.josm.plugins.turnrestrictions.list.TurnRestrictionsListDialog; 7 8 import org.openstreetmap.josm.plugins.turnrestrictions.preferences.PreferenceEditor; 8 9 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/AbstractTurnRestrictionsListView.java
r20384 r20489 1 package org.openstreetmap.josm.plugins.turnrestrictions; 1 package org.openstreetmap.josm.plugins.turnrestrictions.list; 2 2 3 3 import javax.swing.JList; -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionListCellRenderer.java
r20384 r20489 1 package org.openstreetmap.josm.plugins.turnrestrictions; 1 package org.openstreetmap.josm.plugins.turnrestrictions.list; 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetListModel.java
r20384 r20489 1 package org.openstreetmap.josm.plugins.turnrestrictions; 1 package org.openstreetmap.josm.plugins.turnrestrictions.list; 2 2 3 3 import java.util.Collection; -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetView.java
r20384 r20489 1 package org.openstreetmap.josm.plugins.turnrestrictions; 1 package org.openstreetmap.josm.plugins.turnrestrictions.list; 2 2 3 3 import java.awt.BorderLayout; -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionListModel.java
r20384 r20489 1 package org.openstreetmap.josm.plugins.turnrestrictions; 1 package org.openstreetmap.josm.plugins.turnrestrictions.list; 2 2 3 3 import java.util.Collection; -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionView.java
r20384 r20489 1 package org.openstreetmap.josm.plugins.turnrestrictions; 1 package org.openstreetmap.josm.plugins.turnrestrictions.list; 2 2 3 3 import java.awt.BorderLayout; -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java
r20384 r20489 1 package org.openstreetmap.josm.plugins.turnrestrictions; 1 package org.openstreetmap.josm.plugins.turnrestrictions.list; 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; … … 12 12 import java.util.HashSet; 13 13 import java.util.List; 14 import java.util.Set;15 14 16 15 import javax.swing.AbstractAction; 17 import javax.swing.JButton;18 16 import javax.swing.JCheckBox; 19 17 import javax.swing.JList; … … 35 33 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 36 34 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; 35 import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionEditor; 36 import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionEditorManager; 37 37 import org.openstreetmap.josm.tools.ImageProvider; 38 38 … … 216 216 } 217 217 218 public void launchEditor(Relation toEdit) { 219 if (toEdit == null) 220 return; 221 RelationEditor.getEditor(Main.map.mapView.getEditLayer(),toEdit, getMembersForCurrentSelection(toEdit)).setVisible(true); 222 } 218 public void launchEditor(Relation toEdit) { 219 if (toEdit == null) 220 return; 221 OsmDataLayer layer = Main.main.getEditLayer(); 222 TurnRestrictionEditorManager manager = TurnRestrictionEditorManager.getInstance(); 223 TurnRestrictionEditor editor = manager.getEditorForRelation(layer, toEdit); 224 if (editor != null) { 225 editor.setVisible(true); 226 editor.toFront(); 227 } else { 228 editor = new TurnRestrictionEditor( 229 TurnRestrictionsListDialog.this, layer,toEdit); 230 manager.positionOnScreen(editor); 231 manager.register(layer, toEdit,editor); 232 editor.setVisible(true); 233 } 234 } 223 235 224 236 public void actionPerformed(ActionEvent e) { … … 283 295 * 284 296 */ 285 staticclass NewAction extends AbstractAction implements EditLayerChangeListener{297 class NewAction extends AbstractAction implements EditLayerChangeListener{ 286 298 public NewAction() { 287 299 putValue(SHORT_DESCRIPTION,tr("Create a new turn restriction")); … … 292 304 293 305 public void run() { 294 RelationEditor.getEditor(Main.main.getEditLayer(),null, null).setVisible(true); 306 Relation tr = new Relation(); 307 OsmDataLayer layer = Main.main.getEditLayer(); 308 if (layer == null) return; 309 TurnRestrictionEditor editor = new TurnRestrictionEditor(TurnRestrictionsListDialog.this, layer); 310 TurnRestrictionEditorManager.getInstance().positionOnScreen(editor); 311 TurnRestrictionEditorManager.getInstance().register(layer, tr, editor); 312 editor.setVisible(true); 295 313 } 296 314 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListModel.java
r20384 r20489 1 package org.openstreetmap.josm.plugins.turnrestrictions; 1 package org.openstreetmap.josm.plugins.turnrestrictions.list; 2 2 3 3 import java.util.ArrayList;
Note:
See TracChangeset
for help on using the changeset viewer.