Ignore:
Timestamp:
2018-04-27T00:21:35+02:00 (7 years ago)
Author:
donvip
Message:

javadoc

Location:
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java

    r33822 r34170  
    4949    JosmAction newLayerFromFileAction = new NewLayerFromFileAction();
    5050    JosmAction newLayerFromClipboardAction = new NewLayerFromClipboardAction();
     51
    5152    /**
    52      * Constructor...
     53     * Constructor.
     54     * @param info plugin info
    5355     */
    5456    public PicLayerPlugin(PluginInformation info) {
     
    7375        if (newFrame != null) {
    7476            // Create plugin map modes
    75             MovePictureAction movePictureAction = new MovePictureAction(newFrame);
    76             MovePointAction movePointAction = new MovePointAction(newFrame);
    77             TransformPointAction transformPointAction = new TransformPointAction(newFrame);
    78             RemovePointAction removePointAction = new RemovePointAction(newFrame);
     77            MovePictureAction movePictureAction = new MovePictureAction();
     78            MovePointAction movePointAction = new MovePointAction();
     79            TransformPointAction transformPointAction = new TransformPointAction();
     80            RemovePointAction removePointAction = new RemovePointAction();
    7981
    80             RotatePictureAction rotatePictureAction = new RotatePictureAction(newFrame);
    81             ScaleXYPictureAction scaleXYPictureAction = new ScaleXYPictureAction(newFrame);
    82             ScaleXPictureAction scaleXPictureAction = new ScaleXPictureAction(newFrame);
    83             ScaleYPictureAction scaleYPictureAction = new ScaleYPictureAction(newFrame);
    84             ShearPictureAction shearPictureAction = new ShearPictureAction(newFrame);
     82            RotatePictureAction rotatePictureAction = new RotatePictureAction();
     83            ScaleXYPictureAction scaleXYPictureAction = new ScaleXYPictureAction();
     84            ScaleXPictureAction scaleXPictureAction = new ScaleXPictureAction();
     85            ScaleYPictureAction scaleYPictureAction = new ScaleYPictureAction();
     86            ShearPictureAction shearPictureAction = new ShearPictureAction();
    8587            // Create plugin buttons and add them to the toolbar
    8688
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/GenericPicTransformAction.java

    r33822 r34170  
    1818import org.openstreetmap.josm.tools.Shortcut;
    1919
    20 @SuppressWarnings("serial")
     20/**
     21 * Superclass of transformation actions.
     22 */
    2123public abstract class GenericPicTransformAction extends MapMode implements MouseListener, MouseMotionListener {
    2224
     
    3537    }
    3638
    37     public GenericPicTransformAction(String name, String actionName, String iconName,
    38             String tooltip, MapFrame mapFrame, Cursor cursor) {
     39    public GenericPicTransformAction(String name, String actionName, String iconName, String tooltip, Cursor cursor) {
    3940        super(name, iconName, tooltip, cursor);
    4041        this.actionName = actionName;
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/LoadPictureCalibrationAction.java

    r33822 r34170  
    2020 *
    2121 */
    22 @SuppressWarnings("serial")
    2322public class LoadPictureCalibrationAction extends JosmAction {
    2423
     
    3130    /**
    3231     * Constructor
     32     * @param owner Owner layer of the action
    3333     */
    3434    public LoadPictureCalibrationAction(PicLayerAbstract owner) {
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/LoadPictureCalibrationFromWorldAction.java

    r33822 r34170  
    1414import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerAbstract;
    1515
    16 @SuppressWarnings("serial")
     16/**
     17 * Action to import World File Calibration.
     18 */
    1719public class LoadPictureCalibrationFromWorldAction extends JosmAction {
    1820
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/ResetCalibrationAction.java

    r33822 r34170  
    1111import org.openstreetmap.josm.plugins.piclayer.transform.PictureTransform;
    1212
    13 @SuppressWarnings("serial")
     13/**
     14 * Action to reset Calibration.
     15 */
    1416public class ResetCalibrationAction extends JosmAction {
    1517
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/SavePictureCalibrationAction.java

    r33822 r34170  
    2222 * TODO Four almost identical classes. Refactoring needed.
    2323 */
    24 @SuppressWarnings("serial")
    2524public class SavePictureCalibrationAction extends JosmAction {
    2625
     
    3029    /**
    3130     * Constructor
     31     * @param owner Owner layer of the action
    3232     */
    3333    public SavePictureCalibrationAction(PicLayerAbstract owner) {
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/SavePictureCalibrationToWorldAction.java

    r33144 r34170  
    1717import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerAbstract;
    1818
     19/**
     20 * Action to export World file Calibration.
     21 */
    1922public class SavePictureCalibrationToWorldAction extends JosmAction {
    2023
     
    5558            }
    5659        }
    57        
     60
    5861        // Save dialog
    5962        final JFileChooser fc = new JFileChooser();
     
    7376                for (int i = 0; i < 6; i++) {
    7477                    bw.write(Double.toString(values[i]));
    75                     if (i<5) {
     78                    if (i < 5) {
    7679                        bw.newLine();
    7780                    }
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/newlayer/NewLayerFromClipboardAction.java

    r33822 r34170  
    1717 * the content of the clipboard.
    1818 */
    19 @SuppressWarnings("serial")
    2019public class NewLayerFromClipboardAction extends JosmAction {
    2120
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/newlayer/NewLayerFromFileAction.java

    r33822 r34170  
    2929 * Action responsible for creation of new layers based on image files.
    3030 */
    31 @SuppressWarnings("serial")
    3231public class NewLayerFromFileAction extends JosmAction {
    3332
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/MovePictureAction.java

    r33822 r34170  
    88import org.openstreetmap.josm.data.coor.EastNorth;
    99import org.openstreetmap.josm.gui.MainApplication;
    10 import org.openstreetmap.josm.gui.MapFrame;
    1110import org.openstreetmap.josm.plugins.piclayer.actions.GenericPicTransformAction;
    1211import org.openstreetmap.josm.tools.ImageProvider;
     
    1514 * This class handles the input during moving the picture.
    1615 */
    17 @SuppressWarnings("serial")
    1816public class MovePictureAction extends GenericPicTransformAction {
    1917
     
    2119     * Constructor
    2220     */
    23     public MovePictureAction(MapFrame frame) {
     21    public MovePictureAction() {
    2422        super(tr("PicLayer move"), tr("Moved"), "move", tr("Drag to move the picture"),
    25                 frame, ImageProvider.getCursor("crosshair", null));
     23                ImageProvider.getCursor("crosshair", null));
    2624    }
    2725
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/RotatePictureAction.java

    r33822 r34170  
    99
    1010import org.openstreetmap.josm.gui.MainApplication;
    11 import org.openstreetmap.josm.gui.MapFrame;
    1211import org.openstreetmap.josm.plugins.piclayer.actions.GenericPicTransformAction;
    1312import org.openstreetmap.josm.tools.ImageProvider;
     
    1615 * This class handles the input during rotating the picture.
    1716 */
    18 @SuppressWarnings("serial")
    1917public class RotatePictureAction extends GenericPicTransformAction {
    2018
     
    2220     * Constructor
    2321     */
    24     public RotatePictureAction(MapFrame frame) {
     22    public RotatePictureAction() {
    2523        super(tr("PicLayer rotate"), tr("Rotated"), "rotate", tr("Drag to rotate the picture"),
    26                 frame, ImageProvider.getCursor("crosshair", null));
     24                ImageProvider.getCursor("crosshair", null));
    2725    }
    2826
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/ScaleXPictureAction.java

    r33822 r34170  
    77
    88import org.openstreetmap.josm.gui.MainApplication;
    9 import org.openstreetmap.josm.gui.MapFrame;
    109import org.openstreetmap.josm.plugins.piclayer.actions.GenericPicTransformAction;
    1110import org.openstreetmap.josm.tools.ImageProvider;
     
    1413 * This class handles the input during scaling the picture.
    1514 */
    16 @SuppressWarnings("serial")
    1715public class ScaleXPictureAction extends GenericPicTransformAction {
    1816
     
    2018     * Constructor
    2119     */
    22     public ScaleXPictureAction(MapFrame frame) {
     20    public ScaleXPictureAction() {
    2321        super(tr("PicLayer scale X"), tr("Scaled by X"), "scale_x", tr("Drag to scale the picture in the X Axis"),
    24                 frame, ImageProvider.getCursor("crosshair", null));
     22                ImageProvider.getCursor("crosshair", null));
    2523    }
    2624
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/ScaleXYPictureAction.java

    r33822 r34170  
    99
    1010import org.openstreetmap.josm.gui.MainApplication;
    11 import org.openstreetmap.josm.gui.MapFrame;
    1211import org.openstreetmap.josm.plugins.piclayer.actions.GenericPicTransformAction;
    1312import org.openstreetmap.josm.tools.ImageProvider;
     
    1615 * This class handles the input during scaling the picture.
    1716 */
    18 @SuppressWarnings("serial")
    1917public class ScaleXYPictureAction extends GenericPicTransformAction {
    2018
     
    2220     * Constructor
    2321     */
    24     public ScaleXYPictureAction(MapFrame frame) {
     22    public ScaleXYPictureAction() {
    2523        super(tr("PicLayer scale"), tr("Scaled"), "scale", tr("Drag to scale the picture in the X and Y Axis"),
    26                 frame, ImageProvider.getCursor("crosshair", null));
     24                ImageProvider.getCursor("crosshair", null));
    2725    }
    2826
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/ScaleYPictureAction.java

    r33822 r34170  
    77
    88import org.openstreetmap.josm.gui.MainApplication;
    9 import org.openstreetmap.josm.gui.MapFrame;
    109import org.openstreetmap.josm.plugins.piclayer.actions.GenericPicTransformAction;
    1110import org.openstreetmap.josm.tools.ImageProvider;
     
    1413 * This class handles the input during scaling the picture.
    1514 */
    16 @SuppressWarnings("serial")
    1715public class ScaleYPictureAction extends GenericPicTransformAction {
    1816
     
    2018     * Constructor
    2119     */
    22     public ScaleYPictureAction(MapFrame frame) {
     20    public ScaleYPictureAction() {
    2321        super(tr("PicLayer scale Y"), tr("Scaled by Y"), "scale_y", tr("Drag to scale the picture in the Y Axis"),
    24                 frame, ImageProvider.getCursor("crosshair", null));
     22                ImageProvider.getCursor("crosshair", null));
    2523    }
    2624
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/ShearPictureAction.java

    r33822 r34170  
    88import org.openstreetmap.josm.data.coor.EastNorth;
    99import org.openstreetmap.josm.gui.MainApplication;
    10 import org.openstreetmap.josm.gui.MapFrame;
    1110import org.openstreetmap.josm.plugins.piclayer.actions.GenericPicTransformAction;
    1211import org.openstreetmap.josm.tools.ImageProvider;
     
    1514 * This class handles the input during shearing of the picture.
    1615 */
    17 @SuppressWarnings("serial")
    1816public class ShearPictureAction extends GenericPicTransformAction {
    1917
     
    2119     * Constructor
    2220     */
    23     public ShearPictureAction(MapFrame frame) {
    24         super(tr("PicLayer shear"), tr("Sheared"), "shear", tr("Drag to shear the picture"), frame, ImageProvider.getCursor("crosshair", null));
     21    public ShearPictureAction() {
     22        super(tr("PicLayer shear"), tr("Sheared"), "shear", tr("Drag to shear the picture"), ImageProvider.getCursor("crosshair", null));
    2523    }
    2624
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/affine/MovePointAction.java

    r33822 r34170  
    88import java.awt.geom.Point2D;
    99
    10 import org.openstreetmap.josm.gui.MapFrame;
    1110import org.openstreetmap.josm.plugins.piclayer.actions.GenericPicTransformAction;
    1211import org.openstreetmap.josm.tools.ImageProvider;
    1312
    14 // old version - ctrl move point (not transforming picture)
    15 @SuppressWarnings("serial")
     13/**
     14 * old version - ctrl move point (not transforming picture)
     15 */
    1616public class MovePointAction extends GenericPicTransformAction {
    1717
    18     public MovePointAction(MapFrame frame) {
     18    public MovePointAction() {
    1919        super(tr("PicLayer Move point"), tr("Point added/moved"), "movepoint", tr("Drag or create point on the picture"),
    20                 frame, ImageProvider.getCursor("crosshair", null));
     20                ImageProvider.getCursor("crosshair", null));
    2121    }
    2222
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/affine/RemovePointAction.java

    r33822 r34170  
    66import java.awt.event.MouseEvent;
    77
    8 import org.openstreetmap.josm.gui.MapFrame;
    98import org.openstreetmap.josm.plugins.piclayer.actions.GenericPicTransformAction;
    109import org.openstreetmap.josm.tools.ImageProvider;
    1110
    12 @SuppressWarnings("serial")
     11/**
     12 * Remove point on the picture
     13 */
    1314public class RemovePointAction extends GenericPicTransformAction {
    1415
    15     public RemovePointAction(MapFrame frame) {
     16    public RemovePointAction() {
    1617        super(tr("PicLayer Remove point"), tr("Point removed"), "removepoint", tr("Remove point on the picture"),
    17                 frame, ImageProvider.getCursor("crosshair", null));
     18                ImageProvider.getCursor("crosshair", null));
    1819    }
    1920
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/affine/TransformPointAction.java

    r33822 r34170  
    88import java.awt.geom.Point2D;
    99
    10 import org.openstreetmap.josm.gui.MapFrame;
    1110import org.openstreetmap.josm.plugins.piclayer.actions.GenericPicTransformAction;
    1211import org.openstreetmap.josm.tools.ImageProvider;
    1312
    14 @SuppressWarnings("serial")
     13/**
     14 * Transform point on the picture
     15 */
    1516public class TransformPointAction extends GenericPicTransformAction {
    1617
    17     public TransformPointAction(MapFrame frame) {
     18    public TransformPointAction() {
    1819        super(tr("PicLayer Transform point"), tr("Point transformed"), "transformpoint", tr("Transform point on the picture"),
    19                 frame, ImageProvider.getCursor("crosshair", null));
     20                ImageProvider.getCursor("crosshair", null));
    2021    }
    2122
     
    2627            if (selectedPoint != null) {
    2728                /*if (currentLayer.getTransformer().getOriginPoints().size() < 3)
    28                     JOptionPane.showMessageDialog(null, tr("You should have 3 checkpoints to transform the image!"), tr("PicLayer"), JOptionPane.ERROR_MESSAGE, null);
     29                    JOptionPane.showMessageDialog(null,
     30                    tr("You should have 3 checkpoints to transform the image!"), tr("PicLayer"), JOptionPane.ERROR_MESSAGE, null);
    2931                else*/
    3032                //{
    31                     currentLayer.getTransformer().updatePair(selectedPoint, pressed);
     33                currentLayer.getTransformer().updatePair(selectedPoint, pressed);
    3234                //}
    3335            }
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java

    r34169 r34170  
    5959
    6060    // Initial position of the image in the real world
    61 //    protected EastNorth initialImagePosition;
     61    // protected EastNorth initialImagePosition;
    6262
    6363    // Position of the image in the real world
     
    133133     * Initializes the image. Gets the image from a subclass and stores some
    134134     * initial parameters. Throws exception if something fails.
     135     * @throws IOException in case of error
    135136     */
    136137    public void initialize() throws IOException {
     
    169170     *
    170171     * TODO: Replace the IOException by our own exception.
     172     * @return created image
     173     * @throws IOException in case of error
    171174     */
    172175    protected abstract Image createImage() throws IOException;
     
    176179    /**
    177180     * To be overridden by subclasses. Returns the user readable name of the layer.
     181     * @return the user readable name of the layer
    178182     */
    179183    public abstract String getPicLayerName();
     
    294298
    295299    /**
    296      * Returns the distance in meter, that corresponds to one unit in east north
    297      * space. For normal projections, it is about 1 (but usually changing with
    298      * latitude).
    299      * For EPSG:4326, it is the distance from one meridian of full degree to the
    300      * next (a couple of kilometers).
     300     * Returns the distance in meter, that corresponds to one unit in east north space.
     301     * For normal projections, it is about 1 (but usually changing with latitude).
     302     * For EPSG:4326, it is the distance from one meridian of full degree to the next (a couple of kilometers).
     303     * @param en east/north
     304     * @return the distance in meter, that corresponds to one unit in east north space
    301305     */
    302306    protected double getMetersPerEasting(EastNorth en) {
     
    398402    /**
    399403     * Loads calibration data from file
    400      * @param file The file to read from
     404     * @param is The input stream to read from
     405     * @throws IOException in case of error
    401406     */
    402407    public void loadCalibration(InputStream is) throws IOException {
     
    550555    /**
    551556     * Moves the picture. Scaled in EastNorth...
     557     * @param x The offset to add in east direction
     558     * @param y The offset to add in north direction
    552559     */
    553560    public void movePictureBy(double x, double y) {
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/transform/PictureTransform.java

    r33822 r34170  
    5555
    5656    /**
    57      * updates pair of points (suppose that other pairs are (origin=>origin) points are the same),
     57     * updates pair of points (suppose that other pairs are (origin=&gt;origin) points are the same),
    5858     * solves equation,
    5959     * applies transform matrix to the existing cachedTransform
Note: See TracChangeset for help on using the changeset viewer.