Package com.nomagic.magicdraw.properties
Class StyleManager
java.lang.Object
com.nomagic.magicdraw.properties.StyleManager
- All Implemented Interfaces:
com.nomagic.magicdraw.core.project.options.PersistentStyleManager
,PropertyVisitorAcceptor
,PropertyChangeListener
,Cloneable
,EventListener
@OpenApiAll
public class StyleManager
extends Object
implements PropertyVisitorAcceptor, PropertyChangeListener, Cloneable, com.nomagic.magicdraw.core.project.options.PersistentStyleManager
Style manager stores and manages a set of Styles.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Listener for style events. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(PropertyVisitor visitor) Accepts the given visitor.void
Adds given style.static void
addStyleListener
(StyleManager.StyleListener listener) Adds static listener for listen style event.clone()
Makes a copy of this manager.static void
fireStyleAdded
(StyleManager manager, Style style) Returns property class type.Returns default style.Returns styles ordered by names.Returns style with the specified name.getStyleByID
(String id) Returns all styles of this manager.void
Listens to PropertyNames.STYLE_MANAGER property change event.void
removeStyle
(Style style) Removes given style.static void
Removes listener for listen style creation event.void
setDefaultStyle
(Style style) Sets default style for this manager.void
setStyles
(Collection<Style> styles) Sets all styles.
-
Constructor Details
-
StyleManager
public StyleManager()Default constructor.
-
-
Method Details
-
addStyle
Adds given style.- Parameters:
style
- the style to add.
-
removeStyle
Removes given style.- Parameters:
style
- the style to remove.
-
getDefaultStyle
Returns default style.- Returns:
- the default style of this manager.
-
getStyle
Returns style with the specified name.- Parameters:
name
- style name.- Returns:
- style if such exists or null if not found.
-
getStyleByID
-
setDefaultStyle
Sets default style for this manager.- Parameters:
style
- - the style to be default.
-
getStyles
Returns all styles of this manager.- Returns:
- all styles. Collection is unmodifiable.
-
getOrderedStyles
Returns styles ordered by names.- Returns:
- all styles ordered by name.
-
setStyles
Sets all styles.- Parameters:
styles
- a collection of new styles.
-
accept
Accepts the given visitor.- Specified by:
accept
in interfacePropertyVisitorAcceptor
- Parameters:
visitor
- the PropertyVisitor.- Throws:
Exception
-
getClassType
Returns property class type.- Specified by:
getClassType
in interfacePropertyVisitorAcceptor
- Returns:
- PropertyID.STYLE_MANAGER
- See Also:
-
propertyChange
Listens to PropertyNames.STYLE_MANAGER property change event. TakesStyleManager
from new value and sets all styles from this manager to itself.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Parameters:
e
- the property change event.
-
clone
Makes a copy of this manager. Does deep clone. -
fireStyleAdded
-
addStyleListener
Adds static listener for listen style event. Listener is added in application scope and does not depends on project.- Parameters:
listener
- Listener to be added.
-
removeStyleListener
Removes listener for listen style creation event.- Parameters:
listener
- Listener to be removed.
-