Ticket #13012: plugin-graphview-remove-deprecated-calls.patch

File plugin-graphview-remove-deprecated-calls.patch, 3.8 KB (added by michael2402, 10 years ago)
  • graphview/build.xml

    diff --git a/graphview/build.xml b/graphview/build.xml
    index b44734a..131ace2 100644
    a b  
    11<?xml version="1.0" encoding="utf-8"?>
    22<project name="graphview" default="dist" basedir=".">
    33    <property name="commit.message" value="option to change graph colors; closes ticket 5523 in JOSM Trac"/>
    4     <property name="plugin.main.version" value="7001"/>
     4    <property name="plugin.main.version" value="10031"/>
    55
    66    <!-- Configure these properties (replace "..." accordingly).
    77         See https://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins
  • graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/GraphViewPlugin.java

    diff --git a/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/GraphViewPlugin.java b/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/GraphViewPlugin.java
    index 897caf1..6864d1b 100644
    a b public class GraphViewPlugin extends Plugin implements LayerChangeListener, Obse  
    177177    public void repaintGraphViewLayer() {
    178178
    179179        if (graphViewLayer != null) {
    180             Main.panel.repaint();
     180            graphViewLayer.invalidate();
    181181        }
    182182
    183183    }
  • graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/GraphViewLayer.java

    diff --git a/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/GraphViewLayer.java b/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/GraphViewLayer.java
    index 31cfc10..02bef01 100644
    a b import org.openstreetmap.josm.tools.ImageProvider;  
    4545/**
    4646 * layer for displaying the graph visualization
    4747 */
    48 public class GraphViewLayer extends Layer implements LayerChangeListener, WayGraphObserver {
     48public class GraphViewLayer extends Layer implements WayGraphObserver {
    4949
    5050    private static final int NODE_RADIUS = 5;
    5151
    public class GraphViewLayer extends Layer implements LayerChangeListener, WayGra  
    9797
    9898    public GraphViewLayer() {
    9999        super("Graph view");
    100         MapView.addLayerChangeListener(this);
    101100    }
    102101
    103102    /** sets the WayGraph that is to be displayed by this layer, may be null */
    public class GraphViewLayer extends Layer implements LayerChangeListener, WayGra  
    114113    /** sets the ColorScheme that is to be used for choosing colors, may be null */
    115114    public void setColorScheme(ColorScheme colorScheme) {
    116115        this.colorScheme = colorScheme;
    117         Main.panel.repaint();
     116        invalidate();
    118117    }
    119118
    120119    /** sets the arrowhead placement (relative offset from edge start) */
    121120    public void setArrowheadPlacement(double arrowheadPlacement) {
    122121        assert arrowheadPlacement >= 0 && arrowheadPlacement <= 1;
    123122        this.arrowheadPlacement = arrowheadPlacement;
    124         Main.panel.repaint();
     123        invalidate();
    125124    }
    126125
    127126    /**
    public class GraphViewLayer extends Layer implements LayerChangeListener, WayGra  
    133132        if (nodePositioner == null) {
    134133            this.nodePositioner = new NonMovingNodePositioner();
    135134        }
    136         Main.panel.repaint();
     135        invalidate();
    137136    }
    138137
    139138    @Override
    public class GraphViewLayer extends Layer implements LayerChangeListener, WayGra  
    407406
    408407    public void update(WayGraph wayGraph) {
    409408        assert wayGraph == this.wayGraph;
    410         Main.panel.repaint();
    411     }
    412 
    413     public void activeLayerChange(Layer oldLayer, Layer newLayer) {
    414         //do nothing
    415     }
    416     public void layerAdded(Layer newLayer) {
    417         //do nothing
    418     }
    419     public void layerRemoved(Layer oldLayer) {
    420         if (oldLayer == this) {
    421             MapView.removeLayerChangeListener(this);
    422         }
     409        invalidate();
    423410    }
    424411}