Changeset 25671 in osm for applications/editors/josm/plugins
- Timestamp:
- 2011-03-23T07:57:47+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/relcontext/src/relcontext
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/relcontext/src/relcontext/ChosenRelation.java
r25669 r25671 44 44 public void clear() { 45 45 set(null); 46 } 47 48 private final static String[] MULTIPOLYGON_TYPES = new String[] { 49 "multipolygon", "boundary", "natural_reserve" 50 }; 51 52 /** 53 * Check if the relation type assumes all ways inside it form a multipolygon. 54 */ 55 public boolean isMultipolygon() { 56 if( chosenRelation == null ) 57 return false; 58 String type = chosenRelation.get("type"); 59 if( type == null ) 60 return false; 61 for( String t : MULTIPOLYGON_TYPES ) 62 if( t.equals(type) ) 63 return true; 64 return false; 46 65 } 47 66 … … 127 146 } 128 147 148 public void primtivesRemoved( PrimitivesRemovedEvent event ) { 149 if( chosenRelation != null && event.getPrimitives().contains(chosenRelation) ) 150 clear(); 151 } 152 129 153 public void nodeMoved( NodeMovedEvent event ) {} 130 154 public void otherDatasetChange( AbstractDatasetChangedEvent event ) {} 131 155 public void primtivesAdded( PrimitivesAddedEvent event ) {} 132 public void primtivesRemoved( PrimitivesRemovedEvent event ) {}133 156 public void wayNodesChanged( WayNodesChangedEvent event ) {} 134 157 } -
applications/editors/josm/plugins/relcontext/src/relcontext/RelContextDialog.java
r25670 r25671 84 84 topLine.add(chosenRelationComponent, BorderLayout.CENTER); 85 85 JPanel topRightButtons = new JPanel(new FlowLayout(FlowLayout.RIGHT)); 86 final Action sortAndFixAction = new SortAndFixAction(chosenRelation); 87 final JButton sortAndFixButton = new JButton(sortAndFixAction); 88 topRightButtons.add(sortAndFixButton); 86 89 final Action downloadChosenRelationAction = new DownloadChosenRelationAction(chosenRelation); 87 90 final JButton downloadButton = new JButton(downloadChosenRelationAction); … … 91 94 rcPanel.add(topLine, BorderLayout.NORTH); 92 95 96 sortAndFixAction.addPropertyChangeListener(new PropertyChangeListener() { 97 public void propertyChange( PropertyChangeEvent evt ) { 98 sortAndFixButton.setVisible(sortAndFixAction.isEnabled()); 99 } 100 }); 101 sortAndFixButton.setVisible(false); 102 93 103 downloadChosenRelationAction.addPropertyChangeListener(new PropertyChangeListener() { 94 104 public void propertyChange( PropertyChangeEvent evt ) { … … 131 141 if( topLine != null ) 132 142 topLine.setVisible(newRelation != null); 143 if( oldRelation != newRelation && Main.main.getCurrentDataSet() != null ) 144 selectionChanged(Main.main.getCurrentDataSet().getSelected()); 133 145 // ? 134 146 }
Note:
See TracChangeset
for help on using the changeset viewer.