Class StrokeProperty
java.lang.Object
org.openstreetmap.josm.data.preferences.AbstractProperty<T>
org.openstreetmap.josm.data.preferences.AbstractToStringProperty<BasicStroke>
org.openstreetmap.josm.data.preferences.StrokeProperty
A property that stores a
BasicStroke.- Since:
- 10874
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.preferences.AbstractToStringProperty
AbstractToStringProperty.ChildProperty<T>Nested classes/interfaces inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
AbstractProperty.InvalidPreferenceValueException, AbstractProperty.ValueChangeEvent<T>, AbstractProperty.ValueChangeListener<T> -
Field Summary
Fields inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
defaultValue, key, preferences -
Constructor Summary
ConstructorsConstructorDescriptionStrokeProperty(String key, BasicStroke defaultStroke) Create a new stroke property from a stroke object.StrokeProperty(String key, String defaultValue) Create a new stroke property from a string. -
Method Summary
Modifier and TypeMethodDescriptionprotected BasicStrokefromString(String string) Converts the string to an object of the given type.static BasicStrokegetFromString(String code) Return s new BasicStroke object with given thickness and styleprivate static float[]toDashArray(List<Double> dashes) protected StringConverts the string to an object of the given type.Methods inherited from class org.openstreetmap.josm.data.preferences.AbstractToStringProperty
get, getAsString, getChildProperty, getSpecialized, putMethods inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
addListener, addListenerImpl, addWeakListener, cached, equals, getDefaultValue, getKey, getPreferences, hashCode, isSet, remove, removeListener, removeListenerImpl, storeDefaultValue
-
Constructor Details
-
StrokeProperty
Create a new stroke property from a string.- Parameters:
key- The key to usedefaultValue- The default stroke as string
-
StrokeProperty
Create a new stroke property from a stroke object.- Parameters:
key- The keydefaultStroke- The default stroke.
-
-
Method Details
-
fromString
Description copied from class:AbstractToStringPropertyConverts the string to an object of the given type.- Specified by:
fromStringin classAbstractToStringProperty<BasicStroke>- Parameters:
string- The string- Returns:
- The object.
-
toString
Description copied from class:AbstractToStringPropertyConverts the string to an object of the given type.- Specified by:
toStringin classAbstractToStringProperty<BasicStroke>- Parameters:
t- The object.- Returns:
- The string representing the object
-
getFromString
Return s new BasicStroke object with given thickness and style- Parameters:
code- = 3.5 → thickness=3.5px; 3.5 10 5 → thickness=3.5px, dashed: 10px filled + 5px empty- Returns:
- stroke for drawing
-
toDashArray
-