Changeset 6764 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2014-01-28T11:23:54+01:00 (10 years ago)
Author:
Don-vip
Message:

javadoc for gui.preferences.display package

Location:
trunk/src/org/openstreetmap/josm/gui/preferences/display
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java

    r6624 r6764  
    4949import org.openstreetmap.josm.tools.GBC;
    5050
     51/**
     52 * Color preferences.
     53 */
    5154public class ColorPreference implements SubPreferenceSetting {
    5255
     
    6568    private List<String> del = new ArrayList<String>();
    6669
    67     JButton colorEdit;
    68     JButton defaultSet;
    69     JButton remove;
     70    private JButton colorEdit;
     71    private JButton defaultSet;
     72    private JButton remove;
    7073
    7174    /**
     
    108111        }
    109112    }
    110    
     113
    111114    private void addColorRows(Map<String, String> colorMap, Map<String, String> keyMap) {
    112115        for (String value : keyMap.values()) {
     
    139142    }
    140143
    141     private String getName(String o)
    142     {
     144    private String getName(String o) {
    143145        return Main.pref.getColorName(o);
    144146    }
     
    251253    }
    252254
    253     Boolean isRemoveColor(int row)
    254     {
     255    Boolean isRemoveColor(int row) {
    255256        return ((String)colors.getValueAt(row, 0)).startsWith("layer ");
    256257    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/DisplayPreference.java

    r6529 r6764  
    1212import org.openstreetmap.josm.tools.GBC;
    1313
     14/**
     15 * Display preferences (various settings that influence the visual representation of the whole program).
     16 * @since 4969
     17 */
    1418public final class DisplayPreference extends DefaultTabPreferenceSetting {
    1519
     
    2327        }
    2428    }
    25    
     29
    2630    private DisplayPreference() {
    2731        super("display", tr("Display Settings"), tr("Various settings that influence the visual representation of the whole program."), false, new JTabbedPane());
    2832    }
    29    
     33
    3034    @Override
    3135    public boolean ok() {
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java

    r6529 r6764  
    2424import org.openstreetmap.josm.tools.GBC;
    2525
     26/**
     27 * Map drawing preferences.
     28 */
    2629public class DrawingPreference implements SubPreferenceSetting {
    2730
     
    127130        discardableKeys.setToolTipText(tr("Display keys which have been deemed uninteresting to the point that they can be silently removed."));
    128131        discardableKeys.setSelected(Main.pref.getBoolean("display.discardable-keys", false));
    129        
     132
    130133        JLabel performanceLabel = new JLabel(tr("Options that affect drawing performance"));
    131134
     
    169172    @Override
    170173    public boolean ok() {
    171         gpxPanel.savePreferences();
     174        boolean restart = gpxPanel.savePreferences();
    172175        Main.pref.put("draw.data.area_outline_only", outlineOnly.isSelected());
    173176        Main.pref.put("draw.segment.direction", directionHint.isSelected());
     
    192195        }
    193196        Main.pref.putInteger("mappaint.node.virtual-size", vn);
    194         return false;
     197        return restart;
    195198    }
    196199
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java

    r6267 r6764  
    2727import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.ValidationListener;
    2828import org.openstreetmap.josm.gui.widgets.JosmComboBox;
     29import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2930import org.openstreetmap.josm.tools.GBC;
    3031import org.openstreetmap.josm.tools.template_engine.ParseError;
    3132import org.openstreetmap.josm.tools.template_engine.TemplateParser;
    32 import org.openstreetmap.josm.gui.widgets.JosmTextField;
    33 
     33
     34/**
     35 * Panel for GPX settings.
     36 */
    3437public class GPXSettingsPanel extends JPanel implements ValidationListener {
    3538
     
    7174
    7275    private String layerName;
    73     private boolean local; // flag to display LocalOnly checkbox
    74     private boolean nonlocal; // flag to display AllLines checkbox
    75 
     76    private final boolean local; // flag to display LocalOnly checkbox
     77    private final boolean nonlocal; // flag to display AllLines checkbox
     78
     79    /**
     80     * Constructs a new {@code GPXSettingsPanel} for a given layer name.
     81     * @param layerName The GPX layer name
     82     * @param local flag to display LocalOnly checkbox
     83     * @param nonlocal flag to display AllLines checkbox
     84     */
    7685    public GPXSettingsPanel(String layerName, boolean local, boolean nonlocal) {
    7786        super(new GridBagLayout());
    78         this.local=local; this.nonlocal=nonlocal;
     87        this.local=local;
     88        this.nonlocal=nonlocal;
    7989        this.layerName = "layer "+layerName;
    8090        initComponents();
     
    8292    }
    8393
     94    /**
     95     * Constructs a new {@code GPXSettingsPanel}.
     96     */
    8497    public GPXSettingsPanel() {
    8598        super(new GridBagLayout());
    8699        initComponents();
    87         local=false; nonlocal=false;
     100        local=false;
     101        nonlocal=false;
    88102        loadPreferences(); // preferences -> controls
    89103    }
     
    356370
    357371    /**
    358      * Save preferences from UI controls for specified layer
    359      * if layerName==null, global preferences are written
     372     * Save preferences from UI controls, globally or for a specified layer.
     373     * @param layerName The GPX layer name. Can be {@code null}, in that case, global preferences are written
     374     * @param locLayer {@code true} if the GPX layer is a local one. Ignored if {@code layerName} is null
     375     * @return {@code true} when restart is required, {@code false} otherwise
    360376     */
    361     public boolean savePreferences (String layerName, boolean locLayer) {
     377    public boolean savePreferences(String layerName, boolean locLayer) {
    362378        String layerNameDot = ".layer "+layerName;
    363379        if (layerName==null) {
     
    421437    /**
    422438     * Save preferences from UI controls for initial layer or globally
     439     * @return {@code true} when restart is required, {@code false} otherwise
    423440     */
    424     public void savePreferences() {
    425         savePreferences(null, false);
     441    public boolean savePreferences() {
     442        return savePreferences(null, false);
    426443    }
    427444
     
    472489        return true;
    473490    }
    474 
    475491}
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java

    r6752 r6764  
    3030import org.openstreetmap.josm.tools.GBC;
    3131
     32/**
     33 * Look-and-feel preferences.
     34 */
    3235public class LafPreference implements SubPreferenceSetting {
    3336
     
    4649     */
    4750    private JosmComboBox lafCombo;
    48     public JPanel panel;
     51    JPanel panel;
    4952    private JCheckBox showSplashScreen = new JCheckBox(tr("Show splash screen at startup"));
    5053    private JCheckBox showID = new JCheckBox(tr("Show object ID in selection lists"));
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java

    r6529 r6764  
    2828import org.openstreetmap.josm.tools.I18n;
    2929
     30/**
     31 * Language preferences.
     32 */
    3033public class LanguagePreference implements SubPreferenceSetting {
    3134
Note: See TracChangeset for help on using the changeset viewer.