@OpenApiAll public class Style extends java.lang.Object implements java.lang.Cloneable, PropertyVisitorAcceptor, java.beans.PropertyChangeListener, com.nomagic.magicdraw.core.project.options.PersistentStyle
PropertyManagers
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CHANGE_STYLE_PROPERTY
Name of property fired on some style change.
|
static java.lang.String |
CHANGE_STYLE_PROPERTY_VALUE |
static java.lang.String |
MERGED |
static java.lang.String |
MERGED_PRE1704 |
protected java.util.List<PropertyManager> |
mManagers
Mao of property managers registered by name.
|
protected java.lang.String |
mName
The name of the style.
|
static java.lang.String |
SHARED |
Constructor and Description |
---|
Style()
Constructs new Style.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(PropertyVisitor visitor)
Accepts the given visitor.
|
void |
addManager(PropertyManager manager)
Adds given property manager.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers the listener to the element.
|
void |
append(Style s)
Adds all managers from given style to this style.
|
void |
appendExtendedManagers(Style s) |
void |
apply(Style s)
Applies all managers from given style to the existing managers here.
|
void |
changeProperty(Property p)
Replaces existing property in all managers with the given one.
|
java.lang.Object |
clone()
/**
Creates and returns a copy of this style.
|
protected void |
cloneManagers(Style newS) |
static PropertyManager |
findPropertyManagerWithPath(Style findIn,
java.util.ArrayList<PropertyManager> path) |
static PropertyManager |
findPropertyManagerWithSamePath(Style findIn,
PropertyManager find)
Finds same property manager(with same path) in given style.
|
static void |
generateDefaultDescriptionID(Style style)
Generate default description id.
|
void |
generateID() |
java.lang.String |
getClassType()
Returns property class type.
|
java.lang.String |
getID() |
PropertyManager |
getManager(java.lang.String name)
Returns property manager with given name.
|
int |
getManagerCount()
Returns managers count.
|
java.util.Collection<PropertyManager> |
getManagers()
Returns a collection of all managers.
|
java.util.List<PropertyManager> |
getManagersFromParent(PropertyManager root) |
java.lang.String |
getName()
Returns the name of the style.
|
java.util.List<PropertyManager> |
getOrderedManagers()
Returns collection of managers sorted by name.
|
boolean |
isDefault()
Is this style a default one?
|
boolean |
isDiagramStyle() |
boolean |
isEqual(Style style)
Checks if given style has same property managers with same values.
|
boolean |
isSnapshotStyleForDiagramSymbols() |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
On CHANGE_STYLE_PROPERTY property change takes the manager from
property's new Value and replaces itself properties with properties from
this manager.
|
void |
removeManager(PropertyManager manager)
Removes given property manager.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregisters the given listener from the element.
|
void |
setDefault(boolean def)
Sets default flag value.
|
void |
setID(java.lang.String id)
Set Id
|
void |
setManagers(java.util.Collection<PropertyManager> managers)
Sets the collection of all managers.
|
void |
setName(java.lang.String name)
Set the name of the style.
|
java.lang.String |
toString()
Returns a string representation of the style.
|
public static final java.lang.String CHANGE_STYLE_PROPERTY
public static final java.lang.String CHANGE_STYLE_PROPERTY_VALUE
protected java.util.List<PropertyManager> mManagers
protected java.lang.String mName
public static final java.lang.String SHARED
public static final java.lang.String MERGED
public static final java.lang.String MERGED_PRE1704
public Style()
public void addManager(PropertyManager manager)
manager
- the manager to add.public void removeManager(PropertyManager manager)
manager
- the manager to remove.public int getManagerCount()
public void setManagers(java.util.Collection<PropertyManager> managers)
managers
- a collection of new managers.public java.lang.String getName()
public void setName(java.lang.String name)
name
- the new name of the style.public java.lang.String toString()
toString
in class java.lang.Object
public void setDefault(boolean def)
def
- new flag value.public boolean isDefault()
public java.lang.Object clone()
clone
in class java.lang.Object
protected void cloneManagers(Style newS)
public java.util.Collection<PropertyManager> getManagers()
public java.util.List<PropertyManager> getOrderedManagers()
@CheckForNull public PropertyManager getManager(java.lang.String name)
name
- the name of manager.public void accept(PropertyVisitor visitor) throws java.lang.Exception
accept
in interface PropertyVisitorAcceptor
visitor
- the PropertyVisitor.java.lang.Exception
public java.lang.String getClassType()
getClassType
in interface PropertyVisitorAcceptor
PropertyID.SIMPLE_STYLE
public void append(Style s)
s
- the given style.public void apply(@Nonnull Style s)
s
- the given style.public void appendExtendedManagers(@Nonnull Style s)
public boolean isDiagramStyle()
public void changeProperty(Property p)
p
- the given property.public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
evt
- PropertyChangeEvent.public java.util.List<PropertyManager> getManagersFromParent(@CheckForNull PropertyManager root)
@CheckForNull public static PropertyManager findPropertyManagerWithSamePath(Style findIn, PropertyManager find)
findIn
- style where find manager.find
- manager to find.@CheckForNull public static PropertyManager findPropertyManagerWithPath(Style findIn, java.util.ArrayList<PropertyManager> path)
public void generateID()
public java.lang.String getID()
public void setID(java.lang.String id)
id
- given ID.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the PropertyChangeListener
to be added.PropertyChangeSupport
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the PropertyChangeListener to be removed.PropertyChangeSupport
public static void generateDefaultDescriptionID(Style style)
style
- stylepublic boolean isSnapshotStyleForDiagramSymbols()
public boolean isEqual(Style style)
style
- given style.