diff --git a/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java b/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
index 335f000..bb218ac 100644
a
|
b
|
public class HistoryBrowserModel extends Observable implements LayerChangeListen
|
145 | 145 | protected boolean canShowAsLatest(OsmPrimitive primitive) { |
146 | 146 | if (primitive == null) return false; |
147 | 147 | if (primitive.isNew() || !primitive.isUsable()) return false; |
148 | | |
| 148 | |
149 | 149 | //try creating a history primitive. if that fails, the primitive cannot be used. |
150 | 150 | try { |
151 | 151 | HistoryOsmPrimitive.forOsmPrimitive(primitive); |
… |
… |
public class HistoryBrowserModel extends Observable implements LayerChangeListen
|
670 | 670 | |
671 | 671 | @Override |
672 | 672 | public int getRowCount() { |
| 673 | // Match the size of the opposite table so comparison is less confusing. |
| 674 | // (scroll bars lines up properly, etc.) |
673 | 675 | int n = 0; |
674 | 676 | if (current != null && current.getType().equals(OsmPrimitiveType.RELATION)) { |
675 | 677 | n = ((HistoryRelation)current).getNumMembers(); |
… |
… |
public class HistoryBrowserModel extends Observable implements LayerChangeListen
|
718 | 720 | HistoryRelation relation = getRelation(); |
719 | 721 | if (relation == null) |
720 | 722 | return null; |
721 | | if (row >= relation.getNumMembers()) |
| 723 | if (row >= relation.getNumMembers()) // see getRowCount |
722 | 724 | return null; |
723 | 725 | return relation.getMembers().get(row); |
724 | 726 | } |
diff --git a/src/org/openstreetmap/josm/gui/history/NodeListTableCellRenderer.java b/src/org/openstreetmap/josm/gui/history/NodeListTableCellRenderer.java
index c8aae4e..b6aec9e 100644
a
|
b
|
public class NodeListTableCellRenderer extends JLabel implements TableCellRender
|
58 | 58 | setBackground(bgColor); |
59 | 59 | } |
60 | 60 | |
| 61 | // Warning: The model pads with null-rows to match the size of the opposite table. 'value' could be null |
61 | 62 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, |
62 | 63 | int row, int column) { |
63 | | if (value == null) |
64 | | return this; |
65 | 64 | |
66 | 65 | HistoryBrowserModel.NodeListTableModel model = getNodeListTableModel(table); |
67 | 66 | Long nodeId = (Long)value; |
diff --git a/src/org/openstreetmap/josm/gui/history/RelationMemberListTableCellRenderer.java b/src/org/openstreetmap/josm/gui/history/RelationMemberListTableCellRenderer.java
index 2b9bebe..08c2e5f 100644
a
|
b
|
public class RelationMemberListTableCellRenderer extends JLabel implements Table
|
91 | 91 | setBackground(bgColor); |
92 | 92 | } |
93 | 93 | |
| 94 | // Warning: The model pads with null-rows to match the size of the opposite table. 'value' could be null |
94 | 95 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, |
95 | 96 | int row, int column) { |
96 | | if (value == null) |
97 | | return this; |
98 | 97 | |
99 | 98 | HistoryBrowserModel.RelationMemberTableModel model = gteRelationMemberTableModel(table); |
100 | 99 | RelationMember member = (RelationMember)value; |