Changeset 11367 in josm
- Timestamp:
- 2016-12-08T01:28:57+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r10972 r11367 83 83 } 84 84 85 /** 86 * To determine if a primitive is currently selectable. 87 */ 85 88 public transient Predicate<OsmPrimitive> isSelectablePredicate = prim -> { 86 89 if (!prim.isSelectable()) return false; … … 94 97 }; 95 98 99 /** Snap distance */ 96 100 public static final IntegerProperty PROP_SNAP_DISTANCE = new IntegerProperty("mappaint.node.snap-distance", 10); 101 /** Zoom steps to get double scale */ 97 102 public static final DoubleProperty PROP_ZOOM_RATIO = new DoubleProperty("zoom.ratio", 2.0); 103 /** Divide intervals between native resolution levels to smaller steps if they are much larger than zoom ratio */ 98 104 public static final BooleanProperty PROP_ZOOM_INTERMEDIATE_STEPS = new BooleanProperty("zoom.intermediate-steps", true); 99 105 106 /** Property name for center change events */ 100 107 public static final String PROPNAME_CENTER = "center"; 108 /** Property name for scale change events */ 101 109 public static final String PROPNAME_SCALE = "scale"; 102 110 … … 422 430 } 423 431 432 /** 433 * Determines the projection bounds of view area. 434 * @return the projection bounds of view area 435 */ 424 436 public ProjectionBounds getProjectionBounds() { 425 437 return getState().getViewArea().getProjectionBounds(); … … 439 451 440 452 /** 453 * Returns unprojected geographic coordinates for a specific pixel position on the screen. 441 454 * @param x X-Pixelposition to get coordinate from 442 455 * @param y Y-Pixelposition to get coordinate from 443 456 * 444 * @return Geographic unprojected coordinates from a specific pixel coordination 445 * on the screen. 457 * @return Geographic unprojected coordinates from a specific pixel position on the screen. 446 458 */ 447 459 public LatLon getLatLon(int x, int y) { … … 449 461 } 450 462 463 /** 464 * Returns unprojected geographic coordinates for a specific pixel position on the screen. 465 * @param x X-Pixelposition to get coordinate from 466 * @param y Y-Pixelposition to get coordinate from 467 * 468 * @return Geographic unprojected coordinates from a specific pixel position on the screen. 469 */ 451 470 public LatLon getLatLon(double x, double y) { 452 471 return getLatLon((int) x, (int) y); 453 472 } 454 473 474 /** 475 * Determines the projection bounds of given rectangle. 476 * @param r rectangle 477 * @return the projection bounds of {@code r} 478 */ 455 479 public ProjectionBounds getProjectionBounds(Rectangle r) { 456 480 return getState().getViewArea(r).getProjectionBounds(); … … 465 489 } 466 490 491 /** 492 * Creates an affine transform that is used to convert the east/north coordinates to view coordinates. 493 * @return The affine transform. 494 */ 467 495 public AffineTransform getAffineTransform() { 468 496 return getState().getAffineTransform(); … … 472 500 * Return the point on the screen where this Coordinate would be. 473 501 * @param p The point, where this geopoint would be drawn. 474 * @return The point on screen where "point" would be drawn, relative 475 * to the own top/left. 502 * @return The point on screen where "point" would be drawn, relative to the own top/left. 476 503 */ 477 504 public Point2D getPoint2D(EastNorth p) { … … 481 508 } 482 509 510 /** 511 * Return the point on the screen where this Coordinate would be. 512 * @param latlon The point, where this geopoint would be drawn. 513 * @return The point on screen where "point" would be drawn, relative to the own top/left. 514 */ 483 515 public Point2D getPoint2D(LatLon latlon) { 484 516 if (latlon == null) … … 490 522 } 491 523 524 /** 525 * Return the point on the screen where this Node would be. 526 * @param n The node, where this geopoint would be drawn. 527 * @return The point on screen where "node" would be drawn, relative to the own top/left. 528 */ 492 529 public Point2D getPoint2D(Node n) { 493 530 return getPoint2D(n.getEastNorth()); … … 626 663 } 627 664 665 /** 666 * Zoom to given east/north. 667 * @param newCenter new center coordinates 668 */ 628 669 public void zoomTo(EastNorth newCenter) { 629 670 zoomTo(newCenter, getScale()); 630 671 } 631 672 673 /** 674 * Zoom to given lat/lon. 675 * @param newCenter new center coordinates 676 */ 632 677 public void zoomTo(LatLon newCenter) { 633 678 zoomTo(Projections.project(newCenter)); … … 688 733 } 689 734 735 /** 736 * Zoom to given projection bounds. 737 * @param box new projection bounds 738 */ 690 739 public void zoomTo(ProjectionBounds box) { 691 740 // -20 to leave some border … … 707 756 } 708 757 758 /** 759 * Zoom to given bounds. 760 * @param box new bounds 761 */ 709 762 public void zoomTo(Bounds box) { 710 763 zoomTo(new ProjectionBounds(getProjection().latlon2eastNorth(box.getMin()), … … 712 765 } 713 766 767 /** 768 * Zoom to given viewport data. 769 * @param viewport new viewport data 770 */ 714 771 public void zoomTo(ViewportData viewport) { 715 772 if (viewport == null) return; … … 775 832 } 776 833 834 /** 835 * Zoom to previous location. 836 */ 777 837 public void zoomPrevious() { 778 838 if (!zoomUndoBuffer.isEmpty()) { … … 783 843 } 784 844 845 /** 846 * Zoom to next location. 847 */ 785 848 public void zoomNext() { 786 849 if (!zoomRedoBuffer.isEmpty()) { … … 791 854 } 792 855 856 /** 857 * Determines if zoom history contains "undo" entries. 858 * @return {@code true} if zoom history contains "undo" entries 859 */ 793 860 public boolean hasZoomUndoEntries() { 794 861 return !zoomUndoBuffer.isEmpty(); 795 862 } 796 863 864 /** 865 * Determines if zoom history contains "redo" entries. 866 * @return {@code true} if zoom history contains "redo" entries 867 */ 797 868 public boolean hasZoomRedoEntries() { 798 869 return !zoomRedoBuffer.isEmpty(); … … 1314 1385 if (osm != null) { 1315 1386 if (osm instanceof Node) { 1316 nearestList = new ArrayList< OsmPrimitive>(getNearestNodes(p, predicate));1387 nearestList = new ArrayList<>(getNearestNodes(p, predicate)); 1317 1388 } else if (osm instanceof Way) { 1318 nearestList = new ArrayList< OsmPrimitive>(getNearestWays(p, predicate));1389 nearestList = new ArrayList<>(getNearestWays(p, predicate)); 1319 1390 } 1320 1391 if (ignore != null) { -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r11366 r11367 98 98 import org.xml.sax.SAXException; 99 99 100 /** 101 * Editor for JOSM extensions source entries. 102 * @since 1743 103 */ 100 104 public abstract class SourceEditor extends JPanel { 101 105 … … 717 721 } 718 722 723 /** 724 * Source entry with additional metadata. 725 */ 719 726 public static class ExtendedSourceEntry extends SourceEntry implements Comparable<ExtendedSourceEntry> { 720 727 /** file name used for display */ … … 1642 1649 } 1643 1650 1651 /** 1652 * Helper class for specialized extensions preferences. 1653 */ 1644 1654 public abstract static class SourcePrefHelper { 1645 1655 … … 1682 1692 Collection<Map<String, String>> src = Main.pref.getListOfStructs(pref, (Collection<Map<String, String>>) null); 1683 1693 if (src == null) 1684 return new ArrayList< SourceEntry>(getDefault());1694 return new ArrayList<>(getDefault()); 1685 1695 1686 1696 List<SourceEntry> entries = new ArrayList<>();
Note:
See TracChangeset
for help on using the changeset viewer.