Changeset 35817 in osm
- Timestamp:
- 2021-09-03T03:32:59+02:00 (3 years ago)
- 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
-
Property svn:ignore
set to
-
applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/FilePlacement18.java
r34660 r35817 30 30 import org.openstreetmap.josm.data.osm.Node; 31 31 import org.openstreetmap.josm.data.osm.OsmPrimitive; 32 import org.openstreetmap.josm.data.projection.Projection;33 32 import org.openstreetmap.josm.gui.MainApplication; 33 import org.openstreetmap.josm.tools.Logging; 34 34 35 35 public class FilePlacement18 extends FilePlacement { … … 81 81 }); 82 82 } 83 83 84 public void SetCoor(EastNorth en) { 84 85 x.requestFocusInWindow(); // make shure focus-lost events will be triggered later … … 87 88 y.setValue(en.getY()); 88 89 } 90 89 91 public EastNorth getCorr() { 90 return new EastNorth(x.getValue(),y.getValue()); 92 return new EastNorth(x.getValue(), y.getValue()); 91 93 } 92 94 } … … 113 115 114 116 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() { 120 122 121 123 } … … 123 125 private class Monitor implements FocusListener { 124 126 125 private PlacementPanel target =null;127 private PlacementPanel target; 126 128 127 129 public Monitor(PlacementPanel home) { 128 target =home;130 target = home; 129 131 } 130 132 … … 137 139 try { 138 140 target.Verify(); 139 } catch (Exception ee) { 141 } catch (Exception ex) { 142 Logging.trace(ex); 140 143 } 141 144 } … … 245 248 cGetButton.fill = GridBagConstraints.NONE; 246 249 247 GridBagConstraints c = new GridBagConstraints();248 250 /* 249 251 * Projection … … 253 255 * Max Corner 254 256 */ 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); 258 260 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); 260 262 c.weightx = 1.0; panel.add(maxEastField, c); 261 263 262 264 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); 264 266 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); 266 268 c.weightx = 1.0; panel.add(maxNorthField, c); 267 269 panel.add(getMaxButton, cGetButton); … … 269 271 * Min Corner 270 272 */ 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); 272 274 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); 274 276 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); 276 278 c.weightx = 1.0; panel.add(minEastField, c); 277 279 278 280 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); 280 282 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); 282 284 c.weightx = 1.0; panel.add(minNorthField, c); 283 285 … … 306 308 307 309 LatLon ll = ((Node) selected.iterator().next()).getCoor(); 308 // FilePlacement pl = new FilePlacement();309 // return pl.reverseTransform(ll);310 310 return new EastNorth(ll.lon() * 1000, ll.lat() * 1000); 311 311 } … … 352 352 f.SetCoor(en); 353 353 } 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 361 359 362 360 public boolean isValid() { … … 366 364 return valid; 367 365 } 366 368 367 public void setDependsOnValid(JComponent c) { 369 368 panel.setDependsOnValid(c); … … 371 370 372 371 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(); 375 374 return panel.panel; 376 375 } 377 376 378 public FilePlacement18 377 public FilePlacement18() { 379 378 panel = new PlacementPanel(this); 380 379 } … … 383 382 File file = new File(baseFile + ".placement"); 384 383 Properties p = new Properties(); 385 try (FileInputStream s = new FileInputStream(file)){ 384 try (FileInputStream s = new FileInputStream(file)) { 386 385 p.load(s); 387 386 s.close(); 388 } ;387 } 389 388 fromProperties(p); 390 389 } … … 402 401 } 403 402 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 420 403 @Override 421 404 protected void fromProperties(Properties p) { … … 423 406 panel.load(); 424 407 } 425 426 408 } -
applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/GuiProjections.java
r34796 r35817 45 45 * Component to choose a Projection 46 46 */ 47 publicChooser() {47 Chooser() { 48 48 setEditable(false); 49 49 setToolTipText(tr("Projection of the PDF-Document")); … … 55 55 } 56 56 addActionListener(monitor); 57 setProjection 57 setProjection(ProjectionRegistry.getProjection()); 58 58 } 59 59 60 public void setProjection 60 public void setProjection(Projection p) { 61 61 /* 62 62 * set current Projection to @p 63 63 * update internal variables 64 64 */ 65 if (p ==null) return; // better keep the old one65 if (p == null) return; // better keep the old one 66 66 projection = p; 67 67 pName.setText(p.toString()); … … 96 96 */ 97 97 Logging.debug("New projection encountered"); 98 ProjectionChoice px = new SingleProjectionChoice(p.toString(), localId, projectionCode) 98 ProjectionChoice px = new SingleProjectionChoice(p.toString(), localId, projectionCode); 99 99 addItem(px); 100 100 setSelectedItem(px); 101 101 } 102 102 103 /** 104 * monitor user selection and set internal var accordingly 105 */ 103 106 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 110 108 @Override 111 109 public void actionPerformed(ActionEvent e) { 112 110 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); 116 115 } 117 116 } … … 119 118 } 120 119 121 public GuiProjections(){ 120 public GuiProjections() { 122 121 build(); 123 122 } … … 143 142 144 143 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 = ""; 149 146 ProjectionBounds bd; 150 147 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()); 153 156 } catch (Exception e) { 154 e.toString();157 Logging.debug(e); 155 158 // Leave it, if we cant get it 156 159 } … … 159 162 160 163 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); 164 167 chooser = new Chooser(); 165 168 … … 170 173 171 174 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); 175 178 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); 177 180 } 178 181 } -
applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/LoadPdfDialog.java
r34796 r35817 299 299 placement.save(pdfFile); 300 300 } catch (IOException e) { 301 e.toString();301 Logging.debug(e); 302 302 } 303 303 removeLayer(); … … 314 314 } 315 315 }, new ActionListener() { 316 317 316 @Override 318 317 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. 4 2 package org.openstreetmap.josm.plugins.pdfimport; 5 3 … … 17 15 import javax.swing.SwingConstants; 18 16 19 /**20 * @author Nzara21 *22 */23 17 public class PathOptimizerConfig { 24 18 /* … … 52 46 return panel; 53 47 } 54 48 55 49 public boolean save() { 56 50 /* … … 82 76 Preferences.setLayerSegment(splitOnSingleSegmentCheck.getValue()); 83 77 Preferences.setLayerOrtho(splitOnOrthogonalCheck.getValue()); 84 78 85 79 return true; 86 80 } … … 95 89 96 90 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()); 98 92 removeSmallObjectsCheck.setCompanion(removeSmallObjectsSize); 99 93 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()); 102 96 removeLargeObjectsCheck.setCompanion(removeLargeObjectsSize); 103 97 … … 106 100 colorFilterCheck.setCompanion(colorFilterColor); 107 101 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()); 110 104 removeParallelSegmentsCheck.setCompanion(removeParallelSegmentsTolerance); 111 105 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()); 114 108 limitPathCountCheck.setCompanion(limitPathCount); 115 109 116 splitOnColorChangeCheck = new GuiFieldBool(tr("Color/width change"),Preferences.isLayerAttribChange()); 110 splitOnColorChangeCheck = new GuiFieldBool(tr("Color/width change"), Preferences.isLayerAttribChange()); 117 111 splitOnShapeClosedCheck = new GuiFieldBool(tr("Shape closed"), Preferences.isLayerClosed()); 118 112 … … 147 141 148 142 panel.add(mergeCloseNodesCheck, cLeft); 149 panel.add(new JLabel(tr("Tolerance:"),SwingConstants.RIGHT), cMiddle); 143 panel.add(new JLabel(tr("Tolerance:"), SwingConstants.RIGHT), cMiddle); 150 144 panel.add(mergeCloseNodesTolerance, cRight); 151 145 152 146 panel.add(removeSmallObjectsCheck, cLeft); 153 panel.add(new JLabel(tr("Tolerance:"),SwingConstants.RIGHT), cMiddle); 147 panel.add(new JLabel(tr("Tolerance:"), SwingConstants.RIGHT), cMiddle); 154 148 panel.add(removeSmallObjectsSize, cRight); 155 149 156 150 panel.add(removeLargeObjectsCheck, cLeft); 157 panel.add(new JLabel(tr("Tolerance:"),SwingConstants.RIGHT), cMiddle); 151 panel.add(new JLabel(tr("Tolerance:"), SwingConstants.RIGHT), cMiddle); 158 152 panel.add(removeLargeObjectsSize, cRight); 159 153 160 154 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); 162 156 panel.add(removeParallelSegmentsTolerance, cRight); 163 157 … … 174 168 cRight.gridy = 8; panel.add(splitOnSingleSegmentCheck, cRight); 175 169 cMiddle.gridy = 9; panel.add(splitOnColorChangeCheck, cMiddle); 176 cRight.gridy = 9;panel.add(splitOnOrthogonalCheck, cRight); 170 cRight.gridy = 9; panel.add(splitOnOrthogonalCheck, cRight); 177 171 } 178 172 } -
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. 4 2 package org.openstreetmap.josm.plugins.pdfimport; 5 3 … … 17 15 import org.openstreetmap.josm.tools.GBC; 18 16 19 /**20 * @author Nzara21 *22 */23 17 public class PreferenceSettingsGui { 24 18 25 privateclass ModeChoice {26 27 19 private static class ModeChoice { 20 public Preferences.GuiMode guiMode; 21 public String name; 28 22 29 30 31 32 23 ModeChoice(Preferences.GuiMode guiMode, String name) { 24 this.guiMode = guiMode; 25 this.name = name; 26 } 33 27 34 public String toString() { 35 return name; 36 } 37 } 28 @Override 29 public String toString() { 30 return name; 31 } 32 } 38 33 39 40 41 42 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 }; 44 39 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"); 52 43 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; 61 47 62 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 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 } 70 56 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); 81 62 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 } 82 75 } -
applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/Preferences.java
r34796 r35817 10 10 public enum GuiMode { 11 11 Auto, Expert, Simple 12 } ;12 } 13 13 14 14 public static String getLoadDir() { … … 50 50 51 51 public static void setMergeNodes(boolean v) { 52 Config.getPref().putBoolean(Preferences.prefix + "mergeNodes",v); 52 Config.getPref().putBoolean(Preferences.prefix + "mergeNodes", v); 53 53 } 54 54 … … 70 70 71 71 public static void setRemoveSmall(boolean v) { 72 Config.getPref().putBoolean(Preferences.prefix + "removeSmall",v); 72 Config.getPref().putBoolean(Preferences.prefix + "removeSmall", v); 73 73 } 74 74 … … 86 86 87 87 public static void setRemoveLarge(boolean v) { 88 Config.getPref().putBoolean(Preferences.prefix + "removeLarge",v); 88 Config.getPref().putBoolean(Preferences.prefix + "removeLarge", v); 89 89 } 90 90 … … 102 102 103 103 public static void setRemoveParallel(boolean v) { 104 Config.getPref().putBoolean(Preferences.prefix + "removeParallel",v); 104 Config.getPref().putBoolean(Preferences.prefix + "removeParallel", v); 105 105 } 106 106 … … 118 118 119 119 public static void setLimitPath(boolean v) { 120 Config.getPref().putBoolean(Preferences.prefix + "limitPath",v); 120 Config.getPref().putBoolean(Preferences.prefix + "limitPath", v); 121 121 } 122 122 … … 134 134 135 135 public static void setLimitColor(boolean v) { 136 Config.getPref().putBoolean(Preferences.prefix + "limitColor",v); 136 Config.getPref().putBoolean(Preferences.prefix + "limitColor", v); 137 137 } 138 138 … … 150 150 151 151 public static void setDebugTags(boolean v) { 152 Config.getPref().putBoolean(Preferences.prefix + "debugTags",v); 152 Config.getPref().putBoolean(Preferences.prefix + "debugTags", v); 153 153 } 154 154 … … 158 158 159 159 public static void setLayerClosed(boolean v) { 160 Config.getPref().putBoolean(Preferences.prefix + "layerClosed",v); 160 Config.getPref().putBoolean(Preferences.prefix + "layerClosed", v); 161 161 } 162 162 163 163 public static boolean isLayerSegment() { 164 boolean v =Config.getPref().getBoolean(Preferences.prefix + "layerSegment");165 164 return Config.getPref().getBoolean(Preferences.prefix + "layerSegment"); 166 165 } 167 166 168 167 public static void setLayerSegment(boolean v) { 169 Config.getPref().putBoolean(Preferences.prefix + "layerSegment",v); 168 Config.getPref().putBoolean(Preferences.prefix + "layerSegment", v); 170 169 } 171 170 … … 175 174 176 175 public static void setLayerAttribChange(boolean v) { 177 Config.getPref().putBoolean(Preferences.prefix + "layerAttribChanges",v); 176 Config.getPref().putBoolean(Preferences.prefix + "layerAttribChanges", v); 178 177 } 179 178 … … 183 182 184 183 public static void setLayerOrtho(boolean v) { 185 Config.getPref().putBoolean(Preferences.prefix + "layerOrtho",v); 184 Config.getPref().putBoolean(Preferences.prefix + "layerOrtho", v); 186 185 } 187 186 … … 197 196 prefix = p + "."; 198 197 } 199 200 198 } -
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. 4 2 package org.openstreetmap.josm.plugins.pdfimport; 5 3 … … 7 5 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 8 6 9 import com.drew.lang.annotations.NotNull;10 11 /**12 * @author Nzara13 *14 */15 7 public class Preview { 16 8 public static OsmDataLayer dataLayer; 17 9 public static FilePlacement placement; 18 19 public static synchronized void set (@NotNullOsmDataLayer dataLayer,@NotNullFilePlacement placement) {10 11 public static synchronized void set(OsmDataLayer dataLayer, FilePlacement placement) { 20 12 clear(); 21 13 Preview.dataLayer = dataLayer; 22 14 Preview.placement = placement; 23 MainApplication.getLayerManager().addLayer(dataLayer); 15 MainApplication.getLayerManager().addLayer(dataLayer); 16 } 24 17 25 }26 27 18 public static void clear() { 28 19 if (Preview.dataLayer != null) { … … 33 24 Preview.placement = null; 34 25 } 35 26 36 27 public void save() { 37 28 // TODO: implement 38 29 } 39 40 41 30 } -
applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/ProjectionInfo.java
r34609 r35817 12 12 public final class ProjectionInfo { 13 13 private static Map<String, ProjectionChoice> allCodesPC = new HashMap<>(); 14 private static Map<String, Projection> allCodes = new HashMap<>();15 14 16 15 static { … … 34 33 throw new IllegalArgumentException(); 35 34 } 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;46 35 } 47 36 } -
applications/editors/josm/plugins/pdfimport/src/org/openstreetmap/josm/plugins/pdfimport/pdfbox/PageDrawer.java
r34609 r35817 71 71 * @param g The graphics context to draw onto. 72 72 * @param p The page to draw. 73 * @param pageDimension The size of the page to draw.74 73 * 75 74 * @throws IOException If there is an IO error while drawing the page. … … 189 188 } 190 189 191 192 190 /** 193 191 * Draw the AWT image. Called by Invoke. 194 192 * 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 *199 193 */ 200 194 public void drawImage() {
Note:
See TracChangeset
for help on using the changeset viewer.