Ignore:
Timestamp:
2013-03-22T22:18:26+01:00 (12 years ago)
Author:
zverik
Message:

ImageryID refactoring and javadocs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagery_offset_db/src/iodb/CalibrationLayer.java

    r29377 r29384  
    2020 * A layer that displays calibration geometry for an offset.
    2121 *
    22  * @author zverik
     22 * @author Zverik
     23 * @license WTFPL
    2324 */
    2425public class CalibrationLayer extends Layer {
     
    3435    }
    3536
     37    /**
     38     * Draw the calibration geometry with thin bright lines (or a crosshair
     39     * in case of a point).
     40     */
    3641    @Override
    3742    public void paint( Graphics2D g, MapView mv, Bounds box ) {
     
    7984    }
    8085
     86    /**
     87     * This is for determining a bounding box for the layer.
     88     */
    8189    @Override
    8290    public void visitBoundingBox( BoundingXYVisitor v ) {
     
    8593    }
    8694
     95    /**
     96     * A simple tooltip with geometry type, status and author.
     97     */
    8798    @Override
    8899    public String getToolTipText() {
    89         return "A " + (obj.isDeprecated() ? "deprecated " : "") + "calibration " + OffsetInfoAction.getGeometryType(obj)
    90                 + " by " + obj.getAuthor();
     100        return "A " + (obj.isDeprecated() ? "deprecated " : "") + "calibration "
     101                + OffsetInfoAction.getGeometryType(obj) + " by " + obj.getAuthor();
    91102    }
    92103
     
    96107    }
    97108
     109    /**
     110     * This method returns standard actions plus "zoom to layer" and "change color".
     111     */
    98112    @Override
    99113    public Action[] getMenuEntries() {
     
    111125    }
    112126
     127    /**
     128     * This method pans to the geometry, preserving zoom. It is used
     129     * from {@link GetImageryOffsetAction}, because {@link AutoScaleAction}
     130     * doesn't have a relevant method.
     131     */
    113132    public void panToCenter() {
    114133        if( center == null ) {
     
    125144    }
    126145
     146    /**
     147     * An action to change a color of a geometry. The color
     148     * is specified in the constuctor. See {@link #getMenuEntries()} for
     149     * the list of enabled colors.
     150     */
    127151    class SelectColorAction extends AbstractAction {
    128152        private Color c;
     
    140164    }
    141165
     166    /**
     167     * A simple icon with a colored rectangle.
     168     */
    142169    class SingleColorIcon implements Icon {
    143170        private Color color;
     
    162189    }
    163190
     191    /**
     192     * An action that calls {@link AutoScaleAction} which in turn
     193     * uses {@link #visitBoundingBox} to pan and zoom to the calibration geometry.
     194     */
    164195    class ZoomToLayerAction extends AbstractAction {
    165196        public ZoomToLayerAction() {
    166197            super(tr("Zoom to layer"));
     198            putValue(SMALL_ICON, ImageProvider.get("dialogs/autoscale/layer"));
    167199        }
    168200
Note: See TracChangeset for help on using the changeset viewer.