Changeset 20489 in osm for applications/editors/josm/plugins/turnrestrictions/src
- Timestamp:
- 2010-03-15T12:48:23+01:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions
- Files:
-
- 20 added
- 1 edited
- 8 moved
-
TurnRestrictionsPlugin.java (modified) (1 diff)
-
dnd (added)
-
dnd/PrimitiveIdListProvider.java (added)
-
dnd/PrimitiveIdListTransferHandler.java (added)
-
dnd/PrimitiveIdTransferable.java (added)
-
editor (added)
-
editor/BasicEditorPanel.java (added)
-
editor/JosmSelectionListModel.java (added)
-
editor/JosmSelectionPanel.java (added)
-
editor/TurnRestrictionComboBox.java (added)
-
editor/TurnRestrictionComboBoxModel.java (added)
-
editor/TurnRestrictionEditor.java (added)
-
editor/TurnRestrictionEditorManager.java (added)
-
editor/TurnRestrictionEditorModel.java (added)
-
editor/TurnRestrictionLegEditor.java (added)
-
editor/TurnRestrictionLegRole.java (added)
-
editor/TurnRestrictionType.java (added)
-
editor/TurnRestrictionTypeRenderer.java (added)
-
editor/ViaList.java (added)
-
editor/ViaListModel.java (added)
-
list (added)
-
list/AbstractTurnRestrictionsListView.java (moved) (moved from applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/AbstractTurnRestrictionsListView.java ) (1 diff)
-
list/TurnRestrictionListCellRenderer.java (moved) (moved from applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionListCellRenderer.java ) (1 diff)
-
list/TurnRestrictionsInDatasetListModel.java (moved) (moved from applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionsInDatasetListModel.java ) (1 diff)
-
list/TurnRestrictionsInDatasetView.java (moved) (moved from applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionsInDatasetView.java ) (1 diff)
-
list/TurnRestrictionsInSelectionListModel.java (moved) (moved from applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionsInSelectionListModel.java ) (1 diff)
-
list/TurnRestrictionsInSelectionView.java (moved) (moved from applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionsInSelectionView.java ) (1 diff)
-
list/TurnRestrictionsListDialog.java (moved) (moved from applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionsListDialog.java ) (6 diffs)
-
list/TurnRestrictionsListModel.java (moved) (moved from applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionsListModel.java ) (1 diff)
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.
