Changeset 6767 in josm for trunk/src


Ignore:
Timestamp:
2014-01-29T16:18:16+01:00 (10 years ago)
Author:
Don-vip
Message:

javadoc for gui.preferences.advanced package

Location:
trunk/src/org/openstreetmap/josm/gui/preferences/advanced
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java

    r6578 r6767  
    4848import org.openstreetmap.josm.tools.GBC;
    4949
     50/**
     51 * Advanced preferences, allowing to set preference entries directly.
     52 */
    5053public final class AdvancedPreference extends DefaultTabPreferenceSetting {
    5154
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileAction.java

    r6316 r6767  
    2929    private final Preferences prefs;
    3030
     31    /**
     32     * Constructs a new {@code ExportProfileAction}.
     33     */
    3134    public ExportProfileAction(Preferences prefs, String schemaKey, String prefPattern) {
    3235        super(tr("Save {0} profile", tr(schemaKey)));
     
    3538        this.schemaKey = schemaKey;
    3639    }
    37    
     40
    3841    @Override
    3942    public void actionPerformed(ActionEvent ae) {
     
    5457           CustomConfigurator.exportPreferencesKeysToFile(f.getAbsolutePath(), false, keys);
    5558    }
    56    
     59
    5760    private File askUserForCustomSettingsFile() {
    5861        String title = tr("Choose profile file");
    59        
     62
    6063        FileFilter filter = new FileFilter() {
    6164            @Override
     
    7679            }
    7780            return sel;
    78         } 
     81        }
    7982        return null;
    8083    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java

    r6452 r6767  
    2525import org.openstreetmap.josm.tools.WindowGeometry;
    2626
     27/**
     28 * Editor for List preference entries.
     29 */
    2730public class ListEditor extends ExtendedDialog {
    2831
     
    3235    /**
    3336     * Constructs a new {@code ListEditor}.
     37     * @param gui The parent component
    3438     */
    3539    public ListEditor(final JComponent gui, PrefEntry entry, ListSetting setting) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListListEditor.java

    r6084 r6767  
    3333import org.openstreetmap.josm.tools.WindowGeometry;
    3434
     35/**
     36 * Editor for List of Lists preference entries.
     37 */
    3538public class ListListEditor extends ExtendedDialog {
    3639
     
    4548    ListTableModel tableModel;
    4649
     50    /**
     51     * Constructs a new {@code ListListEditor}.
     52     * @param gui The parent component
     53     */
    4754    public ListListEditor(final JComponent gui, PrefEntry entry, ListListSetting setting) {
    4855        super(gui, tr("Change list of lists setting"), new String[] {tr("OK"), tr("Cancel")});
     
    6067    }
    6168
     69    /**
     70     * Returns the data.
     71     * @return the preference data
     72     */
    6273    public List<List<String>> getData() {
    6374        return data;
     
    220231        }
    221232    }
    222 
    223233}
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/MapListEditor.java

    r6084 r6767  
    3737import org.openstreetmap.josm.tools.WindowGeometry;
    3838
     39/**
     40 * Editor for List of Maps preference entries.
     41 */
    3942public class MapListEditor extends ExtendedDialog {
    4043
     
    7477    }
    7578
     79    /**
     80     * Returns the data.
     81     * @return the preference data
     82     */
    7683    public List<Map<String,String>> getData() {
    7784        List<Map<String,String>> data = new ArrayList<Map<String,String>>();
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PrefEntry.java

    r6022 r6767  
    66
    77/**
    8  * Class to store single preference line for the table
    9  * @since 6021 : extracted from AdvancedPreference class
     8 * Class to store single preference line for the table.
     9 * @since 6021
    1010 */
    1111public class PrefEntry implements Comparable<PrefEntry> {
     
    1616    private boolean changed;
    1717
     18    /**
     19     * Constructs a new {@code PrefEntry}.
     20     * @param key The preference key
     21     * @param value The preference value
     22     * @param defaultValue The preference default value
     23     * @param isDefault determines if the current value is the default value
     24     */
    1825    public PrefEntry(String key, Preferences.Setting value, Preferences.Setting defaultValue, boolean isDefault) {
    1926        CheckParameterUtil.ensureParameterNotNull(key);
     
    2633    }
    2734
     35    /**
     36     * Returns the preference key.
     37     * @return the preference key
     38     */
    2839    public String getKey() {
    2940        return key;
    3041    }
    3142
     43    /**
     44     * Returns the preference value.
     45     * @return the preference value
     46     */
    3247    public Preferences.Setting getValue() {
    3348        return value;
    3449    }
    3550
     51    /**
     52     * Returns the preference default value.
     53     * @return the preference default value
     54     */
    3655    public Preferences.Setting getDefaultValue() {
    3756        return defaultValue;
    3857    }
    3958
     59    /**
     60     * Sets the preference value.
     61     * @param value the preference value
     62     */
    4063    public void setValue(Preferences.Setting value) {
    4164        this.value = value;
     
    4467    }
    4568
     69    /**
     70     * Determines if the current value is the default value.
     71     * @return {@code true} if the current value is the default value, {@code false} otherwise
     72     */
    4673    public boolean isDefault() {
    4774        return isDefault;
    4875    }
    4976
     77    /**
     78     * Determines if this preference entry has been modified.
     79     * @return {@code true} if this preference entry has been modified, {@code false} otherwise
     80     */
    5081    public boolean isChanged() {
    5182        return changed;
    5283    }
    5384
     85    /**
     86     * Marks this preference entry as modified.
     87     */
    5488    public void markAsChanged() {
    5589        changed = true;
    5690    }
    5791
     92    /**
     93     * Resets this preference entry to default state.
     94     */
    5895    public void reset() {
    5996        value = defaultValue;
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java

    r6603 r6767  
    3434
    3535/**
    36  * Component for editing list of preferences as a table
    37  * @since 6021 : extracted from AdvancedPreference class
     36 * Component for editing list of preferences as a table.
     37 * @since 6021
    3838 */
    3939public class PreferencesTable extends JTable {
     
    4141    private final List<PrefEntry> displayData;
    4242
     43    /**
     44     * Constructs a new {@code PreferencesTable}.
     45     * @param displayData The list of preferences entries to display
     46     */
    4347    public PreferencesTable(List<PrefEntry> displayData) {
    4448        this.displayData = displayData;
     
    4852        getColumnModel().getColumn(1).setCellRenderer(new SettingCellRenderer());
    4953        getColumnModel().getColumn(1).setCellEditor(new SettingCellEditor());
    50        
    51         addMouseListener(new MouseAdapter(){
     54
     55        addMouseListener(new MouseAdapter() {
    5256            @Override public void mouseClicked(MouseEvent e) {
    5357                if (e.getClickCount() == 2) {
     
    5761        });
    5862    }
    59    
     63
    6064    /**
    6165     * This method should be called when displayed data was changed form external code
     
    6468        model.fireTableDataChanged();
    6569    }
    66    
    67    
     70
    6871    /**
    6972     * The list of currently selected rows
     
    7881        return entries;
    7982    }
    80    
     83
    8184    /**
    8285     * Call this to edit selected row in preferences table
     
    138141        return false;
    139142    }
    140    
     143
    141144    /**
    142145     * Add new preference to the table
     
    228231            }
    229232        }
    230         if (ok) 
    231             return pe; 
    232         else 
     233        if (ok)
     234            return pe;
     235        else
    233236            return null;
    234237    }
     
    254257        fireDataChanged();
    255258    }
    256    
     259
    257260    private class AllSettingsTableModel extends DefaultTableModel {
    258261
     
    299302                            marktr("Advanced Background: NonDefault"),
    300303                            new Color(255,255,200));
    301        
     304
    302305        @Override
    303306        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
     
    308311            Object val = setting.getValue();
    309312            String display = val != null ? val.toString() : "<html><i>&lt;"+tr("unset")+"&gt;</i></html>";
    310            
     313
    311314            JLabel label = (JLabel)super.getTableCellRendererComponent(table,
    312315                    display, isSelected, hasFocus, row, column);
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/StringEditor.java

    r6021 r6767  
    55
    66import java.awt.GridBagLayout;
     7
    78import javax.swing.JComponent;
    8 
    99import javax.swing.JLabel;
    1010import javax.swing.JPanel;
     
    1515import org.openstreetmap.josm.tools.GBC;
    1616
     17/**
     18 * Editor for String preference entries.
     19 */
    1720public class StringEditor extends ExtendedDialog {
    1821
     
    2023    JosmTextField tvalue;
    2124
     25    /**
     26     * Constructs a new {@code StringEditor}.
     27     * @param gui The parent component
     28     */
    2229    public StringEditor(final JComponent gui, PrefEntry entry, StringSetting setting) {
    2330        super(gui, tr("Change string setting"), new String[] {tr("OK"), tr("Cancel")});
     
    2734    }
    2835
     36    /**
     37     * Returns the data.
     38     * @return the preference data
     39     */
    2940    public String getData() {
    3041        return tvalue.getText();
Note: See TracChangeset for help on using the changeset viewer.