Package com.nomagic.magicdraw.properties
Class ColorProperty
java.lang.Object
com.nomagic.magicdraw.properties.Property
com.nomagic.magicdraw.properties.ColorProperty
- All Implemented Interfaces:
PropertyVisitorAcceptor,Cloneable
The property for storing and editing some Color value.
-
Field Summary
FieldsFields inherited from class com.nomagic.magicdraw.properties.Property
DEFAULT_PROPERTY_RESOURCE_PROVIDER, EDITABLE, NULL, NULL_ID_PROPERTY_RESOURCE_PROVIDER, TO, UNDEFINED, VALUE, VALUE_ANNOTATIONS -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ColorProperty(String id, Color value) The property constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAccepts the given visitor.clone()Clones the property.Returns property class type.getColor()Returns value as color object.static StringReturns value's string representation.protected booleanisValueCompatible(Object value) Methods inherited from class com.nomagic.magicdraw.properties.Property
_getValue, _isFrozen, _setFrozen, _setValue, addAnnotation, addPropertyChangeListener, addSource, addSources, areEqualByValue, areValuesEqual, checkFrozen, checkFrozen, equals, firePropertyChange, generateDefaultDescriptionID, getAdditionalProperties, getAdditionalProperty, getAnnotation, getAnnotations, getDescription, getDescriptionID, getFirstElementFromSources, getGroup, getID, getIntroductoryVersion, getName, getNonEditableReason, getProjectFromSourcesOrActive, getPureDescription, getResourceProvider, getResourceProviderID, getSortableValueStringRepresentation, getSourceAsElement, getSources, getSourcesAsStream, getUndefinedString, getUndefinedString, getValue, hashCode, isEditable, isUndefinedState, removeAnnotation, removePropertyChangeListener, setAdditionalProperties, setAdditionalProperty, setAnnotations, setDescription, setDescriptionID, setEditable, setGroup, setID, setIntroductoryVersion, setNonEditableReason, setResourceProvider, setResourceProviderID, setSources, setUndefinedState, setValue, toString
-
Field Details
-
ALLOW_NONE
- See Also:
-
-
Constructor Details
-
ColorProperty
public ColorProperty()Default constructor. Value of the property will be null. ID will be empty string. -
ColorProperty
The property constructor.- Parameters:
id- the ID of property.value- the color value of the property.
-
-
Method Details
-
getValueStringRepresentation
Returns value's string representation.- Overrides:
getValueStringRepresentationin classProperty- Returns:
- value's string representation - "RGB [red, green, blue]". If value null, returns "
".
-
getStringRepresentation
-
isValueCompatible
- Overrides:
isValueCompatiblein classProperty- Returns:
- true if given object can be assigned as value to this property
-
accept
Accepts the given visitor.- Specified by:
acceptin interfacePropertyVisitorAcceptor- Overrides:
acceptin classProperty- Parameters:
v- the PropertyVisitor.- Throws:
Exception
-
getColor
Returns value as color object.- Returns:
- value as color.
-
getClassType
Returns property class type.- Specified by:
getClassTypein interfacePropertyVisitorAcceptor- Overrides:
getClassTypein classProperty- Returns:
- PropertyID.COLOR_PROPERTY
- See Also:
-
clone
Description copied from class:PropertyClones the property. Clone is not deep, the clone will have the same instance of value. The clone will not have registered PropertyChangeListeners.
-