Package snap.props

Class PropObject

java.lang.Object
snap.props.PropObject
All Implemented Interfaces:
PropChange.DoChange
Direct Known Subclasses:
Border, CharBlock, Effect, FileHeader, Font, NumberFormat, PropObjectProxy, Shape3D, Stroke, Tab, TaskMonitor, TextBlock, TextStyle, Undoer, View, ViewOwner, WebFile

public abstract class PropObject extends Object implements PropChange.DoChange
A base class for anything that wants to work with props.
  • Field Details

  • Constructor Details

    • PropObject

      public PropObject()
      Constructor.
  • Method Details

    • getPropSet

      public PropSet getPropSet()
      Returns the PropSet.
    • getPropForName

      public Prop getPropForName(String aPropName)
      Returns the prop for given name.
    • getPropsForArchival

      public Prop[] getPropsForArchival()
      Returns the props for archival.
    • getPropsForArchivalExtra

      public Prop[] getPropsForArchivalExtra()
      Returns extra props for archival.
    • getPropParent

      public PropObject getPropParent()
      Returns the parent PropObject (if available).
    • initProps

      protected void initProps(PropSet aPropSet)
      Initialize Props. Override to support props for this class.
    • getPropValue

      public Object getPropValue(String aPropName)
      Returns the value for given prop name.
    • setPropValue

      public void setPropValue(String aPropName, Object aValue)
      Sets the value for given prop name.
    • getPropsString

      public String getPropsString()
      Returns the props string.
    • setPropsString

      public void setPropsString(String propsString)
      Sets prop values for JSON/CSS style string, e.g.: "Name: AgeText; Margin: 4; PrefWidth: 24;"
    • setPropValues

      public void setPropValues(Object... keyValues)
      Sets prop key values - might be an improper convenience.
    • isPropDefault

      public boolean isPropDefault(String aPropName)
      Returns whether give prop is set to default.
    • getPropDefault

      public Object getPropDefault(String aPropName)
      Returns the value for given key.
    • addPropChangeListener

      public void addPropChangeListener(PropChangeListener aPCL)
      Add listener.
    • addPropChangeListener

      public void addPropChangeListener(PropChangeListener aPCL, String... theProps)
      Add listener.
    • removePropChangeListener

      public void removePropChangeListener(PropChangeListener aPCL)
      Remove listener.
    • removePropChangeListener

      public void removePropChangeListener(PropChangeListener aPCL, String... theProps)
      Remove listener.
    • firePropChange

      protected final void firePropChange(String aProp, Object oldVal, Object newVal)
      Fires a property change for given property name, old value, new value and index.
    • firePropChange

      protected final void firePropChange(String aProp, Object oldVal, Object newVal, int anIndex)
      Fires a property change for given property name, old value, new value and index.
    • firePropChange

      protected void firePropChange(PropChange aPC)
      Fires a given property change.
    • addDeepChangeListener

      public void addDeepChangeListener(DeepChangeListener aDCL)
      Add DeepChange listener.
    • removeDeepChangeListener

      public void removeDeepChangeListener(DeepChangeListener aPCL)
      Remove DeepChange listener.
    • processPropChange

      public void processPropChange(PropChange aPC, Object oldVal, Object newVal)
      PropChange.DoChange method.
      Specified by:
      processPropChange in interface PropChange.DoChange
    • clone

      protected PropObject clone() throws CloneNotSupportedException
      Standard clone implementation.
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class Object
    • toStringProps

      public String toStringProps()
      Standard toStringProps implementation.