Changeset 34562 in osm for applications/editors


Ignore:
Timestamp:
2018-08-18T20:27:59+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 14153

Location:
applications/editors/josm/plugins/terracer
Files:
5 edited

Legend:

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

    r33608 r34562  
    22<project name="terracer" default="dist" basedir=".">
    33    <property name="commit.message" value="applied #j5760 (patch by robome) - Order of housenumbers not correct"/>
    4     <property name="plugin.main.version" value="12859"/>
     4    <property name="plugin.main.version" value="14153"/>
    55    <property name="plugin.author" value="Matt Amos"/>
    66    <property name="plugin.class" value="terracer.TerracerPlugin"/>
  • applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java

    r33839 r34562  
    1313import java.util.ArrayList;
    1414import java.util.Iterator;
    15 import java.util.List;
    1615import java.util.TreeSet;
    1716
     
    2322import javax.swing.JTextField;
    2423
    25 import org.openstreetmap.josm.Main;
    2624import org.openstreetmap.josm.data.osm.Node;
     25import org.openstreetmap.josm.data.osm.OsmDataManager;
    2726import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2827import org.openstreetmap.josm.data.osm.Way;
    29 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem;
    30 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionSet;
    3128import org.openstreetmap.josm.gui.ExtendedDialog;
    3229import org.openstreetmap.josm.gui.MainApplication;
     
    3431import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
    3532import org.openstreetmap.josm.gui.util.WindowGeometry;
     33import org.openstreetmap.josm.spi.preferences.Config;
    3634import org.openstreetmap.josm.tools.GBC;
    3735
     
    9694    public HouseNumberInputDialog(HouseNumberInputHandler handler, Way street, String streetName,
    9795            String buildingType, boolean relationExists, ArrayList<Node> housenumbers) {
    98         super(Main.parent,
     96        super(MainApplication.getMainFrame(),
    9997                tr("Terrace a house"),
    10098                new String[] {tr("OK"), tr("Cancel")},
     
    117115        getRootPane().setDefaultButton(defaultButton);
    118116        pack();
    119         setRememberWindowGeometry(getClass().getName() + ".geometry", WindowGeometry.centerInWindow(Main.parent, getPreferredSize()));
     117        setRememberWindowGeometry(getClass().getName() + ".geometry", WindowGeometry.centerInWindow(MainApplication.getMainFrame(), getPreferredSize()));
    120118        lo.requestFocusInWindow();
    121119    }
     
    179177            final String txt = relationExists ? tr("add to existing associatedStreet relation") : tr("create an associatedStreet relation");
    180178
    181             handleRelationCheckBox = new JCheckBox(txt, relationExists ? Main.pref.getBoolean(HANDLE_RELATION, true) : false);
    182             keepOutlineCheckBox = new JCheckBox(tr("keep outline way"), Main.pref.getBoolean(KEEP_OUTLINE, false));
     179            handleRelationCheckBox = new JCheckBox(txt, relationExists ? Config.getPref().getBoolean(HANDLE_RELATION, true) : false);
     180            keepOutlineCheckBox = new JCheckBox(tr("keep outline way"), Config.getPref().getBoolean(KEEP_OUTLINE, false));
    183181
    184182            inputPanel = new JPanel();
     
    314312        if (buildingComboBox == null) {
    315313            buildingComboBox = new AutoCompletingComboBox();
    316             buildingComboBox.setPossibleAcItems(AutoCompletionManager.of(Main.main.getEditDataSet()).getTagValues("building"));
     314            buildingComboBox.setPossibleAcItems(AutoCompletionManager.of(OsmDataManager.getInstance().getEditDataSet()).getTagValues("building"));
    317315            buildingComboBox.setEditable(true);
    318316            if (buildingType != null && !buildingType.isEmpty()) {
     
    333331        if (segments == null) {
    334332            segments = new JTextField();
    335             segments.setText(Main.pref.get(DEFAULT_SEGMENTS, "2"));
     333            segments.setText(Config.getPref().get(DEFAULT_SEGMENTS, "2"));
    336334        }
    337335        return segments;
     
    348346            interpolation.add(tr("All"));
    349347            interpolation.add(tr("Even/Odd"));
    350             if (Main.pref.getInt(INTERPOLATION, 2) == 1) {
     348            if (Config.getPref().getInt(INTERPOLATION, 2) == 1) {
    351349                interpolation.select(tr("All"));
    352350            } else {
  • applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java

    r33839 r34562  
    1919import javax.swing.JTextField;
    2020
    21 import org.openstreetmap.josm.Main;
    2221import org.openstreetmap.josm.actions.JosmAction;
    2322import org.openstreetmap.josm.data.osm.Node;
     
    2625import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem;
    2726import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox;
     27import org.openstreetmap.josm.spi.preferences.Config;
    2828import org.openstreetmap.josm.tools.Logging;
    2929import org.openstreetmap.josm.tools.UserCancelException;
     
    445445     */
    446446    public void saveValues() {
    447         Main.pref.putBoolean(HouseNumberInputDialog.HANDLE_RELATION, doHandleRelation());
    448         Main.pref.putBoolean(HouseNumberInputDialog.KEEP_OUTLINE, doKeepOutline());
    449         Main.pref.put(HouseNumberInputDialog.INTERPOLATION, stepSize().toString());
     447        Config.getPref().putBoolean(HouseNumberInputDialog.HANDLE_RELATION, doHandleRelation());
     448        Config.getPref().putBoolean(HouseNumberInputDialog.KEEP_OUTLINE, doKeepOutline());
     449        Config.getPref().put(HouseNumberInputDialog.INTERPOLATION, stepSize().toString());
    450450    }
    451451}
  • applications/editors/josm/plugins/terracer/src/terracer/ReverseTerraceAction.java

    r33579 r34562  
    1313import javax.swing.JOptionPane;
    1414
    15 import org.openstreetmap.josm.Main;
    1615import org.openstreetmap.josm.actions.JosmAction;
    1716import org.openstreetmap.josm.command.ChangePropertyCommand;
    1817import org.openstreetmap.josm.command.Command;
    1918import org.openstreetmap.josm.command.SequenceCommand;
     19import org.openstreetmap.josm.data.UndoRedoHandler;
    2020import org.openstreetmap.josm.data.osm.Node;
    2121import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    8181
    8282        if (front.isEmpty()) {
    83             JOptionPane.showMessageDialog(Main.parent,
     83            JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
    8484                    tr("Cannot reverse!"));
    8585            return;
     
    124124        }
    125125
    126         MainApplication.undoRedo.add(new SequenceCommand(tr("Reverse Terrace"), commands));
     126        UndoRedoHandler.getInstance().add(new SequenceCommand(tr("Reverse Terrace"), commands));
    127127        MainApplication.getLayerManager().getEditDataSet().setSelected(orderedWays);
    128128    }
  • applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java

    r33608 r34562  
    2424import javax.swing.JOptionPane;
    2525
    26 import org.openstreetmap.josm.Main;
    2726import org.openstreetmap.josm.actions.JosmAction;
    2827import org.openstreetmap.josm.command.AddCommand;
     
    3231import org.openstreetmap.josm.command.DeleteCommand;
    3332import org.openstreetmap.josm.command.SequenceCommand;
     33import org.openstreetmap.josm.data.UndoRedoHandler;
    3434import org.openstreetmap.josm.data.osm.DataSet;
    3535import org.openstreetmap.josm.data.osm.Node;
     
    179179        } catch (InvalidUserInputException ex) {
    180180            Logging.warn("Terracer: "+ex.getMessage());
    181             new ExtendedDialog(Main.parent, tr("Invalid selection"), new String[] {"OK"})
     181            new ExtendedDialog(MainApplication.getMainFrame(), tr("Invalid selection"), new String[] {"OK"})
    182182                .setButtonIcons(new String[] {"ok"}).setIcon(JOptionPane.INFORMATION_MESSAGE)
    183183                .setContent(tr("Select a single, closed way of at least four nodes. " +
     
    425425        }
    426426
    427         MainApplication.undoRedo.add(createTerracingCommand(outline));
     427        UndoRedoHandler.getInstance().add(createTerracingCommand(outline));
    428428        if (nb <= 1 && street != null) {
    429429            // Select the way (for quick selection of a new house (with the same way))
Note: See TracChangeset for help on using the changeset viewer.