Changeset 27927 in osm for applications/editors/josm/plugins/reltoolbox/src/relcontext/RelContextDialog.java
- Timestamp:
- 2012-02-23T10:17:25+01:00 (13 years ago)
- File:
-
- 1 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>();
Note:
See TracChangeset
for help on using the changeset viewer.