Class GridPreference
- java.lang.Object
-
- org.openstreetmap.josm.gui.preferences.DefaultPreferenceSetting
-
- org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting
-
- org.openstreetmap.josm.gui.preferences.display.GridPreference
-
- All Implemented Interfaces:
PreferenceSetting,TabPreferenceSetting
public class GridPreference extends DefaultTabPreferenceSetting
Settings of the grid drawn over the map, seeMapGridPaintable.- Since:
- 19640
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGridPreference.FactoryFactory used to create a newGridPreference.private static classGridPreference.TranslatedRenderer<T>Renders enum values with a translated name
-
Field Summary
Fields Modifier and Type Field Description private JosmComboBox<BlendComposite.Mode>blendModeprivate javax.swing.JCheckBoxenabledprivate static java.text.DecimalFormatFORMATprivate JosmTextFieldlineWidthprivate JosmTextFieldminPixelSpacingprivate JosmTextFieldoriginXprivate javax.swing.JLabeloriginXLabelprivate JosmTextFieldoriginYprivate javax.swing.JLabeloriginYLabelprivate JosmTextFieldrotationprivate JosmTextFieldspacingXprivate javax.swing.JLabelspacingXLabelprivate JosmTextFieldspacingYprivate javax.swing.JLabelspacingYLabelprivate JosmComboBox<MapGridPaintable.GridType>type
-
Constructor Summary
Constructors Constructor Description GridPreference()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddGui(PreferenceTabbedPane gui)Add the GUI elements to the dialog.private static java.lang.StringblendModeName(BlendComposite.Mode mode)java.lang.StringgetHelpContext()Returns the help context for this preferences settings tab.booleanisExpert()Called to know if the preferences tab has only to be displayed in expert mode.booleanok()Called when OK is pressed to save the setting in the preferences file.private static voidsave(JosmTextField field, DoubleProperty property, boolean positive)private static voidset(JosmTextField field, DoubleProperty property)private voidupdateLabels()-
Methods inherited from class org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting
addSubTab, addSubTab, canBeHidden, createPreferenceTabWithScrollPane, getDescription, getIconName, getSelectedSubTab, getSubTab, getTabPane, getTitle, getTooltip, registerSubTab, selectSubTab
-
Methods inherited from class org.openstreetmap.josm.gui.preferences.DefaultPreferenceSetting
saveBoolean, saveDouble, saveInt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.gui.preferences.TabPreferenceSetting
getIcon
-
-
-
-
Field Detail
-
FORMAT
private static final java.text.DecimalFormat FORMAT
-
enabled
private final javax.swing.JCheckBox enabled
-
type
private final JosmComboBox<MapGridPaintable.GridType> type
-
spacingX
private final JosmTextField spacingX
-
spacingY
private final JosmTextField spacingY
-
rotation
private final JosmTextField rotation
-
originX
private final JosmTextField originX
-
originY
private final JosmTextField originY
-
minPixelSpacing
private final JosmTextField minPixelSpacing
-
lineWidth
private final JosmTextField lineWidth
-
blendMode
private final JosmComboBox<BlendComposite.Mode> blendMode
-
spacingXLabel
private final javax.swing.JLabel spacingXLabel
-
spacingYLabel
private final javax.swing.JLabel spacingYLabel
-
originXLabel
private final javax.swing.JLabel originXLabel
-
originYLabel
private final javax.swing.JLabel originYLabel
-
-
Constructor Detail
-
GridPreference
GridPreference()
-
-
Method Detail
-
addGui
public void addGui(PreferenceTabbedPane gui)
Description copied from interface:PreferenceSettingAdd the GUI elements to the dialog. The elements should be initialized after the current preferences.- Parameters:
gui- the preferences tab pane
-
blendModeName
private static java.lang.String blendModeName(BlendComposite.Mode mode)
-
updateLabels
private void updateLabels()
-
set
private static void set(JosmTextField field, DoubleProperty property)
-
save
private static void save(JosmTextField field, DoubleProperty property, boolean positive)
-
ok
public boolean ok()
Description copied from interface:PreferenceSettingCalled when OK is pressed to save the setting in the preferences file. Return true when restart is required.- Returns:
trueif restart is required
-
isExpert
public boolean isExpert()
Description copied from interface:PreferenceSettingCalled to know if the preferences tab has only to be displayed in expert mode.- Specified by:
isExpertin interfacePreferenceSetting- Overrides:
isExpertin classDefaultPreferenceSetting- Returns:
- true if the tab has only to be displayed in expert mode, false otherwise.
-
getHelpContext
public java.lang.String getHelpContext()
Description copied from interface:TabPreferenceSettingReturns the help context for this preferences settings tab.- Specified by:
getHelpContextin interfaceTabPreferenceSetting- Overrides:
getHelpContextin classDefaultTabPreferenceSetting- Returns:
- the help context for this preferences settings tab
-
-