Ignore:
Timestamp:
2010-03-11T21:21:49+01:00 (15 years ago)
Author:
jttt
Message:

Implement Layer.isChanged()

Location:
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ErrorLayer.java

    r19072 r20426  
    3232 */
    3333public class ErrorLayer extends Layer implements LayerChangeListener {
     34
    3435    private OSMValidatorPlugin plugin;
     36
     37    private int updateCount = -1;
     38
    3539
    3640    public ErrorLayer(OSMValidatorPlugin plugin) {
     
    5660    @Override
    5761    public void paint(final Graphics2D g, final MapView mv, Bounds bounds) {
     62        updateCount = plugin.validationDialog.tree.getUpdateCount();
    5863        DefaultMutableTreeNode root = plugin.validationDialog.tree.getRoot();
    5964        if (root == null || root.getChildCount() == 0)
     
    104109
    105110    @Override
     111    public boolean isChanged() {
     112        return updateCount != plugin.validationDialog.tree.getUpdateCount();
     113    }
     114
     115    @Override
    106116    public void visitBoundingBox(BoundingXYVisitor v) {
    107117    }
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ErrorTreePanel.java

    r13497 r20426  
    4444
    4545    /**
    46      * If {@link #filter} is not <code>null</code> only errors are displayed 
    47      * that refer to one of the primitives in the filter. 
     46     * If {@link #filter} is not <code>null</code> only errors are displayed
     47     * that refer to one of the primitives in the filter.
    4848     */
    4949    private Set<OsmPrimitive> filter = null;
     50
     51    private int updateCount;
    5052
    5153    /**
     
    6567    }
    6668
     69    @Override
    6770    public String getToolTipText(MouseEvent e) {
    6871        String res = null;
     
    105108     */
    106109    public void buildTree() {
     110        updateCount++;
    107111        DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode();
    108112
     
    325329        return (DefaultMutableTreeNode) treeModel.getRoot();
    326330    }
     331
     332    public int getUpdateCount() {
     333        return updateCount;
     334    }
    327335}
Note: See TracChangeset for help on using the changeset viewer.