Changeset 1270 in josm for trunk/src/org/openstreetmap/josm
- Timestamp:
- 2009-01-15T22:33:35+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r1263 r1270 41 41 /* mappaint data */ 42 42 public ElemStyle mappaintStyle = null; 43 public boolean isMappaintArea = false;44 43 public Integer mappaintVisibleCode = 0; 45 44 public Integer mappaintDrawnCode = 0; 46 public Integer mappaintDrawnAreaCode = 0;47 45 public Collection<String> errors; 48 46 -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r1264 r1270 26 26 public final List<Node> nodes = new ArrayList<Node>(); 27 27 28 /* mappaint data */ 29 public boolean isMappaintArea = false; 30 public Integer mappaintDrawnAreaCode = 0; 31 /* end of mappaint data */ 32 28 33 public void visitNodes(Visitor v) { 29 34 for (Node n : this.nodes) -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1267 r1270 28 28 import org.openstreetmap.josm.data.osm.Way; 29 29 import org.openstreetmap.josm.data.osm.visitor.SimplePaintVisitor; 30 import org.openstreetmap.josm.data.coor.LatLon; 30 31 import org.openstreetmap.josm.gui.mappaint.AreaElemStyle; 31 32 import org.openstreetmap.josm.gui.mappaint.ElemStyle; … … 38 39 protected boolean useRealWidth; 39 40 protected boolean zoomLevelDisplay; 40 protected booleanfillAreas;41 protected int fillAreas; 41 42 protected boolean drawMultipolygon; 42 protected boolean showName; 43 protected int showNames; 44 protected int showIcons; 45 protected int useStrokes; 43 46 protected int fillAlpha; 44 47 protected Color untaggedColor; … … 50 53 protected ElemStyles.StyleSet styles; 51 54 protected double circum; 55 protected double dist; 52 56 protected String regionalNameOrder[]; 53 57 protected Boolean selectedCall; … … 84 88 if(osm.mappaintStyle == null && styles != null) { 85 89 osm.mappaintStyle = styles.get(osm); 86 osm.isMappaintArea = styles.isArea(osm); 90 if(osm instanceof Way) 91 ((Way)osm).isMappaintArea = styles.isArea(osm); 87 92 } 88 93 return osm.mappaintStyle; 89 94 } 90 95 91 public boolean isPrimitiveArea( OsmPrimitiveosm) {96 public boolean isPrimitiveArea(Way osm) { 92 97 if(!useStyleCache) 93 return styles.isArea( (Way)osm);98 return styles.isArea(osm); 94 99 95 100 if(osm.mappaintStyle == null && styles != null) { 96 101 osm.mappaintStyle = styles.get(osm); 97 osm.isMappaintArea = styles.isArea(osm); 102 if(osm instanceof Way) 103 osm.isMappaintArea = styles.isArea(osm); 98 104 } 99 105 return osm.isMappaintArea; … … 123 129 return; 124 130 125 if (nodeStyle != null && isZoomOk(nodeStyle)) 131 if (nodeStyle != null && isZoomOk(nodeStyle) && showIcons > dist) 126 132 drawNode(n, nodeStyle.icon, nodeStyle.annotate, n.selected); 127 133 else if (n.selected) … … 161 167 162 168 w.mappaintVisibleCode = 0; 163 if(fillAreas) 169 if(fillAreas > dist) 164 170 w.clearErrors(); 165 171 … … 183 189 if(!profilerOmitDraw) 184 190 { 185 if (fillAreas) 191 if (fillAreas > dist) 186 192 { 187 193 profilerVisibleAreas++; … … 749 755 int w = icon.getIconWidth(), h=icon.getIconHeight(); 750 756 icon.paintIcon ( Main.map.mapView, g, p.x-w/2, p.y-h/2 ); 751 if(showName) 757 if(showNames > dist) 752 758 { 753 759 String name = getNodeName(n); … … 810 816 Graphics2D g2d = (Graphics2D)g; 811 817 g2d.setColor(inactive ? inactiveColor : currentColor); 812 if (currentStroke == null) { 818 if (currentStroke == null && useStrokes > dist) { 813 819 if (currentDashed) 814 820 g2d.setStroke(new BasicStroke(currentWidth,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0,new float[] {9},0)); … … 817 823 } 818 824 g2d.draw(currentPath); 819 g2d.setStroke(new BasicStroke(1)); 825 if(useStrokes > dist) 826 g2d.setStroke(new BasicStroke(1)); 820 827 821 828 currentPath = new GeneralPath(); … … 846 853 g.drawRect(p.x - radius, p.y - radius, size, size); 847 854 848 if(showName) 855 if(showNames > dist) 849 856 { 850 857 String name = getNodeName(n); … … 875 882 876 883 useStyleCache = Main.pref.getBoolean("mappaint.cache",true); 877 fillAreas = Main.pref.get Boolean("mappaint.fillareas",true);884 fillAreas = Main.pref.getInteger("mappaint.fillareas", 100000); 878 885 fillAlpha = Math.min(255, Math.max(0, Integer.valueOf(Main.pref.getInteger("mappaint.fillalpha", 50)))); 879 showName = Main.pref.getBoolean("mappaint.showname", true); 886 showNames = Main.pref.getInteger("mappaint.shownames", 100000); 887 showIcons = Main.pref.getInteger("mappaint.showicons", 100000); 888 useStrokes = Main.pref.getInteger("mappaint.strokes", 100000); 880 889 881 890 long profilerStart = java.lang.System.currentTimeMillis(); … … 885 894 System.out.println("Mappaint Profiler (" + 886 895 (useStyleCache ? "cache=true, " : "cache=false, ") + 887 (fillAreas? "fillareas=true, " : "fillareas=false, ")+896 "fillareas " + fillAreas + ", " + 888 897 "fillalpha=" + fillAlpha + "%)"); 889 898 … … 908 917 profilerVisibleSegments = 0; 909 918 919 LatLon ll1 = nc.getLatLon(0,0); 920 LatLon ll2 = nc.getLatLon(100,0); 921 dist = ll1.greatCircleDistance(ll2); 922 System.out.format("Circum : %4f Dist: %f\n", circum, dist); 923 910 924 if(profiler) 911 925 { … … 914 928 } 915 929 916 if (fillAreas && styles != null && styles.hasAreas()) { 930 if (fillAreas > dist && styles != null && styles.hasAreas()) { 917 931 Collection<Way> noAreaWays = new LinkedList<Way>(); 918 932 … … 959 973 /*** WAYS ***/ 960 974 profilerN = 0; 961 fillAreas = false;975 fillAreas = 0; 962 976 for (final OsmPrimitive osm : noAreaWays) 963 977 {
Note:
See TracChangeset
for help on using the changeset viewer.