Changeset 10880 in josm for trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java
- Timestamp:
- 2016-08-23T22:07:06+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java
r10507 r10880 41 41 */ 42 42 public class ValidatorLayer extends Layer implements LayerChangeListener { 43 44 private int updateCount = -1; 43 private final Runnable invalidator = this::invalidate; 45 44 46 45 /** … … 50 49 super(tr("Validation errors")); 51 50 Main.getLayerManager().addLayerChangeListener(this); 51 Main.map.validatorDialog.tree.addInvalidationListener(invalidator); 52 52 } 53 53 … … 68 68 @Override 69 69 public void paint(final Graphics2D g, final MapView mv, Bounds bounds) { 70 updateCount = Main.map.validatorDialog.tree.getUpdateCount();71 70 DefaultMutableTreeNode root = Main.map.validatorDialog.tree.getRoot(); 72 71 if (root == null || root.getChildCount() == 0) … … 124 123 125 124 @Override 126 public boolean isChanged() {127 return updateCount != Main.map.validatorDialog.tree.getUpdateCount();128 }129 130 @Override131 125 public void visitBoundingBox(BoundingXYVisitor v) { 132 126 // Do nothing … … 168 162 e.scheduleRemoval(Collections.singleton(this)); 169 163 } else if (e.getRemovedLayer() == this) { 170 Main.getLayerManager().removeLayerChangeListener(this);171 164 OsmValidator.errorLayer = null; 172 165 } … … 177 170 return LayerPositionStrategy.IN_FRONT; 178 171 } 172 173 @Override 174 public void destroy() { 175 Main.map.validatorDialog.tree.removeInvalidationListener(invalidator); 176 Main.getLayerManager().removeLayerChangeListener(this); 177 super.destroy(); 178 } 179 179 }
Note:
See TracChangeset
for help on using the changeset viewer.