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.
|
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 |
setProperties(Object[] properties) |
Property |
setProperty(String name,
Object value)
Sets and returns the given property.
|
void |
setPropertyFromPath(String path,
Object value) |
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)
public boolean isPropertyLocal(String name)
public Property getProperty(String name)
public Property getLocalProperty(String name)
public Object getPropertyValue(String name)
public boolean hasFlag(String property)
public int getX()
Integer.
public int getY()
Integer.
public Color getColor()
Color.
public Property setProperty(String name, Object value)
public void setProperties(Object[] properties)
public Set<Map.Entry<String,Property>> getProperties()
public Element getParent()
public void addListener(EventListener l)
public void removeListener(EventListener l)
public void accept(Visitor visitor) throws Exception
Exception
public void acceptSafe(Visitor visitor)
public Element getPrototype()
public Document getDocument()
public AbstractTemplate getTemplate()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public Element getPrototypeFromParent(Element parent)
public void importInto(Element parent)
public void setPrototype(Element prototype)
Copyright © 2012 Uppsala University and Aalborg University. All Rights Reserved.