@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 | 
ADDED_STYLE_MANAGER
Deprecated.  
 | 
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  | 
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)  | 
java.util.Map<PropertyManager,PropertyManager> | 
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 | 
hasStereotype(java.lang.String id)
Check if style has stereotype with given id. 
 | 
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 | 
setAppliedPropertyManagerIDs(java.util.Map<PropertyManager,PropertyManager> propertyManagers)
Sets applied property manager id to managers which does not have it. 
 | 
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
@Deprecated public static final java.lang.String ADDED_STYLE_MANAGER
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(@CheckForNull
                       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 void setAppliedPropertyManagerIDs(java.util.Map<PropertyManager,PropertyManager> propertyManagers)
propertyManagers - property managers to analyzepublic java.lang.String toString()
toString in class java.lang.Objectpublic void setDefault(boolean def)
def - new flag value.public boolean isDefault()
public java.lang.Object clone()
clone in class java.lang.Objectprotected 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 PropertyVisitorAcceptorvisitor - the PropertyVisitor.java.lang.Exceptionpublic java.lang.String getClassType()
getClassType in interface PropertyVisitorAcceptorPropertyID.SIMPLE_STYLEpublic void append(Style s)
s - the given style.public java.util.Map<PropertyManager,PropertyManager> 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.PropertyChangeListenerevt - 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.PropertyChangeSupportpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - the PropertyChangeListener to be removed.PropertyChangeSupportpublic static void generateDefaultDescriptionID(Style style)
style - stylepublic boolean isSnapshotStyleForDiagramSymbols()
public boolean isEqual(Style style)
style - given style.public boolean hasStereotype(java.lang.String id)
id - stereotype id