Changeset 31791 in osm
- Timestamp:
- 2015-12-03T00:56:12+01:00 (9 years ago)
- Location:
- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
r31790 r31791 538 538 int tilex = center.x / tilesize; 539 539 int tiley = center.y / tilesize; 540 int off _x = center.x % tilesize;541 int off _y = center.y % tilesize;540 int offsx = center.x % tilesize; 541 int offsy = center.y % tilesize; 542 542 543 543 int w2 = getWidth() / 2; 544 544 int h2 = getHeight() / 2; 545 int posx = w2 - off _x;546 int posy = h2 - off _y;547 548 int diff _left = off_x;549 int diff _right = tilesize - off_x;550 int diff _top = off_y;551 int diff _bottom = tilesize - off_y;552 553 boolean start _left = diff_left < diff_right;554 boolean start _top = diff_top < diff_bottom;555 556 if (start _top) {557 if (start _left) {545 int posx = w2 - offsx; 546 int posy = h2 - offsy; 547 548 int diffLeft = offsx; 549 int diffRight = tilesize - offsx; 550 int diffTop = offsy; 551 int diffBottom = tilesize - offsy; 552 553 boolean startLeft = diffLeft < diffRight; 554 boolean startTop = diffTop < diffBottom; 555 556 if (startTop) { 557 if (startLeft) { 558 558 iMove = 2; 559 559 } else { … … 561 561 } 562 562 } else { 563 if (start _left) {563 if (startLeft) { 564 564 iMove = 1; 565 565 } else { … … 567 567 } 568 568 } // calculate the visibility borders 569 int x _min = -tilesize;570 int y _min = -tilesize;571 int x _max = getWidth();572 int y _max = getHeight();569 int xMin = -tilesize; 570 int yMin = -tilesize; 571 int xMax = getWidth(); 572 int yMax = getHeight(); 573 573 574 574 // calculate the length of the grid (number of squares per edge) … … 585 585 } 586 586 for (int j = 0; j < x; j++) { 587 if (x _min <= posx && posx <= x_max && y_min <= posy && posy <= y_max) {587 if (xMin <= posx && posx <= xMax && yMin <= posy && posy <= yMax) { 588 588 // tile is visible 589 589 Tile tile; -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapMarkerCircle.java
r31434 r31791 129 129 @Override 130 130 public void paint(Graphics g, Point position, int radius) { 131 int size _h= radius;132 int size = size _h* 2;131 int sizeH = radius; 132 int size = sizeH * 2; 133 133 134 134 if (g instanceof Graphics2D && getBackColor() != null) { … … 137 137 g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER)); 138 138 g2.setPaint(getBackColor()); 139 g.fillOval(position.x - size _h, position.y - size_h, size, size);139 g.fillOval(position.x - sizeH, position.y - sizeH, size, size); 140 140 g2.setComposite(oldComposite); 141 141 } 142 142 g.setColor(getColor()); 143 g.drawOval(position.x - size _h, position.y - size_h, size, size);143 g.drawOval(position.x - sizeH, position.y - sizeH, size, size); 144 144 145 145 if (getLayer() == null || getLayer().isVisibleTexts()) paintText(g, position); -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractMapQuestTileSource.java
r31573 r31791 31 31 private int SERVER_NUM = 1; 32 32 33 public AbstractMapQuestTileSource(String name, String base _url, String id) {34 super(name, base _url, id);33 public AbstractMapQuestTileSource(String name, String baseUrl, String id) { 34 super(name, baseUrl, id); 35 35 } 36 36 -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractOsmTileSource.java
r31434 r31791 20 20 * Constructs a new OSM tile source 21 21 * @param name Source name as displayed in GUI 22 * @param base _url Source URL22 * @param baseUrl Source URL 23 23 * @param id unique id for the tile source; contains only characters that 24 24 * are safe for file names; can be null 25 25 */ 26 public AbstractOsmTileSource(String name, String base _url, String id) {27 super(new TileSourceInfo(name, base _url, id));26 public AbstractOsmTileSource(String name, String baseUrl, String id) { 27 super(new TileSourceInfo(name, baseUrl, id)); 28 28 } 29 29 -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TileSourceInfo.java
r31432 r31791 43 43 * 44 44 * @param name name 45 * @param base _url base URL45 * @param baseUrl base URL 46 46 * @param id unique id 47 47 */ 48 public TileSourceInfo(String name, String base _url, String id) {48 public TileSourceInfo(String name, String baseUrl, String id) { 49 49 this.name = name; 50 this.url = base _url;50 this.url = baseUrl; 51 51 this.id = id; 52 52 }
Note:
See TracChangeset
for help on using the changeset viewer.