- Timestamp:
- 2018-04-24T22:32:26+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs/relation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberRoleCellEditor.java
r12758 r13675 10 10 import javax.swing.table.TableCellEditor; 11 11 12 import org.openstreetmap.josm.data.osm.DataSet;13 12 import org.openstreetmap.josm.data.osm.Relation; 14 13 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField; … … 21 20 public class MemberRoleCellEditor extends AbstractCellEditor implements TableCellEditor { 22 21 private final AutoCompletingTextField editor; 23 private final transient DataSet ds;22 private final AutoCompletionManager autoCompletionManager; 24 23 private final transient Relation relation; 25 24 … … 29 28 /** 30 29 * Constructs a new {@code MemberRoleCellEditor}. 31 * @param ds the data set. Must not be null30 * @param autoCompletionManager the auto completion manager. Must not be null 32 31 * @param relation the relation. Can be null 32 * @since 13675 33 33 */ 34 public MemberRoleCellEditor( DataSet ds, Relation relation) {35 this. ds = ds;34 public MemberRoleCellEditor(AutoCompletionManager autoCompletionManager, Relation relation) { 35 this.autoCompletionManager = autoCompletionManager; 36 36 this.relation = relation; 37 37 editor = new AutoCompletingTextField(0, false); … … 48 48 editor.setText(role); 49 49 autoCompletionList.clear(); 50 AutoCompletionManager.of(ds).populateWithMemberRoles(autoCompletionList, relation);50 autoCompletionManager.populateWithMemberRoles(autoCompletionList, relation); 51 51 return editor; 52 52 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java
r13176 r13675 38 38 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener; 39 39 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 40 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager; 40 41 import org.openstreetmap.josm.gui.util.HighlightHelper; 41 42 import org.openstreetmap.josm.gui.widgets.OsmPrimitivesTable; … … 60 61 */ 61 62 public MemberTable(OsmDataLayer layer, Relation relation, MemberTableModel model) { 62 super(model, new MemberTableColumnModel( layer.data, relation), model.getSelectionModel());63 super(model, new MemberTableColumnModel(AutoCompletionManager.of(layer.data), relation), model.getSelectionModel()); 63 64 setLayer(layer); 64 65 model.addMemberModelListener(this); … … 133 134 if (!highlightEnabled) return; 134 135 getMemberTableModel().getSelectionModel().addListSelectionListener(highlighterListener); 135 if (MainApplication.isDisplayingMapView()) { 136 HighlightHelper.clearAllHighlighted(); 137 MainApplication.getMap().mapView.repaint(); 138 } 136 clearAllHighlighted(); 139 137 } 140 138 … … 153 151 } 154 152 153 /** 154 * Stops highlighting of selected objects. 155 */ 155 156 public void stopHighlighting() { 156 157 if (highlighterListener == null) return; … … 158 159 getMemberTableModel().getSelectionModel().removeListSelectionListener(highlighterListener); 159 160 highlighterListener = null; 161 clearAllHighlighted(); 162 } 163 164 private static void clearAllHighlighted() { 160 165 if (MainApplication.isDisplayingMapView()) { 161 166 HighlightHelper.clearAllHighlighted(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableColumnModel.java
r12657 r13675 7 7 import javax.swing.table.TableColumn; 8 8 9 import org.openstreetmap.josm.data.osm.DataSet;10 9 import org.openstreetmap.josm.data.osm.Relation; 10 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager; 11 11 12 12 /** … … 17 17 /** 18 18 * Constructs a new {@code MemberTableColumnModel}. 19 * @param ds the data set. Must not be null19 * @param autoCompletionManager the auto completion manager. Must not be null 20 20 * @param relation the relation. Can be null 21 * @since 13675 21 22 */ 22 public MemberTableColumnModel( DataSet ds, Relation relation) {23 public MemberTableColumnModel(AutoCompletionManager autoCompletionManager, Relation relation) { 23 24 TableColumn col = null; 24 25 … … 29 30 col.setPreferredWidth(100); 30 31 col.setCellRenderer(new MemberTableRoleCellRenderer()); 31 col.setCellEditor(new MemberRoleCellEditor( ds, relation));32 col.setCellEditor(new MemberRoleCellEditor(autoCompletionManager, relation)); 32 33 addColumn(col); 33 34
Note:
See TracChangeset
for help on using the changeset viewer.