Changeset 13676 in josm


Ignore:
Timestamp:
2018-04-24T22:52:33+02:00 (12 months ago)
Author:
Don-vip
Message:

cleaner API/javadoc for StyledMapRenderer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r13673 r13676  
    899899    }
    900900
    901     public void drawRestriction(Image img, Point pVia, double vx, double vx2, double vy, double vy2, double angle, boolean selected) {
     901    /**
     902     * Draws a restriction.
     903     * @param img symbol image
     904     * @param pVia "via" node
     905     * @param vx X offset
     906     * @param vy Y offset
     907     * @param angle the rotated angle, in degree, clockwise
     908     * @param selected if true, draws a selection rectangle
     909     * @since 13676
     910     */
     911    public void drawRestriction(Image img, Point pVia, double vx, double vy, double angle, boolean selected) {
    902912        // rotate image with direction last node in from to, and scale down image to 16*16 pixels
    903913        Image smallImg = ImageProvider.createRotatedImage(img, angle, new Dimension(16, 16));
    904914        int w = smallImg.getWidth(null), h = smallImg.getHeight(null);
    905         g.drawImage(smallImg, (int) (pVia.x+vx+vx2)-w/2, (int) (pVia.y+vy+vy2)-h/2, nc);
     915        g.drawImage(smallImg, (int) (pVia.x+vx)-w/2, (int) (pVia.y+vy)-h/2, nc);
    906916
    907917        if (selected) {
    908918            g.setColor(isInactiveMode ? inactiveColor : relationSelectedColor);
    909             g.drawRect((int) (pVia.x+vx+vx2)-w/2-2, (int) (pVia.y+vy+vy2)-h/2-2, w+4, h+4);
     919            g.drawRect((int) (pVia.x+vx)-w/2-2, (int) (pVia.y+vy)-h/2-2, w+4, h+4);
    910920        }
    911921    }
     
    10821092
    10831093        drawRestriction(icon.getImage(disabled),
    1084                 pVia, vx, vx2, vy, vy2, iconAngle, r.isSelected());
     1094                pVia, vx+vx2, vy+vy2, iconAngle, r.isSelected());
    10851095    }
    10861096
     
    15511561     * @param checkOuterMember <code>true</code> if we should also add {@link #FLAG_OUTERMEMBER_OF_SELECTED}
    15521562     * @return The flag.
    1553      */
    1554     public static int computeFlags(OsmPrimitive primitive, boolean checkOuterMember) {
     1563     * @since 13676 (signature)
     1564     */
     1565    public static int computeFlags(IPrimitive primitive, boolean checkOuterMember) {
    15551566        if (primitive.isDisabled()) {
    15561567            return FLAG_DISABLED;
Note: See TracChangeset for help on using the changeset viewer.