Ignore:
Timestamp:
2009-07-03T23:35:00+02:00 (15 years ago)
Author:
stoecker
Message:

fixes for JOSM 1725 - utilsplugin JumpToAction still missing

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/GridLayer.java

    r16159 r16294  
    2323/**
    2424 * A debug layer for testing the grid cells a way crosses.
    25  * 
     25 *
    2626 * @author frsantos
    2727 */
     
    2929{
    3030    /**
    31      * Constructor 
     31     * Constructor
    3232     * @param name
    3333     */
    34     public GridLayer(String name) 
     34    public GridLayer(String name)
    3535    {
    3636        super(name);
     
    4747     * Draw the grid and highlight all cells acuppied by any selected primitive.
    4848     */
    49     @Override 
    50     public void paint(final Graphics g, final MapView mv) 
     49    @Override
     50    public void paint(final Graphics g, final MapView mv)
    5151    {
    5252        if( !Main.pref.hasKey(PreferenceEditor.PREF_DEBUG + ".grid") )
    5353            return;
    54        
     54
    5555        int gridWidth = Integer.parseInt(Main.pref.get(PreferenceEditor.PREF_DEBUG + ".grid") );
    5656        int width = mv.getWidth();
     
    6767        for(OsmPrimitive p : Main.ds.getSelected() )
    6868            p.visit(visitor);
    69        
     69
    7070        long x0 = (long)Math.floor(origin.east()  * gridWidth);
    7171        long x1 = (long)Math.floor(border.east()  * gridWidth);
    7272        long y0 = (long)Math.floor(origin.north() * gridWidth) + 1;
    73         long y1 = (long)Math.floor(border.north() * gridWidth) + 1;       
     73        long y1 = (long)Math.floor(border.north() * gridWidth) + 1;
    7474        long aux;
    7575        if( x0 > x1 ) { aux = x0; x0 = x1; x1 = aux; }
    7676        if( y0 > y1 ) { aux = y0; y0 = y1; y1 = aux; }
    77        
     77
    7878        g.setColor(Color.RED.brighter().brighter());
    7979        for( double x = x0; x <= x1; x++)
     
    9090    }
    9191
    92     @Override 
    93     public String getToolTipText() 
     92    @Override
     93    public String getToolTipText()
    9494    {
    9595        return null;
    9696    }
    9797
    98     @Override 
     98    @Override
    9999    public void mergeFrom(Layer from) {}
    100100
    101     @Override 
     101    @Override
    102102    public boolean isMergable(Layer other) {
    103103        return false;
    104104    }
    105105
    106     @Override 
     106    @Override
    107107    public void visitBoundingBox(BoundingXYVisitor v) {}
    108108
    109     @Override 
    110     public Object getInfoComponent() 
     109    @Override
     110    public Object getInfoComponent()
    111111    {
    112112        return getToolTipText();
    113113    }
    114114
    115     @Override 
    116     public Component[] getMenuEntries() 
     115    @Override
     116    public Component[] getMenuEntries()
    117117    {
    118118        return new Component[]{
     
    126126
    127127    @Override public void destroy() { }
    128    
     128
    129129    /**
    130130     * Visitor that highlights all cells the selected primitives go through
     
    152152            this.mv = mv;
    153153            this.gridDetail = gridDetail;
    154            
     154
    155155            Point p = mv.getPoint( new EastNorth(0, 0) );
    156156            Point p2 = mv.getPoint( new EastNorth(1d/gridDetail, 1d/gridDetail) );
     
    158158        }
    159159
    160         public void visit(Node n) 
     160        public void visit(Node n)
    161161        {
    162162            double x = n.getEastNorth().east() * gridDetail;
     
    166166        }
    167167
    168         public void visit(Way w) 
     168        public void visit(Way w)
    169169        {
    170170            Node lastN = null;
     
    182182
    183183        public void visit(Relation r) {}
    184        
    185         /** 
     184
     185        /**
    186186         * Draws a solid cell at the (x,y) location
    187187         * @param x
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/TestError.java

    r16159 r16294  
    280280         */
    281281        public void drawNode(Node n, Color color) {
    282             Point p = mv.getPoint(n.getEastNorth());
     282            Point p = mv.getPoint(n);
    283283            g.setColor(color);
    284284            if (selected) {
     
    295295         */
    296296        public void drawSegment(Node n1, Node n2, Color color) {
    297             Point p1 = mv.getPoint(n1.getEastNorth());
    298             Point p2 = mv.getPoint(n2.getEastNorth());
     297            Point p1 = mv.getPoint(n1);
     298            Point p2 = mv.getPoint(n2);
    299299            g.setColor(color);
    300300
     
    365365         */
    366366        protected boolean isNodeVisible(Node n) {
    367             Point p = mv.getPoint(n.getEastNorth());
     367            Point p = mv.getPoint(n);
    368368            return !((p.x < 0) || (p.y < 0) || (p.x > mv.getWidth()) || (p.y > mv.getHeight()));
    369369        }
     
    377377         */
    378378        protected boolean isSegmentVisible(Node n1, Node n2) {
    379             Point p1 = mv.getPoint(n1.getEastNorth());
    380             Point p2 = mv.getPoint(n2.getEastNorth());
     379            Point p1 = mv.getPoint(n1);
     380            Point p2 = mv.getPoint(n2);
    381381            if ((p1.x < 0) && (p2.x < 0))
    382382                return false;
Note: See TracChangeset for help on using the changeset viewer.