Class FormObject

java.lang.Object
com.jformdesigner.model.FormObject
Direct Known Subclasses:
FormBinding, FormBindingGroup, FormComponent, FormLayoutConstraints, FormLayoutManager, FormModel

public abstract class FormObject extends Object
Abstract base class that stores property values.
  • Field Details

    • NULL_VALUE

      public static final Object NULL_VALUE
      A property value that explicitly sets a property to null.

      Example:

        FormComponent label = new FormComponent("javax.swing.JLabel");
        label.setProperty("text", FormComponent.NULL_VALUE);
      
      The same in Swing:
        JLabel label = new JLabel();
        label.setText(null);
      
  • Method Details

    • getProperty

      public Object getProperty(String name)
      Returns the value of a property (or null if inexistent).
    • getProperty

      public Object getProperty(String name, Object def)
      Returns the value of a property (or def if inexistent).
    • setProperty

      public void setProperty(String name, Object value)
      Sets the value of a property.
    • setProperty

      public void setProperty(String name, int index, Object value)
      Sets the value of a property. If the property is not yet set, then it is inserted at the given index. If index is -1, then the property is appended to the end of the properties list.
      Since:
      3.1
    • setProperty

      public void setProperty(String name, Object value, Object def)
      Sets the value of a property. Removes the property if the value equals to def.
    • getPropertyString

      public String getPropertyString(String name)
      Convenience method to get a String property value. Returns null if the property is not a String or does not exist.
    • getPropertyString

      public String getPropertyString(String name, String def)
      Convenience method to get a String property value. Returns def if the property is not a String or does not exist.
    • setPropertyString

      public void setPropertyString(String name, String value)
      Convenience method to set an String property value.
    • getPropertyInt

      public int getPropertyInt(String name)
      Convenience method to get an integer property value. Returns 0 if the property is not an integer or does not exist.
    • getPropertyInt

      public int getPropertyInt(String name, int def)
      Convenience method to get an integer property value. Returns def if the property is not an integer or does not exist.
    • setPropertyInt

      public void setPropertyInt(String name, int value)
      Convenience method to set an integer property value.
    • setPropertyInt

      public void setPropertyInt(String name, int value, int def)
      Convenience method to set an integer property value. Removes the property if the value equals to def.
    • getPropertyDouble

      public double getPropertyDouble(String name)
      Convenience method to get a double property value. Returns 0 if the property is not an double or does not exist.
    • getPropertyDouble

      public double getPropertyDouble(String name, double def)
      Convenience method to get a double property value. Returns def if the property is not an double or does not exist.
    • setPropertyDouble

      public void setPropertyDouble(String name, double value)
      Convenience method to set a double property value.
    • setPropertyDouble

      public void setPropertyDouble(String name, double value, double def)
      Convenience method to set a double property value. Removes the property if the value equals to def.
    • getPropertyBoolean

      public boolean getPropertyBoolean(String name)
      Convenience method to get a boolean property value. Returns 0 if the property is not an boolean or does not exist.
    • getPropertyBoolean

      public boolean getPropertyBoolean(String name, boolean def)
      Convenience method to get a boolean property value. Returns def if the property is not an boolean or does not exist.
    • setPropertyBoolean

      public void setPropertyBoolean(String name, boolean value)
      Convenience method to set a boolean property value.
    • setPropertyBoolean

      public void setPropertyBoolean(String name, boolean value, boolean def)
      Convenience method to set a boolean property value. Removes the property if the value equals to def.
    • properties

      public Iterable<Map.Entry<String,Object>> properties()
      Returns an iterator over the properties in this object. Iterator.next() returns an java.util.Map.Entry where the key is the property name and the value is the property value.
      Since:
      5.0
    • getProperties

      public Iterator<Map.Entry<String,Object>> getProperties()
      Returns an iterator over the properties in this object. Iterator.next() returns an java.util.Map.Entry where the key is the property name and the value is the property value.
    • propertyNames

      public Iterable<String> propertyNames()
      Returns an iterator over the property names in this object. Iterator.next() returns a String.
      Since:
      5.0
    • getPropertyNames

      public Iterator<String> getPropertyNames()
      Returns an iterator over the property names in this object. Iterator.next() returns a String.
    • getPropertyCount

      public int getPropertyCount()
      Returns the number of properties in this object.
    • getClientProperty

      public <T> T getClientProperty(Object key)
      For internal use only.
      Since:
      6.0
    • putClientProperty

      public void putClientProperty(Object key, Object value)
      For internal use only.
      Since:
      6.0
    • getReferenceCount

      public int getReferenceCount()
      For internal use only.
    • equals

      public final boolean equals(Object obj)
      Final method disallows overriding.
      Overrides:
      equals in class Object
      Since:
      6.0
    • hashCode

      public final int hashCode()
      Final method disallows overriding.
      Overrides:
      hashCode in class Object
      Since:
      6.0
    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object