Index: /applications/editors/josm/plugins/print/.checkstyle
===================================================================
--- /applications/editors/josm/plugins/print/.checkstyle	(revision 33062)
+++ /applications/editors/josm/plugins/print/.checkstyle	(revision 33062)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+  <local-check-config name="JOSM" location="/JOSM/tools/checkstyle/josm_checks.xml" type="project" description="">
+    <additional-data name="protect-config-file" value="false"/>
+  </local-check-config>
+  <fileset name="all" enabled="true" check-config-name="JOSM" local="true">
+    <file-match-pattern match-pattern="." include-pattern="true"/>
+  </fileset>
+  <filter name="DerivedFiles" enabled="true"/>
+  <filter name="FilesFromPackage" enabled="true">
+    <filter-data value=".svn"/>
+    <filter-data value="data"/>
+    <filter-data value="images"/>
+    <filter-data value="resources"/>
+    <filter-data value="styles"/>
+    <filter-data value="scripts"/>
+  </filter>
+</fileset-config>
Index: /applications/editors/josm/plugins/print/.project
===================================================================
--- /applications/editors/josm/plugins/print/.project	(revision 33061)
+++ /applications/editors/josm/plugins/print/.project	(revision 33062)
@@ -16,7 +16,13 @@
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
 	</natures>
 </projectDescription>
