Changeset 31280 in osm


Ignore:
Timestamp:
2015-06-18T19:28:21+02:00 (9 years ago)
Author:
nokutu
Message:

Solved graphic bug with toggledialogs and another one with HistoryRecord

Location:
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java

    r31279 r31280  
    77import org.openstreetmap.josm.plugins.mapillary.cache.MapillaryCache;
    88import org.openstreetmap.josm.plugins.mapillary.downloads.MapillaryDownloader;
    9 import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryHistoryDialog;
    109import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryToggleDialog;
    1110import org.openstreetmap.josm.Main;
     
    6766    public List<Bounds> bounds;
    6867
    69     private MapillaryToggleDialog mtd;
    70     private MapillaryHistoryDialog mhd;
    7168
    7269    private MouseAdapter mouseAdapter;
     
    10198            MapView.addLayerChangeListener(this);
    10299            Main.map.mapView.getEditLayer().data.addDataSetListener(this);
    103             if (mtd == null) {
    104                 if (MapillaryToggleDialog.INSTANCE == null) {
    105                     mtd = MapillaryToggleDialog.getInstance();
    106                     Main.map.addToggleDialog(mtd, false);
    107                 } else
    108                     mtd = MapillaryToggleDialog.getInstance();
    109             }
    110             if (mhd == null) {
    111                 if (MapillaryHistoryDialog.INSTANCE == null) {
    112                     mhd = MapillaryHistoryDialog.getInstance();
    113                     Main.map.addToggleDialog(mhd, false);
    114                 } else
    115                     mhd = MapillaryHistoryDialog.getInstance();
    116             }
    117100        }
    118101        MapillaryPlugin.setMenuEnabled(MapillaryPlugin.EXPORT_MENU, true);
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java

    r31278 r31280  
    1818import org.openstreetmap.josm.plugins.Plugin;
    1919import org.openstreetmap.josm.plugins.PluginInformation;
     20import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryHistoryDialog;
    2021import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryPreferenceSetting;
    2122import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryToggleDialog;
     
    104105    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
    105106        if (oldFrame == null && newFrame != null) { // map frame added
     107            Main.map.addToggleDialog(MapillaryToggleDialog.getInstance(), false);
     108            Main.map.addToggleDialog(MapillaryHistoryDialog.getInstance(), false);
    106109        }
    107110        if (oldFrame != null && newFrame == null) { // map frame destroyed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecord.java

    r31278 r31280  
    22
    33import java.util.ArrayList;
     4
     5import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
    46
    57/**
     
    4547    public void addCommand(MapillaryCommand command) {
    4648        // Checks if it is a continuation of last command
    47         if (position != -1
    48                 && commandList.get(position).images.equals(command.images)
    49                 && commandList.get(position).getClass() == command.getClass()) {
    50             commandList.get(position).sum(command);
    51             fireRecordChanged();
    52             return;
     49        if (position != -1) {
     50            boolean equalSets = true;
     51            for (MapillaryAbstractImage img : commandList.get(position).images)
     52                if (!command.images.contains(img))
     53                    equalSets = false;
     54            if (equalSets
     55                    && commandList.get(position).getClass() == command
     56                            .getClass()) {
     57                commandList.get(position).sum(command);
     58                fireRecordChanged();
     59                return;
     60            }
    5361        }
     62        // Adds the command to the las position of the list.
    5463        commandList.add(position + 1, command);
    5564        position++;
Note: See TracChangeset for help on using the changeset viewer.