Ignore:
Timestamp:
2010-11-25T09:45:38+01:00 (13 years ago)
Author:
bastiK
Message:

adapt coding style (to some degree); there shouldn't be any semantic changes in this commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/TestError.java

    r3669 r3671  
    157157                return null;
    158158            String type = "u";
    159             if (o instanceof Way)
     159            if (o instanceof Way) {
    160160                type = "w";
    161             else if (o instanceof Relation)
     161            } else if (o instanceof Relation) {
    162162                type = "r";
    163             else if (o instanceof Node)
     163            } else if (o instanceof Node) {
    164164                type = "n";
     165            }
    165166            strings.add(type + "_" + o.getId());
    166167        }
     
    173174    public String getIgnoreSubGroup() {
    174175        String ignorestring = getIgnoreGroup();
    175         if (description_en != null)
     176        if (description_en != null) {
    176177            ignorestring += "_" + description_en;
     178        }
    177179        return ignorestring;
    178180    }
     
    216218
    217219    /**
    218      * Fixes the error with the appropiate command
     220     * Fixes the error with the appropriate command
    219221     *
    220222     * @return The command to fix the error
     
    243245    public void visitHighlighted(ValidatorVisitor v) {
    244246        for (Object o : highlighted) {
    245             if (o instanceof OsmPrimitive)
     247            if (o instanceof OsmPrimitive) {
    246248                v.visit((OsmPrimitive) o);
    247             else if (o instanceof WaySegment)
     249            } else if (o instanceof WaySegment) {
    248250                v.visit((WaySegment) o);
    249             else if (o instanceof List<?>) {
     251            } else if (o instanceof List<?>) {
    250252                v.visit((List<Node>)o);
    251253            }
     
    273275        }
    274276
     277        @Override
    275278        public void visit(OsmPrimitive p) {
    276279            if (p.isUsable()) {
     
    289292            if (selected) {
    290293                g.fillOval(p.x - 5, p.y - 5, 10, 10);
    291             } else
     294            } else {
    292295                g.drawOval(p.x - 5, p.y - 5, 10, 10);
     296            }
    293297        }
    294298
     
    301305            int deg = (int) Math.toDegrees(t);
    302306            if (selected) {
    303                 int[] x = new int[] { (int) (p1.x + 5 * cosT), (int) (p2.x + 5 * cosT), (int) (p2.x - 5 * cosT),
    304                         (int) (p1.x - 5 * cosT) };
    305                 int[] y = new int[] { (int) (p1.y - 5 * sinT), (int) (p2.y - 5 * sinT), (int) (p2.y + 5 * sinT),
    306                         (int) (p1.y + 5 * sinT) };
     307                int[] x = new int[] { (int) (p1.x + 5 * cosT), (int) (p2.x + 5 * cosT),
     308                                      (int) (p2.x - 5 * cosT), (int) (p1.x - 5 * cosT) };
     309                int[] y = new int[] { (int) (p1.y - 5 * sinT), (int) (p2.y - 5 * sinT),
     310                                      (int) (p2.y + 5 * sinT), (int) (p1.y + 5 * sinT) };
    307311                g.fillPolygon(x, y, 4);
    308312                g.fillArc(p1.x - 5, p1.y - 5, 10, 10, deg, 180);
    309313                g.fillArc(p2.x - 5, p2.y - 5, 10, 10, deg, -180);
    310314            } else {
    311                 g.drawLine((int) (p1.x + 5 * cosT), (int) (p1.y - 5 * sinT), (int) (p2.x + 5 * cosT),
    312                         (int) (p2.y - 5 * sinT));
    313                 g.drawLine((int) (p1.x - 5 * cosT), (int) (p1.y + 5 * sinT), (int) (p2.x - 5 * cosT),
    314                         (int) (p2.y + 5 * sinT));
     315                g.drawLine((int) (p1.x + 5 * cosT), (int) (p1.y - 5 * sinT),
     316                           (int) (p2.x + 5 * cosT), (int) (p2.y - 5 * sinT));
     317                g.drawLine((int) (p1.x - 5 * cosT), (int) (p1.y + 5 * sinT),
     318                           (int) (p2.x - 5 * cosT), (int) (p2.y + 5 * sinT));
    315319                g.drawArc(p1.x - 5, p1.y - 5, 10, 10, deg, 180);
    316320                g.drawArc(p2.x - 5, p2.y - 5, 10, 10, deg, -180);
     
    334338         * @param n The node to draw.
    335339         */
     340        @Override
    336341        public void visit(Node n) {
    337             if (isNodeVisible(n))
     342            if (isNodeVisible(n)) {
    338343                drawNode(n, severity.getColor());
    339         }
    340 
     344            }
     345        }
     346
     347        @Override
    341348        public void visit(Way w) {
    342349            visit(w.getNodes());
    343350        }
    344351
     352        @Override
    345353        public void visit(WaySegment ws) {
    346354            if (ws.lowerIndex < 0 || ws.lowerIndex + 1 >= ws.way.getNodesCount())
     
    352360        }
    353361
     362        @Override
    354363        public void visit(Relation r) {
    355364            /* No idea how to draw a relation. */
     
    387396        }
    388397
     398        @Override
    389399        public void visit(List<Node> nodes) {
    390400            Node lastN = null;
Note: See TracChangeset for help on using the changeset viewer.