Index: /applications/editors/josm/plugins/print/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- /applications/editors/josm/plugins/print/.settings/org.eclipse.jdt.ui.prefs	(revision 33062)
+++ /applications/editors/josm/plugins/print/.settings/org.eclipse.jdt.ui.prefs	(revision 33062)
@@ -0,0 +1,59 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
Index: /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintAction.java
===================================================================
--- /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintAction.java	(revision 33061)
+++ /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintAction.java	(revision 33062)
@@ -1,24 +1,3 @@
-/*
- *      PrintAction.java
- *
- *      Copyright 2011 Kai Pastor
- *
- *      This program is free software; you can redistribute it and/or modify
- *      it under the terms of the GNU General Public License as published by
- *      the Free Software Foundation; either version 2 of the License, or
- *      (at your option) any later version.
- *
- *      This program is distributed in the hope that it will be useful,
- *      but WITHOUT ANY WARRANTY; without even the implied warranty of
- *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *      GNU General Public License for more details.
- *
- *      You should have received a copy of the GNU General Public License
- *      along with this program; if not, write to the Free Software
- *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- *      MA 02110-1301, USA.
- *
- *
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.print;
 
@@ -37,4 +16,5 @@
  * The PrintAction controls basic printing of the MapView
  * and takes care of reasonable temporary adjustments to the preferences.
+ * @author Kai Pastor
  */
 public class PrintAction extends JosmAction implements Runnable {
@@ -44,5 +24,5 @@
      */
     public PrintAction() {
-        super(tr("Print..."), (String)null, tr("Print the map"),
+        super(tr("Print..."), (String) null, tr("Print the map"),
                 Shortcut.registerShortcut("system:print", tr("File: {0}", tr("Print...")),
                         KeyEvent.VK_P, Shortcut.CTRL), true, "print/print", true);
@@ -66,5 +46,5 @@
      */
     @Override
-    public void run () {
+    public void run() {
         PrintPlugin.adjustPrefs();
         PrintDialog window = new PrintDialog(Main.parent);
Index: /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintDialog.java
===================================================================
--- /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintDialog.java	(revision 33061)
+++ /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintDialog.java	(revision 33062)
@@ -1,25 +1,3 @@
-/*
- *      PrintDialog.java
- *      
- *      Copyright 2011 Kai Pastor
- *      
- *      This program is free software; you can redistribute it and/or modify
- *      it under the terms of the GNU General Public License as published by
- *      the Free Software Foundation; either version 2 of the License, or
- *      (at your option) any later version.
- *      
- *      This program is distributed in the hope that it will be useful,
- *      but WITHOUT ANY WARRANTY; without even the implied warranty of
- *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *      GNU General Public License for more details.
- *      
- *      You should have received a copy of the GNU General Public License
- *      along with this program; if not, write to the Free Software
- *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- *      MA 02110-1301, USA.
- *      
- *      
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.print;
 
@@ -84,4 +62,5 @@
 /**
  * A print dialog with preview
+ * @author Kai Pastor
  */
 public class PrintDialog extends JDialog implements ActionListener {
@@ -91,10 +70,10 @@
      */
     protected JTextField printerField;
-    
+
     /**
      * The media format name
      */
     protected JTextField paperField;
-    
+
     /**
      * The media orientation
@@ -106,38 +85,38 @@
      */
     protected JCheckBox previewCheckBox;
-    
+
     /**
      * The resolution in dpi for printing/preview
      */
     protected SpinnerNumberModel resolutionModel;
-    
+
     /**
      * The map scale
      */
     protected SpinnerNumberModel scaleModel;
-    
+
     /**
      * The page preview
      */
     protected PrintPreview printPreview;
-    
+
     /**
      * The map view for preview an printing
      */
     protected PrintableMapView mapView;
-    
+
     /**
      * The printer job
      */
     protected transient PrinterJob job;
-    
+
     /**
      * The custom printer job attributes
      */
     transient PrintRequestAttributeSet attrs = new HashPrintRequestAttributeSet();
-    
-    /** 
+
+    /**
      * Create a new print dialog
-     * 
+     *
      * @param parent the parent component
      */
@@ -154,10 +133,10 @@
         setMaximumSize(Toolkit.getDefaultToolkit().getScreenSize());
     }
-    
+
     /**
      * Show or hide the dialog
-     * 
+     *
      * Set the dialog size to reasonable values.
-     * 
+     *
      * @param visible a flag indication the visibility of the dialog
      */
@@ -181,5 +160,5 @@
         } else if (isShowing()) { // Avoid IllegalComponentStateException like in #8775
             new WindowGeometry(this).remember(getClass().getName() + ".geometry");
-            Main.pref.put("print.preview.enabled",previewCheckBox.isSelected());
+            Main.pref.put("print.preview.enabled", previewCheckBox.isSelected());
         }
         super.setVisible(visible);
@@ -191,13 +170,13 @@
     public void build() {
         setLayout(new GridBagLayout());
-        final GBC std = GBC.std().insets(0,5,5,0);
+        final GBC std = GBC.std().insets(0, 5, 5, 0);
         std.fill = GBC.HORIZONTAL;
-        final GBC twoColumns   = GBC.std().insets(0,5,5,0).span(2);
+        final GBC twoColumns = GBC.std().insets(0, 5, 5, 0).span(2);
         twoColumns.fill = GBC.HORIZONTAL;
-        final GBC threeColumns = GBC.std().insets(0,5,5,0).span(3);
+        final GBC threeColumns = GBC.std().insets(0, 5, 5, 0).span(3);
         threeColumns.fill = GBC.HORIZONTAL;
-        
+
         JLabel caption;
-        
+
         int row = 0;
         caption = new JLabel(tr("Printer")+":");
@@ -228,6 +207,6 @@
 
         row++;
-        add(GBC.glue(5,10), GBC.std(1,row).fill(GBC.VERTICAL));
-        
+        add(GBC.glue(5, 10), GBC.std(1, row).fill(GBC.VERTICAL));
+
         row++;
         caption = new JLabel(tr("Scale")+":");
@@ -247,5 +226,5 @@
                         try {
                             scaleField.commitEdit();
-                            Main.pref.put("print.map-scale",scaleModel.getNumber().toString());
+                            Main.pref.put("print.map-scale", scaleModel.getNumber().toString());
                             mapView.setFixedMapScale(scaleModel.getNumber().intValue());
                             printPreview.repaint();
@@ -266,5 +245,5 @@
         resolutionModel = new SpinnerNumberModel(
           Main.pref.getInteger("print.resolution.dpi", PrintPlugin.DEF_RESOLUTION_DPI),
-          30, 1200, 10 );
+          30, 1200, 10);
         final JSpinner resolutionField = new JSpinner(resolutionModel);
         resolutionField.addChangeListener(new ChangeListener() {
@@ -276,5 +255,5 @@
                         try {
                             resolutionField.commitEdit();
-                            Main.pref.put("print.resolution.dpi",resolutionModel.getNumber().toString());
+                            Main.pref.put("print.resolution.dpi", resolutionModel.getNumber().toString());
                             printPreview.repaint();
                         } catch (ParseException pe) {
@@ -286,5 +265,5 @@
         });
         add(resolutionField, std.grid(GBC.RELATIVE, row));
-        
+
         row++;
         caption = new JLabel(tr("Map information")+":");
@@ -307,8 +286,10 @@
                 });
             }
+
             @Override
             public void removeUpdate(DocumentEvent evt) {
                 this.insertUpdate(evt);
             }
+
             @Override
             public void changedUpdate(DocumentEvent evt) {
@@ -317,12 +298,12 @@
         });
         JScrollPane attributionPane = new JScrollPane(attributionText);
-        add(attributionPane, GBC.std().insets(0,5,5,0).span(3).fill(GBC.BOTH).weight(0.0,1.0).grid(2, row));
-
-        row++;
-        add(GBC.glue(5,10), GBC.std(1,row).fill(GBC.VERTICAL));
-        
+        add(attributionPane, GBC.std().insets(0, 5, 5, 0).span(3).fill(GBC.BOTH).weight(0.0, 1.0).grid(2, row));
+
+        row++;
+        add(GBC.glue(5, 10), GBC.std(1, row).fill(GBC.VERTICAL));
+
         row++;
         previewCheckBox = new JCheckBox(tr("Map Preview"));
-        previewCheckBox.setSelected(Main.pref.getBoolean("print.preview.enabled",false));
+        previewCheckBox.setSelected(Main.pref.getBoolean("print.preview.enabled", false));
         previewCheckBox.setActionCommand("toggle-preview");
         previewCheckBox.addActionListener(this);
@@ -340,5 +321,5 @@
         zoomOutButton.addActionListener(this);
         add(zoomOutButton, threeColumns.grid(2, row));
-        
+
         row++;
         JButton zoomToPageButton = new JButton(tr("Zoom To Page"));
@@ -346,5 +327,5 @@
         zoomToPageButton.addActionListener(this);
         add(zoomToPageButton, threeColumns.grid(2, row));
-        
+
         row++;
         JButton zoomToActualSize = new JButton(tr("Zoom To Actual Size"));
@@ -352,13 +333,13 @@
         zoomToActualSize.addActionListener(this);
         add(zoomToActualSize, threeColumns.grid(2, row));
-        
+
         printPreview = new PrintPreview();
         if (previewCheckBox.isSelected()) {
             printPreview.setPrintable(mapView);
         }
-        JScrollPane previewPane = new JScrollPane(printPreview, 
+        JScrollPane previewPane = new JScrollPane(printPreview,
                 JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
-        previewPane.setPreferredSize(Main.main != null ? Main.map.mapView.getSize() : new Dimension(210,297));
-        add(previewPane, GBC.std(0,0).span(1, GBC.RELATIVE).fill().weight(5.0,5.0));
+        previewPane.setPreferredSize(Main.main != null ? Main.map.mapView.getSize() : new Dimension(210, 297));
+        add(previewPane, GBC.std(0, 0).span(1, GBC.RELATIVE).fill().weight(5.0, 5.0));
 
         row++;
@@ -372,7 +353,7 @@
         cancelButton.addActionListener(this);
         actionPanel.add(cancelButton);
-        add(actionPanel, GBC.std(0,row).insets(5,5,5,5).span(GBC.REMAINDER).fill(GBC.HORIZONTAL));
-    }
-    
+        add(actionPanel, GBC.std(0, row).insets(5, 5, 5, 5).span(GBC.REMAINDER).fill(GBC.HORIZONTAL));
+    }
+
     /**
      * Update the dialog fields from the underlying model
@@ -386,12 +367,12 @@
         } else {
             printerField.setText(service.getName());
-            if (! attrs.containsKey(Media.class)) {
+            if (!attrs.containsKey(Media.class)) {
                 attrs.add((Attribute) service.getDefaultAttributeValue(Media.class));
-            } 
+            }
             if (attrs.containsKey(Media.class)) {
                 paperField.setText(attrs.get(Media.class).toString());
             }
 
-            if (! attrs.containsKey(OrientationRequested.class)) {
+            if (!attrs.containsKey(OrientationRequested.class)) {
                 attrs.add((Attribute) service.getDefaultAttributeValue(OrientationRequested.class));
             }
@@ -400,22 +381,22 @@
             }
 
-            if (! attrs.containsKey(MediaPrintableArea.class)) {
+            if (!attrs.containsKey(MediaPrintableArea.class)) {
                 PageFormat pf = job.defaultPage();
                 attrs.add(new MediaPrintableArea(
-                  (float)pf.getImageableX()/72f,
-                  (float)pf.getImageableY()/72f,
-                  (float)pf.getImageableWidth()/72f,
-                  (float)pf.getImageableHeight()/72f,
-                  MediaPrintableArea.INCH) );
-            }
-            
+                  (float) pf.getImageableX()/72f,
+                  (float) pf.getImageableY()/72f,
+                  (float) pf.getImageableWidth()/72f,
+                  (float) pf.getImageableHeight()/72f,
+                  MediaPrintableArea.INCH));
+            }
+
             PageFormat pf = job.getPageFormat(attrs);
             printPreview.setPageFormat(pf);
         }
     }
-    
+
     /**
      * Handle user input
-     * 
+     *
      * @param e an ActionEvent with one of the known commands
      */
@@ -470,5 +451,5 @@
 
     protected void savePrintSettings() {
-        // Save only one printer service attribute: printer name 
+        // Save only one printer service attribute: printer name
         PrintService service = job.getPrintService();
         if (service != null) {
@@ -476,10 +457,10 @@
             for (Attribute a : service.getAttributes().toArray()) {
                 if ("printer-name".equals(a.getName()) && a instanceof TextSyntax) {
-                    serviceAttributes.add(marshallPrintSetting(a, TextSyntax.class, ((TextSyntax)a).getValue()));
+                    serviceAttributes.add(marshallPrintSetting(a, TextSyntax.class, ((TextSyntax) a).getValue()));
                 }
             }
             Main.pref.putArray("print.settings.service-attributes", serviceAttributes);
         }
-        
+
         // Save all request attributes
         Collection<String> ignoredAttributes = Arrays.asList("media-printable-area");
@@ -488,9 +469,9 @@
             Collection<String> setting = null;
             if (a instanceof TextSyntax) {
-                setting = marshallPrintSetting(a, TextSyntax.class, ((TextSyntax)a).getValue());
+                setting = marshallPrintSetting(a, TextSyntax.class, ((TextSyntax) a).getValue());
             } else if (a instanceof EnumSyntax) {
-                setting = marshallPrintSetting(a, EnumSyntax.class, Integer.toString(((EnumSyntax)a).getValue()));
+                setting = marshallPrintSetting(a, EnumSyntax.class, Integer.toString(((EnumSyntax) a).getValue()));
             } else if (a instanceof IntegerSyntax) {
-                setting = marshallPrintSetting(a, IntegerSyntax.class, Integer.toString(((IntegerSyntax)a).getValue()));
+                setting = marshallPrintSetting(a, IntegerSyntax.class, Integer.toString(((IntegerSyntax) a).getValue()));
             } else if (!ignoredAttributes.contains(a.getName())) {
                 // TODO: Add support for DateTimeSyntax, SetOfIntegerSyntax, ResolutionSyntax if needed
@@ -503,13 +484,13 @@
         Main.pref.putArray("print.settings.request-attributes", requestAttributes);
     }
-    
+
     protected Collection<String> marshallPrintSetting(Attribute a, Class<?> syntaxClass, String value) {
         return new ArrayList<>(Arrays.asList(a.getCategory().getName(), a.getClass().getName(), syntaxClass.getName(), value));
     }
-    
+
     @SuppressWarnings("unchecked")
-    protected Attribute unmarshallPrintSetting(Collection<String> setting) throws 
+    protected Attribute unmarshallPrintSetting(Collection<String> setting) throws
         ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
-        
+
         if (setting == null || setting.size() != 4) {
             throw new IllegalArgumentException("Invalid setting: "+setting);
Index: /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintPlugin.java
===================================================================
--- /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintPlugin.java	(revision 33061)
+++ /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintPlugin.java	(revision 33062)
@@ -1,25 +1,3 @@
-/*
- *      PrintPlugin.java
- *      
- *      Copyright 2011 Kai Pastor
- *      
- *      This program is free software; you can redistribute it and/or modify
- *      it under the terms of the GNU General Public License as published by
- *      the Free Software Foundation; either version 2 of the License, or
- *      (at your option) any later version.
- *      
- *      This program is distributed in the hope that it will be useful,
- *      but WITHOUT ANY WARRANTY; without even the implied warranty of
- *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *      GNU General Public License for more details.
- *      
- *      You should have received a copy of the GNU General Public License
- *      along with this program; if not, write to the Free Software
- *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- *      MA 02110-1301, USA.
- *      
- *      
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.print;
 
@@ -34,6 +12,7 @@
 
 /**
- * The PrintPlugin class implements the interface JOSM needs to 
+ * The PrintPlugin class implements the interface JOSM needs to
  * load extension.
+ * @author Kai Pastor
  */
 public class PrintPlugin extends Plugin {
@@ -84,5 +63,5 @@
 
     /**
-     * Enables/disables the print action in the GUI 
+     * Enables/disables the print action in the GUI
      * when a MapFrame gets shown or removed.
      *
@@ -98,10 +77,10 @@
     /**
      * Temporary adjust the preferences for map printing
-     * 
-     * This will adjust some preferences such that elements which are 
-     * not useful on paper will not be printed. This includes the 
-     * following markup: downloaded area; node markers for connection, 
+     *
+     * This will adjust some preferences such that elements which are
+     * not useful on paper will not be printed. This includes the
+     * following markup: downloaded area; node markers for connection,
      * selected, unselected, tagged state.
-     * 
+     *
      * Changes will be undone by restorePrefs().
      */
@@ -117,10 +96,10 @@
         }
     }
-    
+
     /**
      * Adjust a single preference.
-     * 
+     *
      * Saves the existing value for later restorePref.
-     * 
+     *
      * @param key the preference key
      * @param the temporary new int value
@@ -132,10 +111,10 @@
         Main.pref.putInteger(key, value);
     }
-    
+
     /**
      * Adjust a single preference.
-     * 
+     *
      * Saves the existing value for later restorePref.
-     * 
+     *
      * @param key the preference key
      * @param the temporary new boolean value
@@ -147,10 +126,10 @@
         Main.pref.put(key, value);
     }
-    
+
     /**
      * Adjust a single preference.
-     * 
+     *
      * Saves the existing value for later restorePref.
-     * 
+     *
      * @param key the preference key
      * @param the temporary new String value
@@ -162,5 +141,5 @@
         Main.pref.put(key, value);
     }
-    
+
     /**
      * Undo temporary adjustments to the preferences made by adjustPrefs().
@@ -178,8 +157,8 @@
         }
     }
-    
+
     /**
      * Restore a single preference previously saved by adjustPref()
-     * 
+     *
      * @param key the preference key to be restored
      */
Index: /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintPreview.java
===================================================================
--- /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintPreview.java	(revision 33061)
+++ /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintPreview.java	(revision 33062)
@@ -1,25 +1,3 @@
-/*
- *      PrintPreview.java
- *      
- *      Copyright 2011 Kai Pastor
- *      
- *      This program is free software; you can redistribute it and/or modify
- *      it under the terms of the GNU General Public License as published by
- *      the Free Software Foundation; either version 2 of the License, or
- *      (at your option) any later version.
- *      
- *      This program is distributed in the hope that it will be useful,
- *      but WITHOUT ANY WARRANTY; without even the implied warranty of
- *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *      GNU General Public License for more details.
- *      
- *      You should have received a copy of the GNU General Public License
- *      along with this program; if not, write to the Free Software
- *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- *      MA 02110-1301, USA.
- *      
- *      
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.print;
 
@@ -37,6 +15,6 @@
 import java.awt.print.PrinterException;
 
+import javax.swing.JPanel;
 import javax.swing.JViewport;
-import javax.swing.JPanel;
 import javax.swing.RepaintManager;
 
@@ -45,46 +23,47 @@
 /**
  * A generic print preview component
- * 
- * Given a Printable, a PageFormat and a zoom factor, this component 
- * will render a scrollable and zoomable print preview. If no Printable 
- * is defined, it will fill the printable area of the page format in 
+ *
+ * Given a Printable, a PageFormat and a zoom factor, this component
+ * will render a scrollable and zoomable print preview. If no Printable
+ * is defined, it will fill the printable area of the page format in
  * plain gray.
- * 
+ *
  * There is a special zoom-to-page condition where the component will
  * automatically adjust the zoom level such that the whole page preview
  * will just fit into the size of the component.
+ * @author Kai Pastor
  */
 class PrintPreview extends JPanel {
-    
+
     /**
      * The PageFormat chosen for printing (and preview)
      */
     protected transient PageFormat format;
-    
+
     /**
      * The current zoom factor for the preview
      */
     protected double zoom = 1.0;
-    
-    /**
-     * If true, the preview is always zoomed such that 
+
+    /**
+     * If true, the preview is always zoomed such that
      * the whole page fits into the preview area.
      */
     protected boolean zoomToPage = true;
-    
+
     /**
      * When this flag is true, no painting operations will be performed.
      */
     protected boolean paintingDisabled;
-    
+
     /**
      * the printable object for rendering preview contents
      */
     protected transient Printable printable;
-    
-    /**
-     * Constructs a new preview component 
-     */
-    public PrintPreview() {
+
+    /**
+     * Constructs a new preview component
+     */
+    PrintPreview() {
         super();
     }
@@ -92,8 +71,8 @@
     /**
      * Constructs a new preview component for a printable
-     * 
+     *
      * @param p the printable object for rendering preview contents, or null
      */
-    public PrintPreview(Printable p) {
+    PrintPreview(Printable p) {
         super();
         printable = p;
@@ -102,5 +81,5 @@
     /**
      * Sets (and unsets) the printable object
-     * 
+     *
      * @param p a printable object, or null
      */
@@ -109,8 +88,8 @@
         repaint();
     }
-    
+
     /**
      * Sets the page format
-     * 
+     *
      * @param format the PageFormat chosen for printing (and preview)
      */
@@ -120,17 +99,17 @@
         repaint();
     }
-    
+
     /**
      * Sets the preview zoom relativ to the actual size
      *
-     * @param zoom the zoom factor 
+     * @param zoom the zoom factor
      */
     public void setZoom(double zoom) {
         setZoom(zoom, false);
     }
-    
+
     /**
      * Zoom into the preview
-     * 
+     *
      * Doubles the current zoom factor, if smaller than 5.0.
      */
@@ -141,8 +120,8 @@
         }
     }
- 
+
     /**
      * Zoom out of the preview
-     * 
+     *
      * Set the zoom factor to half its current value, if bigger than 0.1.
      */
@@ -156,5 +135,5 @@
     /**
      * Zoom to fit the page size
-     * 
+     *
      * Set the zoom factor such that the whole page fits into the preview area.
      */
@@ -178,6 +157,6 @@
      * Sets the preview zoom relativ to the actual size
      *
-     * @param zoom the zoom factor 
-     * @param zoomToPage when set to true, the zoom factor will be 
+     * @param zoom the zoom factor
+     * @param zoomToPage when set to true, the zoom factor will be
      *   adjusted on resize operations such that the whole page always
      *   fits to the preview area.
@@ -196,11 +175,13 @@
         this.zoomToPage = zoomToPage;
         revalidate(); // Make JScrollPane aware of the change in size
-        RepaintManager.currentManager(this).validateInvalidComponents(); 
+        RepaintManager.currentManager(this).validateInvalidComponents();
 
         Dimension dim = getZoomedPageDimension();
         Rectangle view = getVisibleRect();
 
-        view.x = (int)((0.5*oldView.width+oldView.x)/Math.max(oldView.width,oldDim.width)*Math.max(view.width,dim.width)-0.5*view.width);
-        view.y = (int)((0.5*oldView.height+oldView.y)/Math.max(oldView.height,oldDim.height)*Math.max(view.height,dim.height)-0.5*view.height);
+        view.x = (int) ((0.5*oldView.width+oldView.x) /
+                Math.max(oldView.width, oldDim.width)*Math.max(view.width, dim.width)-0.5*view.width);
+        view.y = (int) ((0.5*oldView.height+oldView.y) /
+                Math.max(oldView.height, oldDim.height)*Math.max(view.height, dim.height)-0.5*view.height);
 
         scrollRectToVisible(view);
@@ -211,13 +192,13 @@
     /**
      * Returns the actual current zoom
-     * 
+     *
      * This factor might be different from the last explicitly set factor
      * when zoomToPage is true.
-     * 
-     * @return the zoom factor 
+     *
+     * @return the zoom factor
      */
     public double getZoom() {
         if (format != null && (zoomToPage || zoom < 0.01)) {
-            // actually this is zoom-to-page 
+            // actually this is zoom-to-page
             Dimension dim = getParent().getSize();
             int resolution = Toolkit.getDefaultToolkit().getScreenResolution();
@@ -228,8 +209,8 @@
         return zoom;
     }
-        
+
     /**
      * Get the current dimension of the page preview
-     * 
+     *
      * @return dimension in pixels
      */
@@ -237,6 +218,6 @@
         int resolution = Toolkit.getDefaultToolkit().getScreenResolution();
         double z = getZoom();
-        int width = (int)(z * resolution * format.getWidth() / 72.0);
-        int height = (int)(z * resolution * format.getHeight() / 72.0);
+        int width = (int) (z * resolution * format.getWidth() / 72.0);
+        int height = (int) (z * resolution * format.getHeight() / 72.0);
         return new Dimension(width, height);
     }
@@ -244,6 +225,6 @@
     /**
      * Get the current preferred size of the component
-     * 
-     * @return indicates a zero size when zoomToPage is active, 
+     *
+     * @return indicates a zero size when zoomToPage is active,
      *   the zoomed page dimension otherwise
      */
@@ -251,5 +232,5 @@
     public Dimension getPreferredSize() {
         if (format == null || zoomToPage || zoom < 0.01) {
-            return new Dimension(0,0);
+            return new Dimension(0, 0);
         }
         return getZoomedPageDimension();
@@ -258,8 +239,8 @@
     /**
      * Paints the component
-     * 
-     * This will do nothing, not even call super.paintComponent(g), if 
+     *
+     * This will do nothing, not even call super.paintComponent(g), if
      * painting is disabled in this component.
-     * 
+     *
      * @param g a Graphics to draw to
      */
@@ -279,8 +260,8 @@
         Dimension out = getZoomedPageDimension();
         double scale = Math.min(
-          out.getHeight()/format.getHeight() , out.getWidth()/format.getWidth() );
-        double left = 0.5 * ((double)getWidth() - scale * format.getWidth());
-        double top  = 0.5 * ((double)getHeight() - scale * format.getHeight());
-        
+          out.getHeight()/format.getHeight(), out.getWidth()/format.getWidth());
+        double left = 0.5 * (getWidth() - scale * format.getWidth());
+        double top = 0.5 * (getHeight() - scale * format.getHeight());
+
         g2d.translate(left, top);
         g2d.setColor(Color.black);
@@ -304,5 +285,5 @@
         } else {
             g2d.setColor(Color.gray);
-            g2d.fillRect(0, 0, (int)format.getWidth(), (int)format.getHeight());
+            g2d.fillRect(0, 0, (int) format.getWidth(), (int) format.getHeight());
         }
 
Index: /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintableLayerManager.java
===================================================================
--- /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintableLayerManager.java	(revision 33061)
+++ /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintableLayerManager.java	(revision 33062)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.print;
 
Index: /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintableMapView.java
===================================================================
--- /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintableMapView.java	(revision 33061)
+++ /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintableMapView.java	(revision 33062)
@@ -1,25 +1,3 @@
-/*
- *      PrintableMapView.java
- *      
- *      Copyright 2011 Kai Pastor
- *      
- *      This program is free software; you can redistribute it and/or modify
- *      it under the terms of the GNU General Public License as published by
- *      the Free Software Foundation; either version 2 of the License, or
- *      (at your option) any later version.
- *      
- *      This program is distributed in the hope that it will be useful,
- *      but WITHOUT ANY WARRANTY; without even the implied warranty of
- *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *      GNU General Public License for more details.
- *      
- *      You should have received a copy of the GNU General Public License
- *      along with this program; if not, write to the Free Software
- *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- *      MA 02110-1301, USA.
- *      
- *      
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.print;
 
@@ -55,13 +33,13 @@
  * The PrintableMapView class implements a "Printable" perspective on
  * the main MapView.
- * 
+ * @author Kai Pastor
  */
 public class PrintableMapView extends MapView implements Printable {
-    
+
     /**
      * A fixed map scale if greater than zero.
      */
     protected int fixedMapScale = 0;
-    
+
     /**
      * The factor for scaling the printing graphics to the desired
@@ -69,5 +47,5 @@
      */
     protected double g2dFactor;
-    
+
     /**
      * The font size for text added by PrintableMapView
@@ -81,9 +59,9 @@
         /* Initialize MapView with a dummy parent */
         super(new PrintableLayerManager(), new JPanel(), null);
-        
-        /* Disable MapView's ComponentLister, 
+
+        /* Disable MapView's ComponentLister,
          * as it will interfere with the main MapView. */
-        ComponentListener listeners[] = getComponentListeners();
-        for (int i=0; i<listeners.length; i++) {
+        ComponentListener[] listeners = getComponentListeners();
+        for (int i = 0; i < listeners.length; i++) {
             removeComponentListener(listeners[i]);
         }
@@ -92,5 +70,5 @@
     /**
      * Set a fixed map scale 1 : "scale"
-     * 
+     *
      * @param scale the fixed map scale
      */
@@ -102,5 +80,5 @@
     /**
      * Unset the fixed map scale
-     * 
+     *
      * The map scaling will be chosen automatically such that the
      * main windows map view fits on the page format.
@@ -111,7 +89,7 @@
     }
 
-    /** 
+    /**
      * Get the map scale that will be used for rendering
-     */     
+     */
     public int getMapScale() {
         if (fixedMapScale > 0 || g2dFactor == 0.0) {
@@ -127,5 +105,5 @@
      * Initialize the PrintableMapView for a particular combination of
      * main MapView, PageFormat and target resolution
-     * 
+     *
      * @param pageformat the size and orientation of the page being drawn
      */
@@ -133,9 +111,9 @@
         int resolution = Main.pref.getInteger("print.resolution.dpi", PrintPlugin.DEF_RESOLUTION_DPI);
         g2dFactor = 72.0/resolution;
-        setSize((int)(pageFormat.getImageableWidth()/g2dFactor),(int)(pageFormat.getImageableHeight()/g2dFactor));
-    }
-    
-    /**
-     * Resizes this component. 
+        setSize((int) (pageFormat.getImageableWidth()/g2dFactor), (int) (pageFormat.getImageableHeight()/g2dFactor));
+    }
+
+    /**
+     * Resizes this component.
      */
     @Override
@@ -148,7 +126,7 @@
         }
     }
-            
-    /**
-     * Resizes this component. 
+
+    /**
+     * Resizes this component.
      */
     @Override
@@ -176,15 +154,15 @@
     /**
      * Render a page for the printer
-     * 
+     *
      * Implements java.awt.print.Printable.
      *
      * @param g the context into which the page is drawn
      * @param pageFormat the size and orientation of the page being drawn
-     * @param page the zero based index of the page to be drawn 
-     * 
+     * @param page the zero based index of the page to be drawn
+     *
      * @return PAGE_EXISTS for page==0 or NO_SUCH_PAGE for page>0
-     * 
+     *
      * @throws PrinterException thrown when the print job is terminated
-     * 
+     *
      */
     @Override
@@ -197,5 +175,5 @@
         initialize(pageFormat);
 
-        Graphics2D g2d = (Graphics2D)g;
+        Graphics2D g2d = (Graphics2D) g;
         g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
         paintMap(g2d, pageFormat);
@@ -204,11 +182,11 @@
         return PAGE_EXISTS;
     }
-    
-    /** 
+
+    /**
      * Paint the map
-     * 
+     *
      * This implementation is derived from MapView's paint and
      * from other JOSM core components.
-     * 
+     *
      * @param g2d the graphics context to use for painting
      * @param pageFormat the size and orientation of the page being drawn
@@ -217,9 +195,9 @@
         AffineTransform at = g2d.getTransform();
         g2d.scale(g2dFactor, g2dFactor);
-        
+
         Bounds box = getRealBounds();
         for (Layer l : getLayerManager().getVisibleLayersInZOrder()) {
             if (l.getOpacity() < 1) {
-                g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,(float)l.getOpacity()));
+                g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float) l.getOpacity()));
             }
             l.paint(g2d, this, box);
@@ -230,8 +208,8 @@
     }
 
-    /** 
+    /**
      * Paint a linear scale and a lexical scale
-     * 
-     * This implementation is derived from JOSM's MapScaler, 
+     *
+     * This implementation is derived from JOSM's MapScaler,
      * NavigatableComponent and SystemOfMeasurement.
      *
@@ -253,9 +231,7 @@
         if (distMantissa <= 2.5) {
             distScale = 2.5 / distMantissa;
-        }
-        else if (distMantissa <= 4.0) {
+        } else if (distMantissa <= 4.0) {
             distScale = 5.0 / distMantissa;
-        }
-        else {
+        } else {
             distScale = 10.0 / distMantissa;
         }
@@ -269,32 +245,34 @@
         /* offset from the left paper border to the left end of the bar */
         Rectangle2D bound = g2d.getFontMetrics().getStringBounds("0", g2d);
-        int xLeft = (int)(bound.getWidth()/2);
-        
+        int xLeft = (int) (bound.getWidth()/2);
+
         /* offset from the left paper border to the right label */
         String rightLabel = som.getDistText(dist100px * distScale);
         bound = g2d.getFontMetrics().getStringBounds(rightLabel, g2d);
         int xRight = xLeft+(int) Math.max(0.95*x, x-bound.getWidth()/2);
-        
+
+        // CHECKSTYLE.OFF: SingleSpaceSeparator
         int h        = FONT_SIZE / 2; // raster, height of the bar
         int yLexical = 3 * h;         // baseline of the lexical scale
         int yBar     = 4 * h;         // top of the bar
         int yLabel   = 8 * h;         // baseline of the labels
-        int w  = (int)(distScale * 100.0);  // length of the bar
-        int ws = (int)(distScale * 20.0);   // length of a segment
-        
+        int w  = (int) (distScale * 100.0);  // length of the bar
+        int ws = (int) (distScale * 20.0);   // length of a segment
+        // CHECKSTYLE.ON: SingleSpaceSeparator
+
         /* white background */
         g2d.setColor(Color.WHITE);
         g2d.fillRect(xLeft-1, yBar-1, w+2, h+2);
-        
+
         /* black foreground */
         g2d.setColor(Color.BLACK);
         g2d.drawRect(xLeft, yBar, w, h);
         g2d.fillRect(xLeft, yBar, ws, h);
-        g2d.fillRect(xLeft+(int)(distScale * 40.0), yBar, ws, h);
+        g2d.fillRect(xLeft+(int) (distScale * 40.0), yBar, ws, h);
         g2d.fillRect(xLeft+w-ws, yBar, ws, h);
         g2d.setFont(labelFont);
         paintText(g2d, "0", 0, yLabel);
         paintText(g2d, rightLabel, xRight, yLabel);
-        
+
         /* lexical scale */
         int mapScale = getMapScale();
@@ -304,11 +282,11 @@
         g2d.setFont(scaleFront);
         bound = g2d.getFontMetrics().getStringBounds(lexicalScale, g2d);
-        int xLexical = Math.max(0, xLeft + (w - (int)bound.getWidth()) / 2);
+        int xLexical = Math.max(0, xLeft + (w - (int) bound.getWidth()) / 2);
         paintText(g2d, lexicalScale, xLexical, yLexical);
     }
-    
-    /** 
+
+    /**
      * Paint an attribution text
-     * 
+     *
      * @param g2d the graphics context to use for painting
      * @param pageFormat the size and orientation of the page being drawn
@@ -316,9 +294,9 @@
     public void paintMapAttribution(Graphics2D g2d, PageFormat pageFormat) {
         String text = Main.pref.get("print.attribution", AbstractOsmTileSource.DEFAULT_OSM_ATTRIBUTION);
-        
+
         if (text == null) {
             return;
         }
-            
+
         Font attributionFont = new Font("Arial", Font.PLAIN, FONT_SIZE * 8 / 10);
         g2d.setFont(attributionFont);
@@ -327,24 +305,24 @@
         int y = FONT_SIZE * 3 / 2;
         int from = 0;
-        int to = text.indexOf("\n", from);
+        int to = text.indexOf('\n', from);
         while (to >= from) {
             String line = text.substring(from, to);
 
             Rectangle2D bound = g2d.getFontMetrics().getStringBounds(line, g2d);
-            int x = (int)((pageFormat.getImageableWidth() - bound.getWidth()) - FONT_SIZE/2);
-            
+            int x = (int) ((pageFormat.getImageableWidth() - bound.getWidth()) - FONT_SIZE/2);
+
             paintText(g2d, line, x, y);
 
-            y   += FONT_SIZE * 5 / 4;
+            y += FONT_SIZE * 5 / 4;
             from = to + 1;
-            to   = text.indexOf("\n", from);
-        }
-    }
-    
+            to = text.indexOf('\n', from);
+        }
+    }
+
     /**
      * Paint a text.
-     * 
+     *
      * This method will not only draw the letters but also a background which improves redability.
-     * 
+     *
      * @param g2d the graphics context to use for painting
      * @param text the text to be drawn
