JFormDesigner 5.0.4 Runtime API

com.jformdesigner.model
Class FormObject

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

public abstract class FormObject
extends java.lang.Object

Abstract base class that stores property values.


Field Summary
static java.lang.Object NULL_VALUE
          A property value that explicitly sets a property to null.
 
Method Summary
 java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.Object>> getProperties()
          Returns an iterator over the properties in this object.
 java.lang.Object getProperty(java.lang.String name)
          Returns the value of a property (or null if inexistent).
 java.lang.Object getProperty(java.lang.String name, java.lang.Object def)
          Returns the value of a property (or def if inexistent).
 boolean getPropertyBoolean(java.lang.String name)
          Convenience method to get a boolean property value.
 boolean getPropertyBoolean(java.lang.String name, boolean def)
          Convenience method to get a boolean property value.
 int getPropertyCount()
          Returns the number of properties in this object.
 double getPropertyDouble(java.lang.String name)
          Convenience method to get a double property value.
 double getPropertyDouble(java.lang.String name, double def)
          Convenience method to get a double property value.
 int getPropertyInt(java.lang.String name)
          Convenience method to get an integer property value.
 int getPropertyInt(java.lang.String name, int def)
          Convenience method to get an integer property value.
 java.util.Iterator<java.lang.String> getPropertyNames()
          Returns an iterator over the property names in this object.
 java.lang.String getPropertyString(java.lang.String name)
          Convenience method to get a String property value.
 java.lang.String getPropertyString(java.lang.String name, java.lang.String def)
          Convenience method to get a String property value.
 int getReferenceCount()
          For internal use only.
 java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.Object>> properties()
          Returns an iterator over the properties in this object.
 java.lang.Iterable<java.lang.String> propertyNames()
          Returns an iterator over the property names in this object.
 void setProperty(java.lang.String name, int index, java.lang.Object value)
          Sets the value of a property.
 void setProperty(java.lang.String name, java.lang.Object value)
          Sets the value of a property.
 void setProperty(java.lang.String name, java.lang.Object value, java.lang.Object def)
          Sets the value of a property.
 void setPropertyBoolean(java.lang.String name, boolean value)
          Convenience method to set a boolean property value.
 void setPropertyBoolean(java.lang.String name, boolean value, boolean def)
          Convenience method to set a boolean property value.
 void setPropertyDouble(java.lang.String name, double value)
          Convenience method to set a double property value.
 void setPropertyDouble(java.lang.String name, double value, double def)
          Convenience method to set a double property value.
 void setPropertyInt(java.lang.String name, int value)
          Convenience method to set an integer property value.
 void setPropertyInt(java.lang.String name, int value, int def)
          Convenience method to set an integer property value.
 void setPropertyString(java.lang.String name, java.lang.String value)
          Convenience method to set an String property value.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_VALUE

public static final java.lang.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 Detail

getProperty

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


getProperty

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


setProperty

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


setProperty

public void setProperty(java.lang.String name,
                        int index,
                        java.lang.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(java.lang.String name,
                        java.lang.Object value,
                        java.lang.Object def)
Sets the value of a property. Removes the property if the value equals to def.


getPropertyString

public java.lang.String getPropertyString(java.lang.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 java.lang.String getPropertyString(java.lang.String name,
                                          java.lang.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(java.lang.String name,
                              java.lang.String value)
Convenience method to set an String property value.


getPropertyInt

public int getPropertyInt(java.lang.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(java.lang.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(java.lang.String name,
                           int value)
Convenience method to set an integer property value.


setPropertyInt

public void setPropertyInt(java.lang.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(java.lang.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(java.lang.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(java.lang.String name,
                              double value)
Convenience method to set a double property value.


setPropertyDouble

public void setPropertyDouble(java.lang.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(java.lang.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(java.lang.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(java.lang.String name,
                               boolean value)
Convenience method to set a boolean property value.


setPropertyBoolean

public void setPropertyBoolean(java.lang.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 java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.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.

Note: This method is not available in the Java 1.4 version of this library.

Since:
5.0

getProperties

public java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.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 java.lang.Iterable<java.lang.String> propertyNames()
Returns an iterator over the property names in this object. Iterator.next() returns a String.

Note: This method is not available in the Java 1.4 version of this library.

Since:
5.0

getPropertyNames

public java.util.Iterator<java.lang.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.


getReferenceCount

public int getReferenceCount()
For internal use only.


toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object

JFormDesigner 5.0.4 Runtime API

Copyright (C) 2004-2012 FormDev Software GmbH. All rights reserved.