Changeset 31429 in osm for applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapPolygonImpl.java
- Timestamp:
- 2015-08-01T21:26:26+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapPolygonImpl.java
r30223 r31429 25 25 this(null, null, points); 26 26 } 27 27 28 public MapPolygonImpl(List<? extends ICoordinate> points) { 28 29 this(null, null, points); 29 30 } 31 30 32 public MapPolygonImpl(String name, List<? extends ICoordinate> points) { 31 33 this(null, name, points); 32 34 } 35 33 36 public MapPolygonImpl(String name, ICoordinate ... points) { 34 37 this(null, name, points); 35 38 } 39 36 40 public MapPolygonImpl(Layer layer, List<? extends ICoordinate> points) { 37 41 this(layer, null, points); 38 42 } 43 39 44 public MapPolygonImpl(Layer layer, String name, List<? extends ICoordinate> points) { 40 45 this(layer, name, points, getDefaultStyle()); 41 46 } 47 42 48 public MapPolygonImpl(Layer layer, String name, ICoordinate ... points) { 43 49 this(layer, name, Arrays.asList(points), getDefaultStyle()); 44 50 } 51 45 52 public MapPolygonImpl(Layer layer, String name, List<? extends ICoordinate> points, Style style) { 46 53 super(layer, name, style); … … 76 83 // Draw 77 84 g.drawPolygon(polygon); 78 if (g instanceof Graphics2D && getBackColor() !=null) {85 if (g instanceof Graphics2D && getBackColor() != null) { 79 86 Graphics2D g2 = (Graphics2D) g; 80 87 Composite oldComposite = g2.getComposite(); … … 91 98 Rectangle rec = polygon.getBounds(); 92 99 Point corner = rec.getLocation(); 93 Point p = new Point(corner.x+(rec.width/2), corner.y+(rec.height/2));94 if (getLayer()==null||getLayer().isVisibleTexts()) paintText(g, p);100 Point p = new Point(corner.x+(rec.width/2), corner.y+(rec.height/2)); 101 if (getLayer() == null || getLayer().isVisibleTexts()) paintText(g, p); 95 102 } 96 103 97 public static Style getDefaultStyle() {98 return new Style(Color.BLUE, new Color(100, 100,100,50), new BasicStroke(2), getDefaultFont());104 public static Style getDefaultStyle() { 105 return new Style(Color.BLUE, new Color(100, 100, 100, 50), new BasicStroke(2), getDefaultFont()); 99 106 } 100 107
Note:
See TracChangeset
for help on using the changeset viewer.