Changeset 25910 in osm for applications


Ignore:
Timestamp:
2011-04-27T18:01:10+02:00 (14 years ago)
Author:
kachkaev
Message:

JOSM ImproveWayAccuracy plugin: Minor improvements (dashed line style for node moving preview; blocking preview after a node was moved/added until mouse move; link to Russian wiki page in MANIFEST).

Location:
applications/editors/josm/plugins/ImproveWayAccuracy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/ImproveWayAccuracy/build.xml

    r25899 r25910  
    103103                                <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.iwa.IWAPlugin" />
    104104                                <attribute name="Plugin-Date" value="${version.entry.commit.date}" />
     105                                <attribute name="Plugin-Icon" value="images/favicon.png" />
    105106                                <attribute name="Plugin-Description" value="Can be useful when you are improving accuracy of existing ways. The idea of the plugin is to substitute dragging and dropping nodes with clicking to quicken the editing process." />
    106                                 <attribute name="Plugin-Icon" value="images/favicon.png" />
    107107                                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/ImproveWayAccuracy" />
     108                <attribute name="ru_Plugin-Link" value="http://wiki.openstreetmap.org/wiki/RU:JOSM/Plugins/ImproveWayAccuracy" />
    108109                                <attribute name="Plugin-Mainversion" value="${plugin.main.version}" />
    109110                                <attribute name="Plugin-Version" value="${version.entry.commit.revision}" />
  • applications/editors/josm/plugins/ImproveWayAccuracy/src/org/openstreetmap/josm/plugins/iwa/IWAMode.java

    r25903 r25910  
    8989
    9090    private final Color guideColor;
     91    private final BasicStroke selectTargetWayStroke;
     92    private final BasicStroke moveNodeStroke;
     93    private final BasicStroke addNodeStroke;
    9194
    9295    private boolean selectionChangedBlocked = false;
     
    111114
    112115        guideColor = PaintColors.HIGHLIGHT.get();
     116        selectTargetWayStroke = new BasicStroke(2, BasicStroke.CAP_ROUND,
     117                BasicStroke.JOIN_ROUND);
     118        float dash1[] = { 4.0f };
     119        moveNodeStroke = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,
     120                BasicStroke.JOIN_MITER, 10.0f, dash1, 0.0f);
     121        addNodeStroke = new BasicStroke(1, BasicStroke.CAP_BUTT,
     122                BasicStroke.JOIN_MITER);
    113123    }
    114124
     
    216226            // Non-native highlighting is used, because sometimes highlighted
    217227            // segments are covered with others, which is bad.
    218             g.setStroke(new BasicStroke(2, BasicStroke.CAP_ROUND,
    219                     BasicStroke.JOIN_ROUND));
     228            g.setStroke(selectTargetWayStroke);
    220229
    221230            List<Node> nodes = targetWay.getNodes();
     
    239248            // that is going to be moved.
    240249            // Non-native highlighting is used here as well.
    241             g.setStroke(new BasicStroke(1, BasicStroke.CAP_ROUND,
    242                     BasicStroke.JOIN_ROUND));
    243250
    244251            // Finding endpoints
    245252            Point p1 = null, p2 = null;
    246253            if (candidateSegment != null) {
     254                g.setStroke(addNodeStroke);
    247255                p1 = mv.getPoint(candidateSegment.getFirstNode());
    248256                p2 = mv.getPoint(candidateSegment.getSecondNode());
    249257            } else if (candidateNode != null) {
     258                g.setStroke(moveNodeStroke);
    250259                List<Pair<Node, Node>> wpps = targetWay.getNodePairs(false);
    251260                for (Pair<Node, Node> wpp : wpps) {
     
    262271            GeneralPath b = new GeneralPath();
    263272            if (p1 != null) {
    264                 b.moveTo(p1.x, p1.y);
    265                 b.lineTo(mousePos.x, mousePos.y);
    266             } else {
    267273                b.moveTo(mousePos.x, mousePos.y);
    268             }
    269             if (p2 != null)
     274                b.lineTo(p1.x, p1.y);
     275            }
     276            if (p2 != null) {
     277                b.moveTo(mousePos.x, mousePos.y);
    270278                b.lineTo(p2.x, p2.y);
     279            }
    271280            g.draw(b);
    272281
     
    415424        }
    416425
     426        mousePos = null;
    417427        updateCursor();
    418428        updateStatusLine();
Note: See TracChangeset for help on using the changeset viewer.