Changeset 35817 in osm for applications/editors/josm


Ignore:
Timestamp:
2021-09-03T03:32:59+02:00 (3 years ago)
Author:
Don-vip
Message:

fix build and some code style warnings

Location:
applications/editors/josm/plugins/pdfimport
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/pdfimport/lib

    • Property svn:ignore set to
      *.jar
  • applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/FilePlacement18.java

    r34660 r35817  
    3030import org.openstreetmap.josm.data.osm.Node;
    3131import org.openstreetmap.josm.data.osm.OsmPrimitive;
    32 import org.openstreetmap.josm.data.projection.Projection;
    3332import org.openstreetmap.josm.gui.MainApplication;
     33import org.openstreetmap.josm.tools.Logging;
    3434
    3535public class FilePlacement18 extends FilePlacement {
     
    8181                });
    8282            }
     83
    8384            public void SetCoor(EastNorth en) {
    8485                x.requestFocusInWindow();        // make shure focus-lost events will be triggered later
     
    8788                y.setValue(en.getY());
    8889            }
     90
    8991            public EastNorth getCorr() {
    90                 return new EastNorth(x.getValue(),y.getValue());
     92                return new EastNorth(x.getValue(), y.getValue());
    9193            }
    9294        }
     
    113115
    114116        public PlacementPanel(FilePlacement18 parrent) {
    115             if (parrent==null) throw new IllegalArgumentException();
    116             fc=parrent;
    117         }
    118 
    119         private PlacementPanel () {
     117            if (parrent == null) throw new IllegalArgumentException();
     118            fc = parrent;
     119        }
     120
     121        private PlacementPanel() {
    120122
    121123        }
     
    123125        private class Monitor implements FocusListener {
    124126
    125             private PlacementPanel target=null;
     127            private PlacementPanel target;
    126128
    127129            public Monitor(PlacementPanel home) {
    128                 target=home;
     130                target = home;
    129131            }
    130132
     
    137139                try {
    138140                    target.Verify();
    139                 } catch (Exception ee) {
     141                } catch (Exception ex) {
     142                    Logging.trace(ex);
    140143                }
    141144            }
     
    245248            cGetButton.fill = GridBagConstraints.NONE;
    246249
    247             GridBagConstraints c = new GridBagConstraints();
    248250            /*
    249251             * Projection
     
    253255             * Max Corner
    254256             */
    255             panel.add(new JLabel(tr("Top right (max) corner:"),SwingConstants.CENTER), cCornerHeading);
    256             c = (GridBagConstraints) cLine.clone();
    257             c.weightx = 0.0; panel.add(new JLabel(tr("X:"),SwingConstants.RIGHT),c);
     257            panel.add(new JLabel(tr("Top right (max) corner:"), SwingConstants.CENTER), cCornerHeading);
     258            GridBagConstraints c = (GridBagConstraints) cLine.clone();
     259            c.weightx = 0.0; panel.add(new JLabel(tr("X:"), SwingConstants.RIGHT), c);
    258260            c.weightx = 1.0; panel.add(maxXField, c);
    259             c.weightx = 0.0; panel.add(new JLabel(tr("East:"),SwingConstants.RIGHT),c);
     261            c.weightx = 0.0; panel.add(new JLabel(tr("East:"), SwingConstants.RIGHT), c);
    260262            c.weightx = 1.0; panel.add(maxEastField, c);
    261263
    262264            c.gridy = 4;
    263             c.weightx = 0.0; panel.add(new JLabel(tr("Y:"),SwingConstants.RIGHT),c);
     265            c.weightx = 0.0; panel.add(new JLabel(tr("Y:"), SwingConstants.RIGHT), c);
    264266            c.weightx = 1.0; panel.add(maxYField, c);
    265             c.weightx = 0.0; panel.add(new JLabel(tr("North:"),SwingConstants.RIGHT),c);
     267            c.weightx = 0.0; panel.add(new JLabel(tr("North:"), SwingConstants.RIGHT), c);
    266268            c.weightx = 1.0; panel.add(maxNorthField, c);
    267269            panel.add(getMaxButton, cGetButton);
     
    269271             * Min Corner
    270272             */
    271             panel.add(new JLabel(tr("Bottom left (min) corner:"),SwingConstants.CENTER), cCornerHeading);
     273            panel.add(new JLabel(tr("Bottom left (min) corner:"), SwingConstants.CENTER), cCornerHeading);
    272274            c = (GridBagConstraints) cLine.clone();
    273             c.weightx = 0.0; panel.add(new JLabel(tr("X:"),SwingConstants.RIGHT),c);
     275            c.weightx = 0.0; panel.add(new JLabel(tr("X:"), SwingConstants.RIGHT), c);
    274276            c.weightx = 1.0; panel.add(minXField, c);
    275             c.weightx = 0.0; panel.add(new JLabel(tr("East:"),SwingConstants.RIGHT),c);
     277            c.weightx = 0.0; panel.add(new JLabel(tr("East:"), SwingConstants.RIGHT), c);
    276278            c.weightx = 1.0; panel.add(minEastField, c);
    277279
    278280            c.gridy = 8;
    279             c.weightx = 0.0; panel.add(new JLabel(tr("Y:"),SwingConstants.RIGHT),c);
     281            c.weightx = 0.0; panel.add(new JLabel(tr("Y:"), SwingConstants.RIGHT), c);
    280282            c.weightx = 1.0; panel.add(minYField, c);
    281             c.weightx = 0.0; panel.add(new JLabel(tr("North:"),SwingConstants.RIGHT),c);
     283            c.weightx = 0.0; panel.add(new JLabel(tr("North:"), SwingConstants.RIGHT), c);
    282284            c.weightx = 1.0; panel.add(minNorthField, c);
    283285
     
    306308
    307309            LatLon ll = ((Node) selected.iterator().next()).getCoor();
    308 //            FilePlacement pl = new FilePlacement();
    309 //            return pl.reverseTransform(ll);
    310310            return new EastNorth(ll.lon() * 1000, ll.lat() * 1000);
    311311        }
     
    352352                f.SetCoor(en);
    353353            }
    354 
    355         }
    356 
    357     }
    358 
    359     private PlacementPanel panel=null;
    360     private boolean valid=false;    // the data is consistent and the object ready to use for transformation
     354        }
     355    }
     356
     357    private PlacementPanel panel;
     358    private boolean valid;    // the data is consistent and the object ready to use for transformation
    361359
    362360    public boolean isValid() {
     
    366364        return valid;
    367365    }
     366
    368367    public void setDependsOnValid(JComponent c) {
    369368        panel.setDependsOnValid(c);
     
    371370
    372371    public JPanel getGui() {
    373         if (panel==null) panel = new PlacementPanel(this);
    374         if (panel.panel==null) panel.build();
     372        if (panel == null) panel = new PlacementPanel(this);
     373        if (panel.panel == null) panel.build();
    375374        return panel.panel;
    376375    }
    377376
    378     public FilePlacement18 () {
     377    public FilePlacement18() {
    379378        panel = new PlacementPanel(this);
    380379    }
     
    383382        File file = new File(baseFile + ".placement");
    384383        Properties p = new Properties();
    385         try (FileInputStream s = new FileInputStream(file)){
     384        try (FileInputStream s = new FileInputStream(file)) {
    386385            p.load(s);
    387386            s.close();
    388         };
     387        }
    389388        fromProperties(p);
    390389    }
     
    402401    }
    403402
    404     private Projection getProjection(Properties p, String name) {
    405         String projectionCode = p.getProperty("Projection", null);
    406         if (projectionCode != null) {
    407             return ProjectionInfo.getProjectionByCode(p.getProperty("Projection", null));
    408         }
    409         return null;
    410     }
    411 
    412     private double getDouble(Properties p, String name, double defaultValue) {
    413         try {
    414             return Double.parseDouble(p.getProperty(name));
    415         } catch (Exception e) {
    416             return defaultValue;
    417         }
    418     }
    419 
    420403    @Override
    421404    protected void fromProperties(Properties p) {
     
    423406        panel.load();
    424407    }
    425 
    426408}
  • applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/GuiProjections.java

    r34796 r35817  
    4545         * Component to choose a Projection
    4646         */
    47         public Chooser() {
     47        Chooser() {
    4848            setEditable(false);
    4949            setToolTipText(tr("Projection of the PDF-Document"));
     
    5555            }
    5656            addActionListener(monitor);
    57             setProjection (ProjectionRegistry.getProjection());
     57            setProjection(ProjectionRegistry.getProjection());
    5858        }
    5959
    60         public void setProjection (Projection p) {
     60        public void setProjection(Projection p) {
    6161            /*
    6262             * set current Projection to @p
    6363             * update internal variables
    6464             */
    65             if (p==null) return;    // better keep the old one
     65            if (p == null) return;    // better keep the old one
    6666            projection = p;
    6767            pName.setText(p.toString());
     
    9696             */
    9797            Logging.debug("New projection encountered");
    98             ProjectionChoice px = new SingleProjectionChoice(p.toString(), localId, projectionCode) ;
     98            ProjectionChoice px = new SingleProjectionChoice(p.toString(), localId, projectionCode);
    9999            addItem(px);
    100100            setSelectedItem(px);
    101101        }
    102102
     103        /**
     104         * monitor user selection and set internal var accordingly
     105         */
    103106        private class Monitor implements ActionListener {
    104             /*
    105              * (non-Javadoc)
    106              * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
    107              *
    108              * monitor user selection and set internal var accordingly
    109              */
     107
    110108            @Override
    111109            public void actionPerformed(ActionEvent e) {
    112110                try {
    113                 ProjectionChoice pc = (ProjectionChoice)((Chooser) e.getSource()).getSelectedItem();
    114                 setProjection(pc.getProjection());
    115                 } catch (Exception X) {
     111                    ProjectionChoice pc = (ProjectionChoice) ((Chooser) e.getSource()).getSelectedItem();
     112                    setProjection(pc.getProjection());
     113                } catch (Exception ex) {
     114                    Logging.debug(ex);
    116115                }
    117116            }
     
    119118    }
    120119
    121     public GuiProjections(){
     120    public GuiProjections() {
    122121        build();
    123122    }
     
    143142
    144143    private String userHints(Projection p) {
    145         /*
    146          * Provide some hints about projection @p
    147          */
    148         String s="";
     144        // Provide some hints about projection @p
     145        String s = "";
    149146        ProjectionBounds bd;
    150147        try {
    151             bd=p.getWorldBoundsBoxEastNorth();
    152             s += String.format("(%3$.0f %4$.0f) : (%5$.0f %6$.0f)", bd.getCenter().east(),bd.getCenter().north(), bd.getMin().east(),bd.getMin().north(),bd.getMax().east(),bd.getMax().north());
     148            bd = p.getWorldBoundsBoxEastNorth();
     149            s += String.format("(%3$.0f %4$.0f) : (%5$.0f %6$.0f)",
     150                    bd.getCenter().east(),
     151                    bd.getCenter().north(),
     152                    bd.getMin().east(),
     153                    bd.getMin().north(),
     154                    bd.getMax().east(),
     155                    bd.getMax().north());
    153156        } catch (Exception e) {
    154             e.toString();
     157            Logging.debug(e);
    155158            // Leave it, if we cant get it
    156159        }
     
    159162
    160163    private void build() {
    161         pCode = new JLabel("code",SwingConstants.RIGHT);
    162         pName = new JLabel("Name",SwingConstants.RIGHT);
    163         pInfo = new JLabel("Info",SwingConstants.RIGHT);
     164        pCode = new JLabel("code", SwingConstants.RIGHT);
     165        pName = new JLabel("Name", SwingConstants.RIGHT);
     166        pInfo = new JLabel("Info", SwingConstants.RIGHT);
    164167        chooser = new Chooser();
    165168
     
    170173
    171174        panel = new GuiPanel(new GridBagLayout());
    172         panel.add(new JLabel(tr("Projection:"),SwingConstants.RIGHT),c);
    173         panel.add(pCode,c);
    174         c.weightx = 1.0; c.gridx = 2; panel.add(chooser,c);
     175        panel.add(new JLabel(tr("Projection:"), SwingConstants.RIGHT), c);
     176        panel.add(pCode, c);
     177        c.weightx = 1.0; c.gridx = 2; panel.add(chooser, c);
    175178        c.weightx = 0.0; c.gridy = 1; c.gridx = 0; c.gridwidth = 3; c.anchor = GridBagConstraints.LINE_END;
    176         panel.add(pInfo,c);
     179        panel.add(pInfo, c);
    177180    }
    178181}
  • applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/LoadPdfDialog.java

    r34796 r35817  
    299299                        placement.save(pdfFile);
    300300                } catch (IOException e) {
    301                         e.toString();
     301                        Logging.debug(e);
    302302                }
    303303                removeLayer();
     
    314314                        }
    315315                }, new ActionListener() {
    316 
    317316                        @Override
    318317                        public void actionPerformed(ActionEvent e) {
  • applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/PathOptimizerConfig.java

    r34796 r35817  
    1 /**
    2  * License: GPL. For details, see LICENSE file.
    3  */
     1// License: GPL. For details, see LICENSE file.
    42package org.openstreetmap.josm.plugins.pdfimport;
    53
     
    1715import javax.swing.SwingConstants;
    1816
    19 /**
    20  * @author Nzara
    21  *
    22  */
    2317public class PathOptimizerConfig {
    2418        /*
     
    5246                return panel;
    5347        }
    54        
     48
    5549        public boolean save() {
    5650                /*
     
    8276                Preferences.setLayerSegment(splitOnSingleSegmentCheck.getValue());
    8377                Preferences.setLayerOrtho(splitOnOrthogonalCheck.getValue());
    84                
     78
    8579                return true;
    8680        }
     
    9589
    9690                removeSmallObjectsSize = new GuiFieldDouble(Preferences.getRemoveSmallValue());
    97                 removeSmallObjectsCheck = new GuiFieldBool(tr("Remove objects smaller than"),Preferences.isRemoveSmall());
     91                removeSmallObjectsCheck = new GuiFieldBool(tr("Remove objects smaller than"), Preferences.isRemoveSmall());
    9892                removeSmallObjectsCheck.setCompanion(removeSmallObjectsSize);
    9993
    100                 removeLargeObjectsSize = new GuiFieldDouble((Preferences.getRemoveLargeValue()));
    101                 removeLargeObjectsCheck = new GuiFieldBool(tr("Remove objects larger than"),Preferences.isRemoveLarge());
     94                removeLargeObjectsSize = new GuiFieldDouble(Preferences.getRemoveLargeValue());
     95                removeLargeObjectsCheck = new GuiFieldBool(tr("Remove objects larger than"), Preferences.isRemoveLarge());
    10296                removeLargeObjectsCheck.setCompanion(removeLargeObjectsSize);
    10397
     
    106100                colorFilterCheck.setCompanion(colorFilterColor);
    107101
    108                 removeParallelSegmentsTolerance = new GuiFieldDouble((Preferences.getRemoveParallelValue()));
    109                 removeParallelSegmentsCheck = new GuiFieldBool(tr("Remove parallel lines"),Preferences.isRemoveParallel());
     102                removeParallelSegmentsTolerance = new GuiFieldDouble(Preferences.getRemoveParallelValue());
     103                removeParallelSegmentsCheck = new GuiFieldBool(tr("Remove parallel lines"), Preferences.isRemoveParallel());
    110104                removeParallelSegmentsCheck.setCompanion(removeParallelSegmentsTolerance);
    111105
    112                 limitPathCount = new GuiFieldInteger((Preferences.getLimitPathValue()));
    113                 limitPathCountCheck = new GuiFieldBool(tr("Take only first X paths"),Preferences.isLimitPath());
     106                limitPathCount = new GuiFieldInteger(Preferences.getLimitPathValue());
     107                limitPathCountCheck = new GuiFieldBool(tr("Take only first X paths"), Preferences.isLimitPath());
    114108                limitPathCountCheck.setCompanion(limitPathCount);
    115109
    116                 splitOnColorChangeCheck = new GuiFieldBool(tr("Color/width change"),Preferences.isLayerAttribChange());
     110                splitOnColorChangeCheck = new GuiFieldBool(tr("Color/width change"), Preferences.isLayerAttribChange());
    117111                splitOnShapeClosedCheck = new GuiFieldBool(tr("Shape closed"), Preferences.isLayerClosed());
    118112
     
    147141
    148142                panel.add(mergeCloseNodesCheck, cLeft);
    149                 panel.add(new JLabel(tr("Tolerance:"),SwingConstants.RIGHT), cMiddle);
     143                panel.add(new JLabel(tr("Tolerance:"), SwingConstants.RIGHT), cMiddle);
    150144                panel.add(mergeCloseNodesTolerance, cRight);
    151145
    152146                panel.add(removeSmallObjectsCheck, cLeft);
    153                 panel.add(new JLabel(tr("Tolerance:"),SwingConstants.RIGHT), cMiddle);
     147                panel.add(new JLabel(tr("Tolerance:"), SwingConstants.RIGHT), cMiddle);
    154148                panel.add(removeSmallObjectsSize, cRight);
    155149
    156150                panel.add(removeLargeObjectsCheck, cLeft);
    157                 panel.add(new JLabel(tr("Tolerance:"),SwingConstants.RIGHT), cMiddle);
     151                panel.add(new JLabel(tr("Tolerance:"), SwingConstants.RIGHT), cMiddle);
    158152                panel.add(removeLargeObjectsSize, cRight);
    159153
    160154                panel.add(removeParallelSegmentsCheck, cLeft);
    161                 panel.add(new JLabel(tr("Max distance:"),SwingConstants.RIGHT), cMiddle);
     155                panel.add(new JLabel(tr("Max distance:"), SwingConstants.RIGHT), cMiddle);
    162156                panel.add(removeParallelSegmentsTolerance, cRight);
    163157
     
    174168                cRight.gridy = 8; panel.add(splitOnSingleSegmentCheck, cRight);
    175169                cMiddle.gridy = 9; panel.add(splitOnColorChangeCheck, cMiddle);
    176                 cRight.gridy = 9;panel.add(splitOnOrthogonalCheck, cRight);
     170                cRight.gridy = 9; panel.add(splitOnOrthogonalCheck, cRight);
    177171        }
    178172}
  • applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/PreferenceSettingsGui.java

    r34796 r35817  
    1 /**
    2  * License: GPL. For details, see LICENSE file.
    3  */
     1// License: GPL. For details, see LICENSE file.
    42package org.openstreetmap.josm.plugins.pdfimport;
    53
     
    1715import org.openstreetmap.josm.tools.GBC;
    1816
    19 /**
    20  * @author Nzara
    21  *
    22  */
    2317public class PreferenceSettingsGui {
    2418
    25         private class ModeChoice {
    26                 public Preferences.GuiMode guiMode;
    27                 public String name;
     19    private static class ModeChoice {
     20        public Preferences.GuiMode guiMode;
     21        public String name;
    2822
    29                 ModeChoice(Preferences.GuiMode guiMode, String name) {
    30                         this.guiMode = guiMode;
    31                         this.name = name;
    32                 }
     23        ModeChoice(Preferences.GuiMode guiMode, String name) {
     24            this.guiMode = guiMode;
     25            this.name = name;
     26        }
    3327
    34                 public String toString() {
    35                         return name;
    36                 }
    37         }
     28        @Override
     29        public String toString() {
     30            return name;
     31        }
     32    }
    3833
    39         private ModeChoice[] choices = {
    40                         new ModeChoice(Preferences.GuiMode.Auto, tr("Auto")),
    41                         new ModeChoice(Preferences.GuiMode.Simple, tr("Basic")),
    42                         new ModeChoice(Preferences.GuiMode.Expert, tr("Extended"))
    43                         };
     34    private ModeChoice[] choices = {
     35            new ModeChoice(Preferences.GuiMode.Auto, tr("Auto")),
     36            new ModeChoice(Preferences.GuiMode.Simple, tr("Basic")),
     37            new ModeChoice(Preferences.GuiMode.Expert, tr("Extended"))
     38            };
    4439
    45         private final String guiAuto = tr("Auto");
    46         private final String guiBasic = tr("Basic");
    47         private final String guiExtended = tr("Extended");
    48                        
    49         private String[] guiPrefs = {guiAuto, guiBasic, guiExtended};
    50         private JComboBox<String> guiPrefsCombo = new JComboBox<>(guiPrefs);
    51         private JPanel panel;
     40    private final String guiAuto = tr("Auto");
     41    private final String guiBasic = tr("Basic");
     42    private final String guiExtended = tr("Extended");
    5243
    53         public JPanel getGui() {
    54                 if (panel == null)
    55                         build();
    56                 int guiCode = Preferences.getGuiCode();
    57                 if (guiCode == 1) guiPrefsCombo.setSelectedItem(guiExtended);
    58                 if (guiCode == 2) guiPrefsCombo.setSelectedItem(guiBasic);
    59                 return panel;
    60         }
     44    private String[] guiPrefs = {guiAuto, guiBasic, guiExtended};
     45    private JComboBox<String> guiPrefsCombo = new JComboBox<>(guiPrefs);
     46    private JPanel panel;
    6147
    62         public boolean save() {
    63                 String s = (String) guiPrefsCombo.getSelectedItem();
    64                 if (s==guiAuto) Preferences.setGuiCode(0);
    65                 if (s==guiBasic) Preferences.setGuiCode(2);
    66                 if (s==guiExtended) Preferences.setGuiCode(1);
    67                
    68                 return true;
    69         }
     48    public JPanel getGui() {
     49        if (panel == null)
     50            build();
     51        int guiCode = Preferences.getGuiCode();
     52        if (guiCode == 1) guiPrefsCombo.setSelectedItem(guiExtended);
     53        if (guiCode == 2) guiPrefsCombo.setSelectedItem(guiBasic);
     54        return panel;
     55    }
    7056
    71         private void build() {
    72                 panel = new JPanel(new FlowLayout(FlowLayout.LEADING));
    73 //              panel.setAlignmentX(Component.LEFT_ALIGNMENT);
    74                 panel.setBorder(BorderFactory.createTitledBorder(tr("User Interface")));
    75                 JLabel l = new JLabel(tr("Interactions:"));
    76                 panel.add(l, GBC.std());
    77                 panel.add(guiPrefsCombo, GBC.eop());
    78                 guiPrefsCombo.setBackground(Color.red);
    79                 guiPrefsCombo.setAlignmentX(Component.RIGHT_ALIGNMENT);
    80         }
     57    public boolean save() {
     58        String s = (String) guiPrefsCombo.getSelectedItem();
     59        if (s == guiAuto) Preferences.setGuiCode(0);
     60        if (s == guiBasic) Preferences.setGuiCode(2);
     61        if (s == guiExtended) Preferences.setGuiCode(1);
    8162
     63        return true;
     64    }
     65
     66    private void build() {
     67        panel = new JPanel(new FlowLayout(FlowLayout.LEADING));
     68        panel.setBorder(BorderFactory.createTitledBorder(tr("User Interface")));
     69        JLabel l = new JLabel(tr("Interactions:"));
     70        panel.add(l, GBC.std());
     71        panel.add(guiPrefsCombo, GBC.eop());
     72        guiPrefsCombo.setBackground(Color.red);
     73        guiPrefsCombo.setAlignmentX(Component.RIGHT_ALIGNMENT);
     74    }
    8275}
  • applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/Preferences.java

    r34796 r35817  
    1010        public enum GuiMode {
    1111                Auto, Expert, Simple
    12         };
     12        }
    1313
    1414        public static String getLoadDir() {
     
    5050
    5151        public static void setMergeNodes(boolean v) {
    52                 Config.getPref().putBoolean(Preferences.prefix + "mergeNodes",v);
     52                Config.getPref().putBoolean(Preferences.prefix + "mergeNodes", v);
    5353        }
    5454
     
    7070
    7171        public static void setRemoveSmall(boolean v) {
    72                 Config.getPref().putBoolean(Preferences.prefix + "removeSmall",v);
     72                Config.getPref().putBoolean(Preferences.prefix + "removeSmall", v);
    7373        }
    7474
     
    8686
    8787        public static void setRemoveLarge(boolean v) {
    88                 Config.getPref().putBoolean(Preferences.prefix + "removeLarge",v);
     88                Config.getPref().putBoolean(Preferences.prefix + "removeLarge", v);
    8989        }
    9090
     
    102102
    103103        public static void setRemoveParallel(boolean v) {
    104                 Config.getPref().putBoolean(Preferences.prefix + "removeParallel",v);
     104                Config.getPref().putBoolean(Preferences.prefix + "removeParallel", v);
    105105        }
    106106
     
    118118
    119119        public static void setLimitPath(boolean v) {
    120                 Config.getPref().putBoolean(Preferences.prefix + "limitPath",v);
     120                Config.getPref().putBoolean(Preferences.prefix + "limitPath", v);
    121121        }
    122122
     
    134134
    135135        public static void setLimitColor(boolean v) {
    136                 Config.getPref().putBoolean(Preferences.prefix + "limitColor",v);
     136                Config.getPref().putBoolean(Preferences.prefix + "limitColor", v);
    137137        }
    138138
     
    150150
    151151        public static void setDebugTags(boolean v) {
    152                 Config.getPref().putBoolean(Preferences.prefix + "debugTags",v);
     152                Config.getPref().putBoolean(Preferences.prefix + "debugTags", v);
    153153        }
    154154
     
    158158
    159159        public static void setLayerClosed(boolean v) {
    160                 Config.getPref().putBoolean(Preferences.prefix + "layerClosed",v);
     160                Config.getPref().putBoolean(Preferences.prefix + "layerClosed", v);
    161161        }
    162162
    163163        public static boolean isLayerSegment() {
    164                 boolean v =Config.getPref().getBoolean(Preferences.prefix + "layerSegment");
    165164                return Config.getPref().getBoolean(Preferences.prefix + "layerSegment");
    166165        }
    167166
    168167        public static void setLayerSegment(boolean v) {
    169                 Config.getPref().putBoolean(Preferences.prefix + "layerSegment",v);
     168                Config.getPref().putBoolean(Preferences.prefix + "layerSegment", v);
    170169        }
    171170
     
    175174
    176175        public static void setLayerAttribChange(boolean v) {
    177                 Config.getPref().putBoolean(Preferences.prefix + "layerAttribChanges",v);
     176                Config.getPref().putBoolean(Preferences.prefix + "layerAttribChanges", v);
    178177        }
    179178
     
    183182
    184183        public static void setLayerOrtho(boolean v) {
    185                 Config.getPref().putBoolean(Preferences.prefix + "layerOrtho",v);
     184                Config.getPref().putBoolean(Preferences.prefix + "layerOrtho", v);
    186185        }
    187186
     
    197196                prefix = p + ".";
    198197        }
    199 
    200198}
  • applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/Preview.java

    r34609 r35817  
    1 /**
    2  * License: GPL. For details, see LICENSE file.
    3  */
     1// License: GPL. For details, see LICENSE file.
    42package org.openstreetmap.josm.plugins.pdfimport;
    53
     
    75import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    86
    9 import com.drew.lang.annotations.NotNull;
    10 
    11 /**
    12  * @author Nzara
    13  *
    14  */
    157public class Preview {
    168    public static OsmDataLayer dataLayer;
    179    public static FilePlacement placement;
    18    
    19     public static synchronized void set (@NotNull OsmDataLayer dataLayer, @NotNull FilePlacement placement) {
     10
     11    public static synchronized void set(OsmDataLayer dataLayer, FilePlacement placement) {
    2012        clear();
    2113        Preview.dataLayer = dataLayer;
    2214        Preview.placement = placement;
    23         MainApplication.getLayerManager().addLayer(dataLayer);
     15        MainApplication.getLayerManager().addLayer(dataLayer);
     16    }
    2417
    25     }
    26    
    2718    public static void clear() {
    2819        if (Preview.dataLayer != null) {
     
    3324        Preview.placement = null;
    3425    }
    35    
     26
    3627    public void save() {
    3728//        TODO: implement
    3829    }
    39 
    40 
    4130}
  • applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/ProjectionInfo.java

    r34609 r35817  
    1212public final class ProjectionInfo {
    1313    private static Map<String, ProjectionChoice> allCodesPC = new HashMap<>();
    14     private static Map<String, Projection> allCodes = new HashMap<>();
    1514
    1615    static {
     
    3433            throw new IllegalArgumentException();
    3534        }
    36 
    37 //        Projection p = allCodes.get(code);
    38 //        if (p != null) return p;
    39 //        ProjectionChoice pc = allCodesPC.get(code);
    40 //        if (pc == null) return null;
    41 //        Collection<String> pref = pc.getPreferencesFromCode(code);
    42 //        pc.setPreferences(pref);
    43 //        p = pc.getProjection();
    44 //        allCodes.put(code, p);
    45 //        return p;
    4635    }
    4736}
  • applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/pdfbox/PageDrawer.java

    r34609 r35817  
    7171     * @param g The graphics context to draw onto.
    7272     * @param p The page to draw.
    73      * @param pageDimension The size of the page to draw.
    7473     *
    7574     * @throws IOException If there is an IO error while drawing the page.
     
    189188    }
    190189
    191 
    192190    /**
    193191     * Draw the AWT image. Called by Invoke.
    194192     * Moved into PageDrawer so that Invoke doesn't have to reach in here for Graphics as that breaks extensibility.
    195      *
    196      * @param awtImage The image to draw.
    197      * @param at The transformation to use when drawing.
    198      *
    199193     */
    200194    public void drawImage() {
Note: See TracChangeset for help on using the changeset viewer.