Changeset 25711 in osm for applications/editors/josm/plugins/relcontext
- Timestamp:
- 2011-03-25T16:40:33+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/relcontext/src/relcontext
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/relcontext/src/relcontext/ChosenRelation.java
r25692 r25711 19 19 */ 20 20 public class ChosenRelation implements EditLayerChangeListener, MapViewPaintable, DataSetListener { 21 pr ivateRelation chosenRelation = null;21 protected Relation chosenRelation = null; 22 22 private Set<ChosenRelationListener> chosenRelationListeners = new HashSet<ChosenRelationListener>(); 23 23 … … 73 73 } 74 74 75 pr ivatevoid analyse() {75 protected void analyse() { 76 76 // todo 77 77 } -
applications/editors/josm/plugins/relcontext/src/relcontext/RelContextDialog.java
r25709 r25711 1 1 package relcontext; 2 2 3 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; 3 4 import org.openstreetmap.josm.command.SequenceCommand; 4 5 import org.openstreetmap.josm.command.Command; … … 74 75 MapView.addEditLayerChangeListener(chosenRelation); 75 76 76 popupMenu = new ChosenRelationPopupMenu(); 77 popupMenu = new ChosenRelationPopupMenu(chosenRelation); 77 78 multiPopupMenu = new MultipolygonSettingsPopup(); 78 79 … … 178 179 relationsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 179 180 relationsTable.setTableHeader(null); 181 relationsTable.addMouseListener(new PopupMenuLauncher() { 182 @Override 183 public void launch(MouseEvent evt) { 184 Point p = evt.getPoint(); 185 int row = relationsTable.rowAtPoint(p); 186 if (row > -1) { 187 Relation relation = (Relation)relationsData.getValueAt(row, 0); 188 JPopupMenu menu = new ChosenRelationPopupMenu(new StaticChosenRelation(relation)); 189 menu.show(relationsTable, p.x, p.y-5); 190 } 191 } 192 }); 193 180 194 TableColumnModel columns = relationsTable.getColumnModel(); 181 195 columns.getColumn(0).setCellRenderer(new OsmPrimitivRenderer() { … … 293 307 relationsData.addRow(new Object[] {rel, role == null ? "" : role}); 294 308 } 309 for( OsmPrimitive element : newSelection ) 310 if( element instanceof Relation && (chosenRelation.get() == null || !chosenRelation.get().equals(element) ) ) 311 relationsData.addRow(new Object[] {element, ""}); 295 312 } 296 313 … … 406 423 407 424 private class ChosenRelationPopupMenu extends JPopupMenu { 408 public ChosenRelationPopupMenu() { 425 public ChosenRelationPopupMenu( ChosenRelation chosenRelation ) { 409 426 add(new SelectMembersAction(chosenRelation)); 410 427 add(new SelectRelationAction(chosenRelation)); -
applications/editors/josm/plugins/relcontext/src/relcontext/actions/DeleteChosenRelationAction.java
r25696 r25711 19 19 this.rel = rel; 20 20 rel.addChosenRelationListener(this); 21 setEnabled( false);21 setEnabled(rel.get() != null); 22 22 } 23 23 -
applications/editors/josm/plugins/relcontext/src/relcontext/actions/DownloadParentsAction.java
r25695 r25711 34 34 this.rel = rel; 35 35 rel.addChosenRelationListener(this); 36 setEnabled( false);36 setEnabled(rel.get() != null && Main.map.mapView.getEditLayer() != null); 37 37 } 38 38 -
applications/editors/josm/plugins/relcontext/src/relcontext/actions/EditChosenRelationAction.java
r25695 r25711 26 26 this.rel = rel; 27 27 rel.addChosenRelationListener(this); 28 setEnabled( false);28 setEnabled(rel.get() != null); 29 29 } 30 30 -
applications/editors/josm/plugins/relcontext/src/relcontext/actions/RelationHelpAction.java
r25695 r25711 27 27 this.rel = rel; 28 28 rel.addChosenRelationListener(this); 29 setEnabled( false);29 setEnabled(rel.get() != null); 30 30 } 31 31 -
applications/editors/josm/plugins/relcontext/src/relcontext/actions/SelectInRelationPanelAction.java
r25680 r25711 20 20 this.rel = rel; 21 21 rel.addChosenRelationListener(this); 22 setEnabled( false);22 setEnabled(rel.get() != null); 23 23 } 24 24 -
applications/editors/josm/plugins/relcontext/src/relcontext/actions/SelectMembersAction.java
r25670 r25711 18 18 this.rel = rel; 19 19 rel.addChosenRelationListener(this); 20 setEnabled( false);20 setEnabled(rel.get() != null); 21 21 } 22 22 -
applications/editors/josm/plugins/relcontext/src/relcontext/actions/SelectRelationAction.java
r25709 r25711 19 19 this.rel = rel; 20 20 rel.addChosenRelationListener(this); 21 setEnabled( false);21 setEnabled(rel.get() != null); 22 22 } 23 23
Note:
See TracChangeset
for help on using the changeset viewer.