Changeset 27927 in osm for applications/editors/josm/plugins/reltoolbox/src/relcontext
- Timestamp:
- 2012-02-23T10:17:25+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/reltoolbox/src/relcontext
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/RelContextDialog.java
r27901 r27927 58 58 59 59 public final static String PREF_PREFIX = "reltoolbox"; 60 60 61 61 private final DefaultTableModel relationsData; 62 62 private ChosenRelation chosenRelation; … … 66 66 private RoleComboBoxModel roleBoxModel; 67 67 private SortAndFixAction sortAndFixAction; 68 // actions saved for unregistering on dialog destroying 69 private final EnterRoleAction enterRoleAction; 70 private final FindRelationAction findRelationAction; 71 private final CreateMultipolygonAction createMultipolygonAction; 72 private final CreateRelationAction createRelationAction; 73 private final AddRemoveMemberAction addRemoveMemberAction; 68 74 69 75 public RelContextDialog() { … … 101 107 }); 102 108 roleBox.setVisible(false); 103 final ActionenterRoleAction = new EnterRoleAction(); // just for the shortcut109 enterRoleAction = new EnterRoleAction(); // just for the shortcut 104 110 105 111 // [±][X] relation U [AZ][Down][Edit] 106 112 chosenRelationPanel = new JPanel(new GridBagLayout()); 107 chosenRelationPanel.add(new JButton(new AddRemoveMemberAction(chosenRelation)), GBC.std()); 113 addRemoveMemberAction = new AddRemoveMemberAction(chosenRelation); 114 chosenRelationPanel.add(new JButton(addRemoveMemberAction), GBC.std()); 108 115 chosenRelationPanel.add(sizeButton(new JButton(new ClearChosenRelationAction(chosenRelation)), 32, 0), GBC.std()); 109 116 final ChosenRelationComponent chosenRelationComponent = new ChosenRelationComponent(chosenRelation); … … 147 154 // [+][Multi] [X]Adm [X]Tags [X]1 148 155 JPanel bottomLine = new JPanel(new GridBagLayout()); 149 bottomLine.add(new JButton(new CreateRelationAction(chosenRelation)), GBC.std()); 150 final JButton multipolygonButton = new JButton(new CreateMultipolygonAction(chosenRelation)); 156 createRelationAction = new CreateRelationAction(chosenRelation); 157 bottomLine.add(new JButton(createRelationAction), GBC.std()); 158 createMultipolygonAction = new CreateMultipolygonAction(chosenRelation); 159 final JButton multipolygonButton = new JButton(createMultipolygonAction); 151 160 bottomLine.add(multipolygonButton, GBC.std()); 152 161 // bottomLine.add(sizeButton(new JButton(new MultipolygonSettingsAction()), 16, 0), GBC.std().fill(GBC.VERTICAL)); 153 162 bottomLine.add(Box.createHorizontalGlue(), GBC.std().fill()); 154 bottomLine.add(new JButton(new FindRelationAction(chosenRelation)), GBC.eol()); 163 findRelationAction = new FindRelationAction(chosenRelation); 164 bottomLine.add(new JButton(findRelationAction), GBC.eol()); 155 165 rcPanel.add(sizeButton(bottomLine, 0, 24), BorderLayout.SOUTH); 156 166 … … 351 361 } 352 362 363 @Override 364 public void destroy() { 365 enterRoleAction.destroy(); 366 findRelationAction.destroy(); 367 createMultipolygonAction.destroy(); 368 createRelationAction.destroy(); 369 addRemoveMemberAction.destroy(); 370 super.destroy(); 371 } 372 353 373 private static final String POSSIBLE_ROLES_FILE = "relcontext/possible_roles.txt"; 354 374 private static final Map<String, List<String>> possibleRoles = loadRoles(); … … 545 565 super(tr("Change role"), null, tr("Enter role for selected members"), 546 566 Shortcut.registerShortcut("reltoolbox:changerole", tr("Relation Toolbox: {0}", tr("Enter role for selected members")), 547 KeyEvent.VK_R, Shortcut.ALT_CTRL), true, "relcontext/enterrole", true);567 KeyEvent.VK_R, Shortcut.ALT_CTRL), false, "relcontext/enterrole", true); 548 568 chosenRelation.addChosenRelationListener(this); 549 569 updateEnabledState(); … … 561 581 setEnabled(newRelation != null); 562 582 } 563 }564 583 } 584 565 585 private class RoleComboBoxModel extends AbstractListModel implements ComboBoxModel { 566 586 private List<String> roles = new ArrayList<String>(); -
applications/editors/josm/plugins/reltoolbox/src/relcontext/RelContextPlugin.java
r26802 r27927 1 1 package relcontext; 2 2 3 import org.openstreetmap.josm.Main; 3 4 import org.openstreetmap.josm.gui.DefaultNameFormatter; 4 5 import org.openstreetmap.josm.gui.MapFrame; … … 17 18 public void mapFrameInitialized( MapFrame oldFrame, MapFrame newFrame ) { 18 19 if( oldFrame == null && newFrame != null ) { 20 // if (dialog!=null) dialog.destroy(); 19 21 dialog = new RelContextDialog(); 20 22 newFrame.addToggleDialog(dialog); -
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/AddRemoveMemberAction.java
r27852 r27927 34 34 super(null, "relcontext/addremove", tr("Add/remove members from the chosen relation"), 35 35 Shortcut.registerShortcut("reltoolbox:addremove", tr("Relation Toolbox: {0}", tr("Add/remove members from the chosen relation")), 36 KeyEvent.VK_EQUALS, Shortcut.DIRECT), true);36 KeyEvent.VK_EQUALS, Shortcut.DIRECT), false); 37 37 this.rel = rel; 38 38 rel.addChosenRelationListener(this); -
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/CreateMultipolygonAction.java
r27852 r27927 31 31 super("Multi", "data/multipolygon", tr("Create a multipolygon from selected objects"), 32 32 Shortcut.registerShortcut("reltoolbox:multipolygon", tr("Relation Toolbox: {0}", tr("Create multipolygon")), 33 KeyEvent.VK_B, Shortcut.CTRL), true);33 KeyEvent.VK_B, Shortcut.CTRL), false); 34 34 this.chRel = chRel; 35 35 updateEnabledState(); -
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/CreateRelationAction.java
r27852 r27927 39 39 super(tr("New"), "data/relation", tr("Create a relation from selected objects"), 40 40 Shortcut.registerShortcut("reltoolbox:create", tr("Relation Toolbox: {0}", tr("Create a new relation")), 41 KeyEvent.VK_N, Shortcut.ALT_CTRL), true);41 KeyEvent.VK_N, Shortcut.ALT_CTRL), false); 42 42 this.chRel = chRel; 43 43 updateEnabledState(); -
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/FindRelationAction.java
r27852 r27927 29 29 super("Find", "relcontext/find", tr("Find a relation"), 30 30 Shortcut.registerShortcut("reltoolbox:find", tr("Relation Toolbox: {0}", tr("Find a relation")), 31 KeyEvent.VK_F, Shortcut.ALT_CTRL), true);31 KeyEvent.VK_F, Shortcut.ALT_CTRL), false); 32 32 this.chRel = chRel; 33 33 }
Note:
See TracChangeset
for help on using the changeset viewer.