Class Property

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class Property
    extends Element
    A property is a special kind of element. Like any element it can have listeners and properties. The value of a property is an object. This can be a string, an integer, even a font or color. The value of a property cannot be set directly. This needs to be done in the parent of the property.
    See Also:
    Serialized Form
    • Field Detail

      • value

        protected Object value
    • Method Detail

      • getValue

        public Object getValue()
      • getColor

        public Color getColor()
        Description copied from class: Element
        Returns the value of the color property. The value of the color property must be of type Color.
        Overrides:
        getColor in class Element
        Returns:
        The color
      • getFont

        public Font getFont()
      • isVisible

        public boolean isVisible()
      • accept

        public void accept​(Visitor visitor)
                    throws Exception
        Description copied from class: Element
        Accept a visitor. This method is specialized in every subclass. Part of the visitor pattern.
        Overrides:
        accept in class Element
        Parameters:
        visitor - - The visitor
        Throws:
        Exception - the visitor threw an exception.
      • getName

        public String getName()
        Returns the name with which this property is registered in the parent.
        Returns:
        The name
      • getPrototypeFromParent

        public Element getPrototypeFromParent​(Element parent)
        Returns the value of the parent's protype's property given by getName() or null if the parent does not have a prototype.
        Overrides:
        getPrototypeFromParent in class Element
        Parameters:
        parent - - The parent element
        Returns:
        The property element
      • getX

        public int getX()
        Description copied from class: Element
        Returns the value of the x property. The value of the x property must be of type Integer.
        Overrides:
        getX in class Element
        Returns:
        The x value