Ignore:
Timestamp:
2017-11-17T21:21:04+01:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 12643

Location:
applications/editors/josm/plugins/indoor_sweepline
Files:
7 edited

Legend:

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

    r32680 r33828  
    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="10580"/>
     7    <property name="plugin.main.version" value="12643"/>
    88
    99    <property name="plugin.author" value="Roland M. Olbricht"/>
  • applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/Beam.java

    r32601 r33828  
    152152    }
    153153
    154     private class StripPosition {
     154    private static class StripPosition {
    155155        StripPosition(int nodeIndex, double offset) {
    156156            this.nodeIndex = nodeIndex;
  • applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweepline.java

    r32601 r33828  
    55import javax.swing.JMenuItem;
    66
    7 import org.openstreetmap.josm.Main;
     7import org.openstreetmap.josm.gui.MainApplication;
    88import org.openstreetmap.josm.plugins.Plugin;
    99import org.openstreetmap.josm.plugins.PluginInformation;
     
    2121
    2222    public static void refreshMenu() {
    23         JMenu menu = Main.main.menu.moreToolsMenu;
     23        JMenu menu = MainApplication.getMenu().moreToolsMenu;
    2424        if (menu.isVisible())
    2525            menu.addSeparator();
  • applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineController.java

    r32601 r33828  
    66import javax.swing.DefaultComboBoxModel;
    77
    8 import org.openstreetmap.josm.Main;
    98import org.openstreetmap.josm.data.coor.LatLon;
     9import org.openstreetmap.josm.gui.MainApplication;
    1010import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
    1111import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener;
     
    1717
    1818    public IndoorSweeplineController(OsmDataLayer activeLayer, LatLon center) {
    19         Main.getLayerManager().addLayerChangeListener(this);
     19        MainApplication.getLayerManager().addLayerChangeListener(this);
    2020        layer = activeLayer;
    2121        model = new IndoorSweeplineModel(activeLayer, center);
  • applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineModel.java

    r32601 r33828  
    33
    44import java.util.List;
     5import java.util.Objects;
    56import java.util.Vector;
    67
    78import javax.swing.DefaultComboBoxModel;
    89
    9 import org.openstreetmap.josm.Main;
    1010import org.openstreetmap.josm.data.coor.LatLon;
     11import org.openstreetmap.josm.gui.MainApplication;
    1112import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1213
     
    197198    private void updateOsmModel() {
    198199        distributeWays();
    199         Main.map.mapView.repaint();
    200     }
    201 
    202     public class SweepPolygonCursor {
     200        MainApplication.getMap().mapView.repaint();
     201    }
     202
     203    public static class SweepPolygonCursor {
     204        public int stripIndex;
     205        public int partIndex;
     206
    203207        public SweepPolygonCursor(int stripIndex, int partIndex) {
    204208            this.stripIndex = stripIndex;
     
    206210        }
    207211
    208         public boolean equals(SweepPolygonCursor rhs) {
    209             return rhs != null
    210                     && stripIndex == rhs.stripIndex && partIndex == rhs.partIndex;
    211         }
    212 
    213         public int stripIndex;
    214         public int partIndex;
     212        @Override
     213        public int hashCode() {
     214            return Objects.hash(stripIndex, partIndex);
     215        }
     216
     217        @Override
     218        public boolean equals(Object obj) {
     219            if (this == obj)
     220                return true;
     221            if (obj == null || getClass() != obj.getClass())
     222                return false;
     223            SweepPolygonCursor other = (SweepPolygonCursor) obj;
     224            return Objects.equals(partIndex, other.partIndex)
     225                    && Objects.equals(stripIndex, other.stripIndex);
     226        }
    215227    }
    216228
     
    228240        }
    229241
    230         Boolean truePtr = new Boolean(true);
     242        Boolean truePtr = Boolean.TRUE;
    231243        for (int i = 0; i < stripRefs.size(); ++i) {
    232244            Vector<Boolean> refs = stripRefs.elementAt(i);
  • applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineWizardAction.java

    r32601 r33828  
    1010import org.openstreetmap.josm.Main;
    1111import org.openstreetmap.josm.actions.JosmAction;
    12 import org.openstreetmap.josm.data.projection.Projections;
     12import org.openstreetmap.josm.gui.MainApplication;
    1313import org.openstreetmap.josm.gui.layer.Layer;
    1414import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
     
    2525        super(tr("Concourse wizard ..."), null,
    2626                tr("Opens up a wizard to create a concourse"), null, false);
    27         Main.getLayerManager().addLayerChangeListener(this);
     27        MainApplication.getLayerManager().addLayerChangeListener(this);
    2828    }
    2929
     
    3636            JOptionPane.showMessageDialog(JOptionPane.getFrameForComponent(Main.parent),
    3737                    "The default layer is not an OSM layer.");
    38         else if (Main.map == null)
     38        else if (MainApplication.getMap() == null)
    3939            JOptionPane.showMessageDialog(JOptionPane.getFrameForComponent(Main.parent),
    4040                    "No map found.");
    41         else if (Main.map.mapView == null)
     41        else if (MainApplication.getMap().mapView == null)
    4242            JOptionPane.showMessageDialog(JOptionPane.getFrameForComponent(Main.parent),
    4343                    "No map view found.");
    4444        else
    4545            new IndoorSweeplineController((OsmDataLayer) layer,
    46                     Projections.inverseProject(Main.map.mapView.getCenter()));
     46                    Main.getProjection().eastNorth2latlon(MainApplication.getMap().mapView.getCenter()));
    4747    }
    4848
    4949    @Override
    5050    public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
    51         layer = Main.getLayerManager().getActiveLayer();
     51        layer = MainApplication.getLayerManager().getActiveLayer();
    5252    }
    5353
  • applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineWizardDialog.java

    r32601 r33828  
    3333
    3434import org.openstreetmap.josm.Main;
     35import org.openstreetmap.josm.tools.Logging;
    3536
    3637public class IndoorSweeplineWizardDialog extends JDialog {
     
    9091            }
    9192        } catch (IllegalStateException ex) {
    92             Main.trace(ex);
     93            Logging.trace(ex);
    9394        }
    9495
     
    9697            level.setText(controller.getLevel());
    9798        } catch (IllegalStateException ex) {
    98             Main.trace(ex);
     99            Logging.trace(ex);
    99100        }
    100101
     
    369370                    controller.setStripWidth(beamIndex, Double.parseDouble(stripWidth.getText()));
    370371            } catch (NumberFormatException ex) {
    371                 Main.trace(ex);
     372                Logging.trace(ex);
    372373            }
    373374
     
    410411    }
    411412
    412     private class StructureTableModel extends DefaultTableModel {
     413    private static class StructureTableModel extends DefaultTableModel {
    413414        @Override
    414415        public boolean isCellEditable(int row, int column) {
     
    473474                                Double.parseDouble(((TableModel) e.getSource()).getValueAt(row, column).toString()));
    474475                } catch (NumberFormatException ex) {
    475                     Main.trace(ex);
     476                    Logging.trace(ex);
    476477                }
    477478            } else if (column == 1 && beamIndex % 2 == 0) {
     
    492493    }
    493494
    494     private class GridbagPanel extends JPanel {
     495    private static class GridbagPanel extends JPanel {
    495496        GridbagPanel() {
    496497            gridbag = new GridBagLayout();
Note: See TracChangeset for help on using the changeset viewer.