Changeset 23991 in osm for applications/editors/josm/plugins/pdfimport/src/pdfimport/LoadPdfDialog.java
- Timestamp:
- 2010-11-01T14:27:55+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pdfimport/src/pdfimport/LoadPdfDialog.java
r23866 r23991 19 19 import javax.swing.BorderFactory; 20 20 import javax.swing.JButton; 21 import javax.swing.JCheckBox; 21 22 import javax.swing.JComboBox; 22 23 import javax.swing.JFileChooser; … … 67 68 private JButton showButton; 68 69 private JButton saveButton; 70 private JCheckBox debugModeCheck; 69 71 70 72 public LoadPdfDialog() { … … 159 161 this.getMaxButton = new JButton(tr("Take X and Y from selected node")); 160 162 163 this.debugModeCheck = new JCheckBox(tr("Debug info")); 164 161 165 162 166 JPanel selectFilePanel = new JPanel(new GridBagLayout()); … … 164 168 c.gridx = 0; c.gridy = 0; c.gridwidth = 1; 165 169 selectFilePanel.add(this.loadFileButton, c); 170 171 c.gridx = 0; c.gridy = 1; c.gridwidth = 1; 172 selectFilePanel.add(this.debugModeCheck, c); 166 173 167 174 JPanel projectionPanel = new JPanel(new GridBagLayout()); … … 208 215 projectionPanel.add(this.getMaxButton, c); 209 216 210 211 217 JPanel okCancelPanel = new JPanel(new GridLayout(1,3)); 212 218 okCancelPanel.add(this.cancelButton); … … 246 252 public void actionPerformed(ActionEvent e) { 247 253 if (data!= null) { 254 OsmBuilder.Mode mode = LoadPdfDialog.this.debugModeCheck.isSelected() ? OsmBuilder.Mode.Debug: OsmBuilder.Mode.Draft; 248 255 LoadPdfDialog.this.fileName = fileName.getAbsolutePath(); 249 LoadPdfDialog.this.makeLayer(tr("PDF file preview"), false);256 LoadPdfDialog.this.makeLayer(tr("PDF file preview"), mode); 250 257 LoadPdfDialog.this.loadFileButton.setText(tr("Loaded")); 251 258 LoadPdfDialog.this.loadFileButton.setEnabled(true); … … 264 271 265 272 //rebuild layer with latest projection 266 this.makeLayer(tr("Imported PDF: ") + this.fileName, true);273 this.makeLayer(tr("Imported PDF: ") + this.fileName, OsmBuilder.Mode.Final); 267 274 this.setVisible(false); 268 275 } … … 480 487 } 481 488 482 private void makeLayer(String name, boolean isFinal) {489 private void makeLayer(String name, OsmBuilder.Mode mode) { 483 490 this.removeLayer(); 484 491 … … 487 494 } 488 495 489 DataSet data = builder.build(this.data.getLayers(), isFinal);496 DataSet data = builder.build(this.data.getLayers(), mode); 490 497 this.layer = new OsmDataLayer(data, name, null); 491 498 … … 510 517 511 518 private void saveLayer(java.io.File file) { 512 DataSet data = builder.build(this.data.getLayers(), true);519 DataSet data = builder.build(this.data.getLayers(), OsmBuilder.Mode.Final); 513 520 OsmDataLayer layer = new OsmDataLayer(data, file.getName(), file); 514 521
Note:
See TracChangeset
for help on using the changeset viewer.