public class Element extends Object implements Cloneable, Serializable
Modifier and Type | Field and Description |
---|---|
List<EventListener> |
listeners |
protected Map<String,Property> |
properties
The properties of this element.
|
Element |
prototype
The prototype of this element.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor visitor)
Accept a visitor.
|
void |
acceptSafe(Visitor visitor)
Like to accept(), but cannot throw an Exception.
|
void |
addListener(EventListener l)
Adds an event listener.
|
Object |
clone()
Returns a deep clone of the element.
|
Color |
getColor()
Returns the value of the color property.
|
CommandManager |
getCommandManager()
Get the command manager
|
Document |
getDocument()
Returns the document of this element.
|
Property |
getLocalProperty(String name)
Returns the property of the given name.
|
Element |
getParent()
Returns the parent element.
|
Set<Map.Entry<String,Property>> |
getProperties()
Get the properties stored in this element.
|
Property |
getProperty(String name)
Returns the property of the given name.
|
Object |
getPropertyValue(String name)
Returns the value of the property of the given name.
|
Element |
getPrototype()
Returns the prototype.
|
Element |
getPrototypeFromParent(Element parent)
Return the proper prototype for this element stored in the parent.
|
AbstractTemplate |
getTemplate()
Returns the template of this element.
|
int |
getX()
Returns the value of the x property.
|
int |
getY()
Returns the value of the y property.
|
boolean |
hasFlag(String property)
Returns the value of a boolean property.
|
void |
importInto(Element parent)
Imports the tree rooted at this element into the prototype
structure of the given parent.
|
boolean |
isPropertyLocal(String name)
Returns true if the property of the given name has a local
value.
|
void |
removeListener(EventListener l)
Removes an event listener.
|
void |
setCommandManager(CommandManager commandManager)
Set the command manager
|
void |
setProperties(Object[] properties) |
Property |
setProperty(String name,
Object value)
Sets and returns the given property.
|
void |
setPropertyFromPath(String path,
Object value)
Set the given property from path
|
void |
setPrototype(Element prototype)
Sets the prototype of this element to the given argument.
|
public List<EventListener> listeners
public Element prototype
public Element(Element prototype)
prototype
- - the prototypepublic boolean isPropertyLocal(String name)
name
- -The property namepublic Property getProperty(String name)
name
- - The property namepublic Property getLocalProperty(String name)
name
- - the property namepublic Object getPropertyValue(String name)
name
- - The property namepublic boolean hasFlag(String property)
property
- - The propertypublic int getX()
Integer
.public int getY()
Integer
.public Color getColor()
Color
.public Property setProperty(String name, Object value)
name
- - The property namevalue
- - The property valuepublic void setPropertyFromPath(String path, Object value)
path
- - The path of the propertyvalue
- - The property valuepublic void setProperties(Object[] properties)
public Set<Map.Entry<String,Property>> getProperties()
public Element getParent()
public void addListener(EventListener l)
l
- - the event listenerpublic void removeListener(EventListener l)
l
- - The event listenerpublic void accept(Visitor visitor) throws Exception
visitor
- - The visitorException
- the visitor threw an exception.public void acceptSafe(Visitor visitor)
visitor
- - The visitorpublic Element getPrototype()
public Document getDocument()
public AbstractTemplate getTemplate()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
- the object cannot be cloned.public Element getPrototypeFromParent(Element parent)
parent
- - The parent elementpublic void importInto(Element parent)
parent
- - The parent elementpublic void setPrototype(Element prototype)
prototype
- - The property elementpublic CommandManager getCommandManager()
public void setCommandManager(CommandManager commandManager)
commandManager
- - The commandManager to setCopyright © 2014 Uppsala University and Aalborg University. All Rights Reserved.