Changeset 11367 in josm


Ignore:
Timestamp:
2016-12-08T01:28:57+01:00 (8 years ago)
Author:
Don-vip
Message:

javadoc + diamond operator

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r10972 r11367  
    8383    }
    8484
     85    /**
     86     * To determine if a primitive is currently selectable.
     87     */
    8588    public transient Predicate<OsmPrimitive> isSelectablePredicate = prim -> {
    8689        if (!prim.isSelectable()) return false;
     
    9497    };
    9598
     99    /** Snap distance */
    96100    public static final IntegerProperty PROP_SNAP_DISTANCE = new IntegerProperty("mappaint.node.snap-distance", 10);
     101    /** Zoom steps to get double scale */
    97102    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 */
    98104    public static final BooleanProperty PROP_ZOOM_INTERMEDIATE_STEPS = new BooleanProperty("zoom.intermediate-steps", true);
    99105
     106    /** Property name for center change events */
    100107    public static final String PROPNAME_CENTER = "center";
     108    /** Property name for scale change events */
    101109    public static final String PROPNAME_SCALE = "scale";
    102110
     
    422430    }
    423431
     432    /**
     433     * Determines the projection bounds of view area.
     434     * @return the projection bounds of view area
     435     */
    424436    public ProjectionBounds getProjectionBounds() {
    425437        return getState().getViewArea().getProjectionBounds();
     
    439451
    440452    /**
     453     * Returns unprojected geographic coordinates for a specific pixel position on the screen.
    441454     * @param x X-Pixelposition to get coordinate from
    442455     * @param y Y-Pixelposition to get coordinate from
    443456     *
    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.
    446458     */
    447459    public LatLon getLatLon(int x, int y) {
     
    449461    }
    450462
     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     */
    451470    public LatLon getLatLon(double x, double y) {
    452471        return getLatLon((int) x, (int) y);
    453472    }
    454473
     474    /**
     475     * Determines the projection bounds of given rectangle.
     476     * @param r rectangle
     477     * @return the projection bounds of {@code r}
     478     */
    455479    public ProjectionBounds getProjectionBounds(Rectangle r) {
    456480        return getState().getViewArea(r).getProjectionBounds();
     
    465489    }
    466490
     491    /**
     492     * Creates an affine transform that is used to convert the east/north coordinates to view coordinates.
     493     * @return The affine transform.
     494     */
    467495    public AffineTransform getAffineTransform() {
    468496        return getState().getAffineTransform();
     
    472500     * Return the point on the screen where this Coordinate would be.
    473501     * @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.
    476503     */
    477504    public Point2D getPoint2D(EastNorth p) {
     
    481508    }
    482509
     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     */
    483515    public Point2D getPoint2D(LatLon latlon) {
    484516        if (latlon == null)
     
    490522    }
    491523
     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     */
    492529    public Point2D getPoint2D(Node n) {
    493530        return getPoint2D(n.getEastNorth());
     
    626663    }
    627664
     665    /**
     666     * Zoom to given east/north.
     667     * @param newCenter new center coordinates
     668     */
    628669    public void zoomTo(EastNorth newCenter) {
    629670        zoomTo(newCenter, getScale());
    630671    }
    631672
     673    /**
     674     * Zoom to given lat/lon.
     675     * @param newCenter new center coordinates
     676     */
    632677    public void zoomTo(LatLon newCenter) {
    633678        zoomTo(Projections.project(newCenter));
     
    688733    }
    689734
     735    /**
     736     * Zoom to given projection bounds.
     737     * @param box new projection bounds
     738     */
    690739    public void zoomTo(ProjectionBounds box) {
    691740        // -20 to leave some border
     
    707756    }
    708757
     758    /**
     759     * Zoom to given bounds.
     760     * @param box new bounds
     761     */
    709762    public void zoomTo(Bounds box) {
    710763        zoomTo(new ProjectionBounds(getProjection().latlon2eastNorth(box.getMin()),
     
    712765    }
    713766
     767    /**
     768     * Zoom to given viewport data.
     769     * @param viewport new viewport data
     770     */
    714771    public void zoomTo(ViewportData viewport) {
    715772        if (viewport == null) return;
     
    775832    }
    776833
     834    /**
     835     * Zoom to previous location.
     836     */
    777837    public void zoomPrevious() {
    778838        if (!zoomUndoBuffer.isEmpty()) {
     
    783843    }
    784844
     845    /**
     846     * Zoom to next location.
     847     */
    785848    public void zoomNext() {
    786849        if (!zoomRedoBuffer.isEmpty()) {
     
    791854    }
    792855
     856    /**
     857     * Determines if zoom history contains "undo" entries.
     858     * @return {@code true} if zoom history contains "undo" entries
     859     */
    793860    public boolean hasZoomUndoEntries() {
    794861        return !zoomUndoBuffer.isEmpty();
    795862    }
    796863
     864    /**
     865     * Determines if zoom history contains "redo" entries.
     866     * @return {@code true} if zoom history contains "redo" entries
     867     */
    797868    public boolean hasZoomRedoEntries() {
    798869        return !zoomRedoBuffer.isEmpty();
     
    13141385        if (osm != null) {
    13151386            if (osm instanceof Node) {
    1316                 nearestList = new ArrayList<OsmPrimitive>(getNearestNodes(p, predicate));
     1387                nearestList = new ArrayList<>(getNearestNodes(p, predicate));
    13171388            } else if (osm instanceof Way) {
    1318                 nearestList = new ArrayList<OsmPrimitive>(getNearestWays(p, predicate));
     1389                nearestList = new ArrayList<>(getNearestWays(p, predicate));
    13191390            }
    13201391            if (ignore != null) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    r11366 r11367  
    9898import org.xml.sax.SAXException;
    9999
     100/**
     101 * Editor for JOSM extensions source entries.
     102 * @since 1743
     103 */
    100104public abstract class SourceEditor extends JPanel {
    101105
     
    717721    }
    718722
     723    /**
     724     * Source entry with additional metadata.
     725     */
    719726    public static class ExtendedSourceEntry extends SourceEntry implements Comparable<ExtendedSourceEntry> {
    720727        /** file name used for display */
     
    16421649    }
    16431650
     1651    /**
     1652     * Helper class for specialized extensions preferences.
     1653     */
    16441654    public abstract static class SourcePrefHelper {
    16451655
     
    16821692            Collection<Map<String, String>> src = Main.pref.getListOfStructs(pref, (Collection<Map<String, String>>) null);
    16831693            if (src == null)
    1684                 return new ArrayList<SourceEntry>(getDefault());
     1694                return new ArrayList<>(getDefault());
    16851695
    16861696            List<SourceEntry> entries = new ArrayList<>();
Note: See TracChangeset for help on using the changeset viewer.