Changeset 2807 in osm for applications


Ignore:
Timestamp:
2007-05-06T23:59:34+02:00 (17 years ago)
Author:
damians
Message:

added military danger_area
direction arows only when selected
roads with round ending

Location:
applications/editors/josm/plugins/mappaint
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java

    r2787 r2807  
    107107                                curIcon = new ImageIcon(imageFile);
    108108                                                                                                } else {
     109                                                                                                        try {
     110                                                                                                                URL path = getClass().getResource("/standard/icons/"+atts.getValue(count));
     111                                                                                                                curIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(path));
     112                                                                                                        }
     113                                                                                                        catch (Exception e){
    109114                                                                                                                URL path = getClass().getResource("/standard/icons/amenity.png");
    110115                                                                                                                curIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(path));
     116
     117                                                                                                        }
    111118                                                                                                }
    112119                    } else if (atts.getQName(count).equals("annotate"))
  • applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java

    r2796 r2807  
    6565        @Override public void visit(Way w) {
    6666                double circum = Main.map.mapView.getScale()*100*Main.proj.scaleFactor()*40041455; // circumference of the earth in meter
     67                boolean showDirection = Main.pref.getBoolean("draw.segment.direction") ;
     68                if (Main.pref.getBoolean("mappaint.useRealWidth",false) && showDirection && !w.selected) showDirection = false;
    6769                Color colour = getPreferencesColor("untagged",Color.GRAY);
    6870                int width = 2;
     
    9496                                if (area && fillAreas)
    9597                                        //Draw segments in a different colour so direction arrows show against the fill
    96                                         drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : getPreferencesColor("untagged",Color.GRAY),Main.pref.getBoolean("draw.segment.direction"), width,true);
     98                                        drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : getPreferencesColor("untagged",Color.GRAY),showDirection, width,true);
    9799                                else
    98100                                        if (area)
    99                                                 drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : colour,Main.pref.getBoolean("draw.segment.direction"), width,true);
     101                                                drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : colour,showDirection, width,true);
    100102                                        else
    101                                                 if (realWidth > 0 && Main.pref.getBoolean("mappaint.useRealWidth",false)){
     103                                                if (realWidth > 0 && Main.pref.getBoolean("mappaint.useRealWidth",false) && !showDirection){
    102104                                                        int tmpWidth = (int) (100 /  (float) (circum / realWidth));
    103105                                                        if (tmpWidth > width) width = tmpWidth;
    104106                                                }
    105107
    106                                                 drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : colour,Main.pref.getBoolean("draw.segment.direction"), width,false);
     108                                                drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : colour,showDirection, width,false);
    107109                                if (!ls.incomplete && Main.pref.getBoolean("draw.segment.order_number"))
    108110                                {
     
    169171        // Altered - now specify width
    170172        @Override protected void drawSegment(Segment ls, Color col,boolean showDirection) {
     173                        if (Main.pref.getBoolean("mappaint.useRealWidth",false) && showDirection && !ls.selected) showDirection = false;
    171174                        drawSegment(ls,col,showDirection,1,false);
    172175        }
     
    188191                        g2d.setStroke(new BasicStroke(width,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0,new float[] {9},0));
    189192                else
    190                         g2d.setStroke(new BasicStroke(width));
     193                        g2d.setStroke(new BasicStroke(width,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
     194                        //g2d.setStroke(new BasicStroke(width));
    191195
    192196                Point p1 = nc.getPoint(ls.from.eastNorth);
  • applications/editors/josm/plugins/mappaint/styles/standard/elemstyles.xml

    r2796 r2807  
    235235</rule>
    236236
     237<rule>
     238<condition k="military" v="danger_area" />
     239        <area colour="#b62c2c"/>
     240</rule>
    237241
    238242<rule>
Note: See TracChangeset for help on using the changeset viewer.