Ignore:
Timestamp:
2016-07-04T14:18:17+02:00 (8 years ago)
Author:
donvip
Message:

checkstyle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java

    r30703 r32556  
    1 // License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
     1// License: GPL. For details, see LICENSE file.
    22package cadastre_fr;
    33
     
    77import java.awt.event.ActionEvent;
    88import java.awt.event.ActionListener;
    9 import javax.swing.*;
     9
     10import javax.swing.AbstractButton;
     11import javax.swing.BorderFactory;
     12import javax.swing.Box;
     13import javax.swing.ButtonGroup;
     14import javax.swing.JCheckBox;
     15import javax.swing.JComboBox;
     16import javax.swing.JLabel;
     17import javax.swing.JPanel;
     18import javax.swing.JRadioButton;
     19import javax.swing.JScrollPane;
     20import javax.swing.JSeparator;
     21import javax.swing.JSlider;
     22import javax.swing.JTextField;
     23import javax.swing.SwingConstants;
    1024
    1125import org.openstreetmap.josm.Main;
     
    1933 * Preference settings for the French Cadastre plugin
    2034 *
    21  * @author Pieren <pieren3@gmail.com>
     35 * @author Pieren &lt;pieren3@gmail.com&gt;
    2236 */
    2337public class CadastrePreferenceSetting extends DefaultTabPreferenceSetting {
     
    4256
    4357    private JCheckBox enableTableauAssemblage = new JCheckBox(tr("Use \"Tableau d''assemblage\""));
    44    
     58
    4559    private JCheckBox simplify2BitsColors = new JCheckBox(tr("Replace grey shades by white color only"));
    4660
     
    92106
    93107    static final int DEFAULT_CROSSPIECES = 0;
    94    
     108
    95109    static final String DEFAULT_GRAB_MULTIPLIER = Scale.SQUARE_100M.value;
    96110
     
    108122    }
    109123
     124    @Override
    110125    public void addGui(final PreferenceTabbedPane gui) {
    111126        JPanel cadastrewmsMast = gui.createPreferenceTab(this);
    112127
    113128        JPanel cadastrewms = new JPanel(new GridBagLayout());
    114         cadastrewms.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
     129        cadastrewms.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    115130
    116131        // option to automatically set the source tag when uploading
     
    128143        // option to reverse the grey colors (to see texts background)
    129144        reversGrey.setSelected(Main.pref.getBoolean("cadastrewms.invertGrey", false));
    130         reversGrey.setToolTipText(tr("Invert the original black and white colors (and all intermediate greys). Useful for texts on dark backgrounds."));
     145        reversGrey.setToolTipText(
     146                tr("Invert the original black and white colors (and all intermediate greys). Useful for texts on dark backgrounds."));
    131147        cadastrewms.add(reversGrey, GBC.eop().insets(0, 0, 0, 0));
    132148
    133149        // option to enable transparency
    134150        transparency.addActionListener(new ActionListener() {
     151            @Override
    135152            public void actionPerformed(ActionEvent e) {
    136153                sliderTrans.setEnabled(transparency.isSelected());
     
    146163        sliderTrans.setMajorTickSpacing(10);
    147164        sliderTrans.setMinorTickSpacing(1);
    148         sliderTrans.setValue((int)(Float.parseFloat(Main.pref.get("cadastrewms.brightness", "1.0f"))*10));
     165        sliderTrans.setValue((int) (Float.parseFloat(Main.pref.get("cadastrewms.brightness", "1.0f"))*10));
    149166        sliderTrans.setPaintTicks(true);
    150167        sliderTrans.setPaintLabels(false);
     
    201218        ButtonGroup bgGrabMultiplier = new ButtonGroup();
    202219        ActionListener multiplierActionListener = new ActionListener() {
     220            @Override
    203221            public void actionPerformed(ActionEvent actionEvent) {
    204222              AbstractButton button = (AbstractButton) actionEvent.getSource();
     
    208226        grabMultiplier1.setIcon(ImageProvider.get("preferences", "unsel_box_1"));
    209227        grabMultiplier1.setSelectedIcon(ImageProvider.get("preferences", "sel_box_1"));
    210         grabMultiplier1.addActionListener( multiplierActionListener);
     228        grabMultiplier1.addActionListener(multiplierActionListener);
    211229        grabMultiplier1.setToolTipText(tr("Grab one image full screen"));
    212230        grabMultiplier2.setIcon(ImageProvider.get("preferences", "unsel_box_2"));
    213231        grabMultiplier2.setSelectedIcon(ImageProvider.get("preferences", "sel_box_2"));
    214         grabMultiplier2.addActionListener( multiplierActionListener);
     232        grabMultiplier2.addActionListener(multiplierActionListener);
    215233        grabMultiplier2.setToolTipText(tr("Grab smaller images (higher quality but use more memory)"));
    216234        grabMultiplier3.setIcon(ImageProvider.get("preferences", "unsel_box_3"));
    217235        grabMultiplier3.setSelectedIcon(ImageProvider.get("preferences", "sel_box_3"));
    218         grabMultiplier3.addActionListener( multiplierActionListener);
     236        grabMultiplier3.addActionListener(multiplierActionListener);
    219237        grabMultiplier3.setToolTipText(tr("Grab smaller images (higher quality but use more memory)"));
    220238        grabMultiplier4.setIcon(ImageProvider.get("preferences", "unsel_box_4"));
    221239        grabMultiplier4.setSelectedIcon(ImageProvider.get("preferences", "sel_box_4"));
    222         grabMultiplier4.addActionListener( multiplierActionListener);
     240        grabMultiplier4.addActionListener(multiplierActionListener);
    223241        grabMultiplier4.setToolTipText(tr("Fixed size square (default is 100m)"));
    224242        bgGrabMultiplier.add(grabMultiplier1);
     
    321339        // option to enable automatic caching
    322340        enableCache.addActionListener(new ActionListener() {
     341            @Override
    323342            public void actionPerformed(ActionEvent e) {
    324343                jLabelCacheSize.setEnabled(enableCache.isSelected());
     
    356375        cadastrewms.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
    357376        JScrollPane scrollpane = new JScrollPane(cadastrewms);
    358         scrollpane.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0 ));
     377        scrollpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    359378        cadastrewmsMast.add(scrollpane, GBC.eol().fill(GBC.BOTH));
    360379    }
    361380
     381    @Override
    362382    public boolean ok() {
    363383        Main.pref.put("cadastrewms.source", sourcing.getText());
     
    366386        Main.pref.put("cadastrewms.invertGrey", reversGrey.isSelected());
    367387        Main.pref.put("cadastrewms.backgroundTransparent", transparency.isSelected());
    368         Main.pref.put("cadastrewms.brightness", Float.toString((float)sliderTrans.getValue()/10));
     388        Main.pref.put("cadastrewms.brightness", Float.toString((float) sliderTrans.getValue()/10));
    369389        Main.pref.put("cadastrewms.drawBoundaries", drawBoundaries.isSelected());
    370390        if (grabRes1.isSelected())
     
    392412                if (squareSize >= 25 && squareSize <= 1000)
    393413                    Main.pref.put("cadastrewms.squareSize", grabMultiplier4Size.getText());
    394             } catch (NumberFormatException e) { // ignore the last input
     414            } catch (NumberFormatException e) {
     415                Main.debug(e);
    395416            }
    396417        }
     
    408429            if (i > 0 && i < 13)
    409430                Main.pref.put("cadastrewms.rasterDivider", String.valueOf(i));
    410         } catch (NumberFormatException e) { // ignore the last input
     431        } catch (NumberFormatException e) {
     432            Main.debug(e);
    411433        }
    412434        Main.pref.put("cadastrewms.noImageCropping", disableImageCropping.isSelected());
     
    423445            CacheControl.cacheSize = Integer.parseInt(cacheSize.getText());
    424446            Main.pref.put("cadastrewms.cacheSize", String.valueOf(CacheControl.cacheSize));
    425         } catch (NumberFormatException e) { // ignore the last input
     447        } catch (NumberFormatException e) {
     448            Main.debug(e);
    426449        }
    427450        Main.pref.put("cadastrewms.autoFirstLayer", autoFirstLayer.isSelected());
Note: See TracChangeset for help on using the changeset viewer.