Ignore:
Timestamp:
2016-01-03T15:03:35+01:00 (9 years ago)
Author:
holgermappt
Message:

Disable center view while a photo is moved, see #josm11908. Updates for javadoc and i18n.

Location:
applications/editors/josm/plugins/photoadjust
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/photoadjust/build.xml

    r30964 r31922  
    55    <property name="commit.message" value="Commit message"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="8029"/>
     7    <property name="plugin.main.version" value="9270"/>
    88
    99    <!-- Configure these properties (replace "..." accordingly).
     
    5151                sourcepath="${plugin.src.dir}"
    5252                windowtitle="${ant.project.name}"
    53                 linksource="true">
    54             <link href="../../../core/javadoc"/>
     53                linksource="true"
     54                private="true">
     55            <classpath>
     56                <pathelement location="${josm}"/>
     57            </classpath>
     58            <!-- Paths are relative to javadoc destdir (${plugin.javadoc.dir}). -->
     59            <link href="../../../core/javadoc/"/>
    5560            <link href="http://josm.openstreetmap.de/doc/"/>
    56             <link href="http://docs.oracle.com/javase/7/docs/api"/>
     61            <link href="http://docs.oracle.com/javase/7/docs/api/"/>
    5762        </javadoc>
    5863    </target>
  • applications/editors/josm/plugins/photoadjust/i18n/build-i18n.xml

    r30884 r31922  
    4444    <target name="lang" description="Prepare *.lang files in data directory.">
    4545        <exec executable="perl">
    46             <arg line="../../i18n/i18n.pl data ${plugin.po.dir}/*.po"/>
     46            <arg line="../../i18n/i18n.pl --potfile=${plugin.po.dir}/${ant.project.name}.pot --basedir=data/ ${plugin.po.dir}/*.po"/>
    4747        </exec>
    4848    </target>
  • applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustPlugin.java

    r30962 r31922  
    3636        super(info);
    3737        GeoImageLayer.registerMenuAddition(new UntaggedGeoImageLayerAction());
     38        //new PhotoPropertyEditor();
    3839        worker = new PhotoAdjustWorker();
    3940        initAdapters();
     
    5152                    layers.add(imageLayer);
    5253                    worker.doMousePressed(evt, layers);
     54                }
     55            }
     56
     57            @Override
     58            public void mouseReleased(MouseEvent evt) {
     59                if (imageLayer != null) {
     60                    worker.doMouseReleased(evt);
    5361                }
    5462            }
  • applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustWorker.java

    r31413 r31922  
    2323    // the photo is moved very far.
    2424    private Point2D dragOffset = null;
     25    private boolean centerViewIsDisabled = false;
     26    private boolean centerViewNeedsEnable = false;
    2527
    2628    /**
     
    3133        dragLayer = null;
    3234        dragOffset = null;
     35    }
     36
     37    /**
     38     * Disable the "center view" button.  The map is moved instead of the
     39     * photo if the center view is enabled while a photo is moved.  The method
     40     * disables the center view to avoid such behavior.  Call
     41     * restoreCenterView() to restore the original state.
     42     */
     43    public void disableCenterView() {
     44        if (!centerViewIsDisabled) {
     45            centerViewIsDisabled = true;
     46            centerViewNeedsEnable = ImageViewerDialog.setCentreEnabled(false);
     47        }
     48    }
     49
     50    /**
     51     * Restore the center view state that was active before
     52     * disableCenterView() was called.
     53     */
     54    public void restoreCenterView() {
     55        if (centerViewIsDisabled) {
     56            if (centerViewNeedsEnable) {
     57                centerViewNeedsEnable = false;
     58                ImageViewerDialog.setCentreEnabled(true);
     59            }
     60            centerViewIsDisabled = false;
     61        }
    3362    }
    3463
     
    94123                            dragLayer = layer;
    95124                            setDragOffset(dragPhoto, evt);
     125                            disableCenterView();
    96126                            break;
    97127                        }
     
    100130            }
    101131        }
     132    }
     133
     134    /**
     135     * Mouse release handler.
     136     *
     137     * @param evt Mouse event from MouseAdapter mouseReleased().
     138     */
     139    public void doMouseReleased(MouseEvent evt) {
     140        restoreCenterView();
    102141    }
    103142
     
    114153            }
    115154            else {
     155                disableCenterView();
    116156                movePhoto(dragPhoto, dragLayer, evt);
    117157            }
Note: See TracChangeset for help on using the changeset viewer.