- Timestamp:
- 2013-06-26T10:14:24+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r5958 r6025 66 66 import org.openstreetmap.josm.gui.layer.Layer; 67 67 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 68 import org.openstreetmap.josm.gui.util.HighlightHelper; 68 69 import org.openstreetmap.josm.gui.widgets.DisableShortcutsOnFocusGainedTextField; 69 70 import org.openstreetmap.josm.gui.widgets.JosmTextField; … … 112 113 private final AddSelectionToRelations addSelectionToRelations = new AddSelectionToRelations(); 113 114 115 HighlightHelper highlightHelper = new HighlightHelper(); 116 114 117 /** 115 118 * Constructs <code>RelationListDialog</code> … … 183 186 // inform all actions about list of relations they need 184 187 private void updateActionsRelationLists() { 185 popupMenuHandler.setPrimitives(model.getSelectedRelations()); 188 List<Relation> sel = model.getSelectedRelations(); 189 popupMenuHandler.setPrimitives(sel); 190 191 //update highlights 192 if (Main.isDisplayingMapView()) { 193 highlightHelper.highlightOnly(sel); 194 Main.map.mapView.repaint(); 195 } 186 196 } 187 197 … … 298 308 super(popupMenu); 299 309 } 310 311 @Override 312 public void mouseExited(MouseEvent me) { 313 highlightHelper.clear(); 314 } 300 315 301 316 protected void setCurrentRelationAsSelection() { … … 306 321 EditRelationAction.launchEditor(getSelected()); 307 322 } 308 323 309 324 @Override public void mouseClicked(MouseEvent e) { 310 325 if (Main.main.getEditLayer() == null) return; -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r5991 r6025 67 67 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 68 68 import org.openstreetmap.josm.gui.util.GuiHelper; 69 import org.openstreetmap.josm.gui.util.HighlightHelper; 69 70 import org.openstreetmap.josm.gui.widgets.ListPopupMenu; 70 71 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; … … 186 187 */ 187 188 class MouseEventHandler extends PopupMenuLauncher { 189 private final HighlightHelper helper = new HighlightHelper(); 188 190 189 191 public MouseEventHandler() { … … 193 195 @Override 194 196 public void mouseClicked(MouseEvent e) { 197 int idx = lstPrimitives.locationToIndex(e.getPoint()); 198 if (idx < 0) return; 195 199 if (isDoubleClick(e)) { 196 int idx = lstPrimitives.locationToIndex(e.getPoint());197 if (idx < 0) return;198 200 OsmDataLayer layer = Main.main.getEditLayer(); 199 201 if (layer == null) return; 200 202 layer.data.setSelected(Collections.singleton((OsmPrimitive)model.getElementAt(idx))); 201 } 203 } else if (Main.isDisplayingMapView()) { 204 helper.highlightOnly((OsmPrimitive)model.getElementAt(idx)); 205 Main.map.mapView.repaint(); 206 } 207 } 208 209 @Override 210 public void mouseExited(MouseEvent me) { 211 helper.clear(); 212 super.mouseExited(me); 202 213 } 203 214 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r5984 r6025 86 86 import org.openstreetmap.josm.gui.tagging.TaggingPreset.PresetType; 87 87 import org.openstreetmap.josm.gui.util.GuiHelper; 88 import org.openstreetmap.josm.gui.util.HighlightHelper; 88 89 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; 89 90 import org.openstreetmap.josm.tools.GBC; … … 176 177 private final SelectMembersAction addMembersToSelectionAction = new SelectMembersAction(true); 177 178 179 private final HighlightHelper highlightHelper= new HighlightHelper(); 180 178 181 /** 179 182 * The Add button (needed to be able to disable it) … … 255 258 membershipTable.getSelectionModel().addListSelectionListener(deleteAction); 256 259 257 260 258 261 JScrollPane scrollPane = (JScrollPane) createLayout(bothTables, true, Arrays.asList(new SideButton[] { 259 262 this.btnAdd, this.btnEdit, this.btnDel … … 408 411 return row; 409 412 } 413 414 @Override 415 public void mouseClicked(MouseEvent e) { 416 //update highlights 417 if (Main.isDisplayingMapView()) { 418 int row = membershipTable.rowAtPoint(e.getPoint()); 419 if (row>=0) { 420 highlightHelper.highlightOnly((Relation) membershipTable.getValueAt(row, 0)); 421 Main.map.mapView.repaint(); 422 } 423 } 424 super.mouseClicked(e); 425 } 426 427 @Override 428 public void mouseExited(MouseEvent me) { 429 highlightHelper.clear(); 430 } 410 431 }); 411 432 }
Note:
See TracChangeset
for help on using the changeset viewer.