Changeset 29529 in osm for applications/editors/josm/plugins/print/src/org
- Timestamp:
- 2013-04-23T13:12:05+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintAction.java
r28367 r29529 70 70 public void run () { 71 71 PrintPlugin.adjustPrefs(); 72 PrintDialog window = new PrintDialog(Main. main.parent);72 PrintDialog window = new PrintDialog(Main.parent); 73 73 window.setVisible(true); 74 74 PrintPlugin.restorePrefs(); -
applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintDialog.java
r27316 r29529 28 28 import java.awt.Component; 29 29 import java.awt.Dimension; 30 import java.awt.GridBagConstraints;31 30 import java.awt.GridBagLayout; 32 31 import java.awt.Insets; … … 34 33 import java.awt.event.ActionEvent; 35 34 import java.awt.event.ActionListener; 36 import java.awt.print.*; 37 35 import java.awt.print.PageFormat; 36 import java.awt.print.PrinterAbortException; 37 import java.awt.print.PrinterException; 38 import java.awt.print.PrinterJob; 38 39 import java.text.ParseException; 39 40 40 import javax.print.*; 41 import javax.print.attribute.*; 42 import javax.print.attribute.standard.*; 41 import javax.print.PrintService; 42 import javax.print.PrintServiceLookup; 43 import javax.print.attribute.Attribute; 44 import javax.print.attribute.HashPrintRequestAttributeSet; 45 import javax.print.attribute.PrintRequestAttributeSet; 46 import javax.print.attribute.standard.Media; 47 import javax.print.attribute.standard.MediaPrintableArea; 48 import javax.print.attribute.standard.OrientationRequested; 43 49 import javax.swing.JButton; 44 50 import javax.swing.JCheckBox; … … 331 337 } 332 338 JScrollPane previewPane = new JScrollPane(printPreview, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); 333 previewPane.setPreferredSize(Main.main != null ? Main.ma in.map.mapView.getSize() : new Dimension(210,297));339 previewPane.setPreferredSize(Main.main != null ? Main.map.mapView.getSize() : new Dimension(210,297)); 334 340 add(previewPane, GBC.std(0,0).span(1, GBC.RELATIVE).fill().weight(5.0,5.0)); 335 341 … … 394 400 String cmd = e.getActionCommand(); 395 401 if (cmd.equals("printer-dialog")) { 396 PrintService[] services =PrintServiceLookup.lookupPrintServices(null, null);397 PrintService svc =PrintServiceLookup.lookupDefaultPrintService();402 /*PrintService[] services =*/ PrintServiceLookup.lookupPrintServices(null, null); 403 /*PrintService svc =*/ PrintServiceLookup.lookupDefaultPrintService(); 398 404 if (job.printDialog(attrs)) { 399 405 updateFields(); … … 430 436 msg = tr("Printing has been cancelled."); 431 437 } 432 JOptionPane.showMessageDialog(Main. main.parent, msg,438 JOptionPane.showMessageDialog(Main.parent, msg, 433 439 tr("Printing stopped"), 434 440 JOptionPane.WARNING_MESSAGE); … … 439 445 msg = tr("Printing has failed."); 440 446 } 441 JOptionPane.showMessageDialog(Main. main.parent, msg,447 JOptionPane.showMessageDialog(Main.parent, msg, 442 448 tr("Printing stopped"), 443 449 JOptionPane.ERROR_MESSAGE); -
applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintPlugin.java
r27760 r29529 23 23 24 24 package org.openstreetmap.josm.plugins.print; 25 26 import java.awt.Toolkit;27 25 28 26 import javax.swing.JMenu; -
applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintableMapView.java
r29210 r29529 33 33 import java.awt.Graphics; 34 34 import java.awt.Graphics2D; 35 import java.awt.Image;36 35 import java.awt.Shape; 37 import java.awt.event.ActionEvent;38 import java.awt.event.KeyEvent;39 36 import java.awt.font.FontRenderContext; 40 37 import java.awt.font.GlyphVector; 41 38 import java.awt.geom.AffineTransform; 42 39 import java.awt.geom.Rectangle2D; 43 import java.awt.print.*; 40 import java.awt.print.PageFormat; 41 import java.awt.print.Printable; 42 import java.awt.print.PrinterException; 44 43 import java.util.ArrayList; 45 44 import java.util.Collections; … … 52 51 import org.openstreetmap.josm.data.Bounds; 53 52 import org.openstreetmap.josm.gui.MapView; 54 import org.openstreetmap.josm.gui.NavigatableComponent.SystemOfMeasurement;55 53 import org.openstreetmap.josm.gui.layer.Layer; 56 54 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 98 96 } 99 97 100 mapView = Main.ma in.map.mapView;98 mapView = Main.map.mapView; 101 99 } 102 100 … … 232 230 List<Layer> visibleLayers = getVisibleLayersInZOrder(); 233 231 for (Layer l : visibleLayers) { 234 try { 235 if (! (l instanceof OsmDataLayer)) { 236 /* OsmDataLayer does not need this.*/ 237 238 /* This manipulations may have all kinds of unwanted side effects 239 * but many Layer implementations heavily depend on Main.map.mapView. */ 240 Main.map.mapView = this; 241 } 242 if (l.getOpacity() < 1) { 243 g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,(float)l.getOpacity())); 244 } 245 l.paint(g2d, this, box); 246 g2d.setPaintMode(); 232 if (l.getOpacity() < 1) { 233 g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,(float)l.getOpacity())); 247 234 } 248 finally { 249 Main.map.mapView = mapView; 250 } 235 l.paint(g2d, this, box); 236 g2d.setPaintMode(); 251 237 } 252 238 … … 267 253 double dist100px = getDist100Pixel() / g2dFactor; 268 254 double dist = dist100px / som.aValue; 269 String unit = som.aName;255 //String unit = som.aName; 270 256 if (!Main.pref.getBoolean("system_of_measurement.use_only_lower_unit", false) && dist > som.bValue / som.aValue) { 271 257 dist = dist100px / som.bValue; 272 unit = som.bName;258 //unit = som.bName; 273 259 } 274 260 long distExponent = (long) Math.floor(Math.log(dist) / Math.log(10));
Note:
See TracChangeset
for help on using the changeset viewer.