Changeset 12114 in josm


Ignore:
Timestamp:
2017-05-11T01:43:38+02:00 (7 years ago)
Author:
michael2402
Message:

Layer class: Documentation.

File:
1 edited

Legend:

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

    r12025 r12114  
    110110    }
    111111
     112    /**
     113     * The visibility property for this layer. May be <code>true</code> (visible) or <code>false</code> (hidden).
     114     */
    112115    public static final String VISIBLE_PROP = Layer.class.getName() + ".visible";
     116    /**
     117     * The opacity of this layer. A number between 0 and 1
     118     */
    113119    public static final String OPACITY_PROP = Layer.class.getName() + ".opacity";
     120    /**
     121     * The name property of the layer.
     122     * You can listen to name changes by listening to changes to this property.
     123     */
    114124    public static final String NAME_PROP = Layer.class.getName() + ".name";
     125    /**
     126     * Property that defines the filter state.
     127     * This is currently not used.
     128     */
    115129    public static final String FILTER_STATE_PROP = Layer.class.getName() + ".filterstate";
    116130
     
    241255    public abstract boolean isMergable(Layer other);
    242256
     257    /**
     258     * Visits the content bounds of this layer. The behavior of this method depends on the layer,
     259     * but each implementation should attempt to cover the relevant content of the layer in this method.
     260     * @param v The visitor that gets notified about the contents of this layer.
     261     */
    243262    public abstract void visitBoundingBox(BoundingXYVisitor v);
    244263
     264    /**
     265     * Gets the layer information to display to the user.
     266     * This is used if the user requests information about this layer.
     267     * It should display a description of the layer content.
     268     * @return Either a String or a {@link Component} describing the layer.
     269     */
    245270    public abstract Object getInfoComponent();
    246271
     
    281306    }
    282307
     308    /**
     309     * Gets the associated file for this layer.
     310     * @return The file or <code>null</code> if it is unset.
     311     * @see #setAssociatedFile(File)
     312     */
    283313    public File getAssociatedFile() {
    284314        return associatedFile;
    285315    }
    286316
     317    /**
     318     * Sets the associated file for this layer.
     319     *
     320     * The associated file might be the one that the user opened.
     321     * @param file The file, may be <code>null</code>
     322     */
    287323    public void setAssociatedFile(File file) {
    288324        associatedFile = file;
     
    503539        private final transient Layer layer;
    504540
     541        /**
     542         * Create a new action that saves the layer
     543         * @param layer The layer to save.
     544         */
    505545        public LayerSaveAction(Layer layer) {
    506546            putValue(SMALL_ICON, ImageProvider.get("save"));
     
    517557    }
    518558
     559    /**
     560     * Action to save the layer in a new file
     561     */
    519562    public static class LayerSaveAsAction extends AbstractAction {
    520563        private final transient Layer layer;
    521564
     565        /**
     566         * Create a new save as action
     567         * @param layer The layer that should be saved.
     568         */
    522569        public LayerSaveAsAction(Layer layer) {
    523570            putValue(SMALL_ICON, ImageProvider.get("save_as"));
     
    534581    }
    535582
     583    /**
     584     * Action that exports the layer as gpx file
     585     */
    536586    public static class LayerGpxExportAction extends AbstractAction {
    537587        private final transient Layer layer;
    538588
     589        /**
     590         * Create a new gpx export action for the given layer.
     591         * @param layer The layer
     592         */
    539593        public LayerGpxExportAction(Layer layer) {
    540594            putValue(SMALL_ICON, ImageProvider.get("exportgpx"));
Note: See TracChangeset for help on using the changeset viewer.