- Timestamp:
- 2012-06-25T21:25:50+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ZoomToAction.java
r5297 r5301 10 10 11 11 import org.openstreetmap.josm.Main; 12 import org.openstreetmap.josm.data.osm. PrimitiveId;12 import org.openstreetmap.josm.data.osm.OsmPrimitive; 13 13 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 14 14 import org.openstreetmap.josm.gui.conflict.pair.nodes.NodeListTable; … … 67 67 return; 68 68 int row = rows[0]; 69 PrimitiveId primitive = this.table.getOsmPrimitivesTableModel().getReferredPrimitive(row);70 69 OsmDataLayer layer = this.table.getLayer(); 70 OsmPrimitive primitive = this.table.getPrimitiveToZoomTo(row, layer); 71 71 if (layer != null && primitive != null) { 72 72 layer.data.setSelected(primitive); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java
r5298 r5301 126 126 * @return Primitive from my dataset referenced by entry 127 127 */ 128 p rotectedOsmPrimitive getMyPrimitive(T entry) {129 return getMyPrimitive Default(entry);128 public OsmPrimitive getMyPrimitive(T entry) { 129 return getMyPrimitiveById(entry); 130 130 } 131 131 132 p rotected final OsmPrimitive getMyPrimitiveDefault(PrimitiveId entry) {132 public final OsmPrimitive getMyPrimitiveById(PrimitiveId entry) { 133 133 OsmPrimitive result = myDataset.getPrimitiveById(entry); 134 134 if (result == null && mergedMap != null) { -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMerger.java
r5298 r5301 28 28 myEntriesTable = new NodeListTable( 29 29 "table.mynodes", 30 model, 30 31 model.getMyTableModel(), 31 32 model.getMySelectionModel() … … 38 39 mergedEntriesTable = new NodeListTable( 39 40 "table.mergednodes", 41 model, 40 42 model.getMergedTableModel(), 41 43 model.getMergedSelectionModel() … … 48 50 theirEntriesTable = new NodeListTable( 49 51 "table.theirnodes", 52 model, 50 53 model.getTheirTableModel(), 51 54 model.getTheirSelectionModel() -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListTable.java
r5297 r5301 2 2 package org.openstreetmap.josm.gui.conflict.pair.nodes; 3 3 4 import javax.swing.JTable;5 4 import javax.swing.ListSelectionModel; 6 5 7 6 import org.openstreetmap.josm.actions.ZoomToAction; 8 import org.openstreetmap.josm.gui.widgets.OsmPrimitivesTable; 7 import org.openstreetmap.josm.data.osm.Node; 8 import org.openstreetmap.josm.gui.conflict.pair.ListMergeModel; 9 import org.openstreetmap.josm.gui.conflict.pair.PairTable; 9 10 import org.openstreetmap.josm.gui.widgets.OsmPrimitivesTableModel; 10 11 11 public class NodeListTable extends OsmPrimitivesTable {12 public class NodeListTable extends PairTable { 12 13 13 public NodeListTable(String name, OsmPrimitivesTableModel dm, ListSelectionModel sm) { 14 super(dm, new NodeListColumnModel(new NodeListTableCellRenderer()), sm); 15 setName(name); 16 setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); 14 public NodeListTable(String name, ListMergeModel<Node> model, OsmPrimitivesTableModel dm, ListSelectionModel sm) { 15 super(name, model, dm, new NodeListColumnModel(new NodeListTableCellRenderer()), sm); 17 16 } 18 17 -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListMergeModel.java
r5298 r5301 92 92 93 93 @Override 94 p rotectedOsmPrimitive getMyPrimitive(RelationMember entry) {95 return getMyPrimitive Default(entry.getMember());94 public OsmPrimitive getMyPrimitive(RelationMember entry) { 95 return getMyPrimitiveById(entry.getMember()); 96 96 } 97 97 -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberMerger.java
r5298 r5301 19 19 myEntriesTable = new RelationMemberTable( 20 20 "table.mymembers", 21 model, 21 22 model.getMyTableModel(), 22 23 model.getMySelectionModel() … … 29 30 mergedEntriesTable = new RelationMemberTable( 30 31 "table.mergedmembers", 32 model, 31 33 model.getMergedTableModel(), 32 34 model.getMergedSelectionModel() … … 40 42 theirEntriesTable = new RelationMemberTable( 41 43 "table.theirmembers", 44 model, 42 45 model.getTheirTableModel(), 43 46 model.getTheirSelectionModel() -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTable.java
r5297 r5301 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.gui.conflict.pair.relation; 2 3 3 import javax.swing.JTable;4 4 import javax.swing.ListSelectionModel; 5 5 6 6 import org.openstreetmap.josm.actions.ZoomToAction; 7 import org.openstreetmap.josm.gui.widgets.OsmPrimitivesTable; 7 import org.openstreetmap.josm.data.osm.RelationMember; 8 import org.openstreetmap.josm.gui.conflict.pair.ListMergeModel; 9 import org.openstreetmap.josm.gui.conflict.pair.PairTable; 8 10 import org.openstreetmap.josm.gui.widgets.OsmPrimitivesTableModel; 9 11 10 public class RelationMemberTable extends OsmPrimitivesTable {12 public class RelationMemberTable extends PairTable { 11 13 12 public RelationMemberTable(String name, OsmPrimitivesTableModel dm, ListSelectionModel sm) { 13 super(dm, new RelationMemberListColumnModel(), sm); 14 setName(name); 15 setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); 14 public RelationMemberTable(String name, ListMergeModel<RelationMember> model, OsmPrimitivesTableModel dm, ListSelectionModel sm) { 15 super(name, model, dm, new RelationMemberListColumnModel(), sm); 16 16 } 17 17 -
trunk/src/org/openstreetmap/josm/gui/widgets/OsmPrimitivesTable.java
r5297 r5301 71 71 MapView.removeLayerChangeListener(zoomToAction); 72 72 } 73 74 public OsmPrimitive getPrimitiveToZoomTo(int row, OsmDataLayer layer) { 75 return getOsmPrimitivesTableModel().getReferredPrimitive(row); 76 } 73 77 74 78 protected class PopupListener extends MouseAdapter {
Note:
See TracChangeset
for help on using the changeset viewer.