Package com.jformdesigner.model
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 Summary
Fields Modifier and Type Field Description static ObjectNULL_VALUEA property value that explicitly sets a property tonull.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Final method disallows overriding.<T> TgetClientProperty(Object key)For internal use only.Iterator<Map.Entry<String,Object>>getProperties()Returns an iterator over the properties in this object.ObjectgetProperty(String name)Returns the value of a property (ornullif inexistent).ObjectgetProperty(String name, Object def)Returns the value of a property (ordefif inexistent).booleangetPropertyBoolean(String name)Convenience method to get a boolean property value.booleangetPropertyBoolean(String name, boolean def)Convenience method to get a boolean property value.intgetPropertyCount()Returns the number of properties in this object.doublegetPropertyDouble(String name)Convenience method to get a double property value.doublegetPropertyDouble(String name, double def)Convenience method to get a double property value.intgetPropertyInt(String name)Convenience method to get an integer property value.intgetPropertyInt(String name, int def)Convenience method to get an integer property value.Iterator<String>getPropertyNames()Returns an iterator over the property names in this object.StringgetPropertyString(String name)Convenience method to get a String property value.StringgetPropertyString(String name, String def)Convenience method to get a String property value.intgetReferenceCount()For internal use only.inthashCode()Final method disallows overriding.Iterable<Map.Entry<String,Object>>properties()Returns an iterator over the properties in this object.Iterable<String>propertyNames()Returns an iterator over the property names in this object.voidputClientProperty(Object key, Object value)For internal use only.voidsetProperty(String name, int index, Object value)Sets the value of a property.voidsetProperty(String name, Object value)Sets the value of a property.voidsetProperty(String name, Object value, Object def)Sets the value of a property.voidsetPropertyBoolean(String name, boolean value)Convenience method to set a boolean property value.voidsetPropertyBoolean(String name, boolean value, boolean def)Convenience method to set a boolean property value.voidsetPropertyDouble(String name, double value)Convenience method to set a double property value.voidsetPropertyDouble(String name, double value, double def)Convenience method to set a double property value.voidsetPropertyInt(String name, int value)Convenience method to set an integer property value.voidsetPropertyInt(String name, int value, int def)Convenience method to set an integer property value.voidsetPropertyString(String name, String value)Convenience method to set an String property value.StringtoString()Returns a string representation of the object.
-
-
-
Field Detail
-
NULL_VALUE
public static final Object NULL_VALUE
A property value that explicitly sets a property tonull.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 Object getProperty(String name)
Returns the value of a property (ornullif inexistent).
-
getProperty
public Object getProperty(String name, Object def)
Returns the value of a property (ordefif inexistent).
-
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 todef.
-
getPropertyString
public String getPropertyString(String name)
Convenience method to get a String property value. Returnsnullif 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. Returnsdefif 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. Returns0if 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. Returnsdefif 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 todef.
-
getPropertyDouble
public double getPropertyDouble(String name)
Convenience method to get a double property value. Returns0if 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. Returnsdefif 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 todef.
-
getPropertyBoolean
public boolean getPropertyBoolean(String name)
Convenience method to get a boolean property value. Returns0if 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. Returnsdefif 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 todef.
-
properties
public Iterable<Map.Entry<String,Object>> properties()
Returns an iterator over the properties in this object.Iterator.next()returns anjava.util.Map.Entrywhere 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 anjava.util.Map.Entrywhere 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 aString.- Since:
- 5.0
-
getPropertyNames
public Iterator<String> getPropertyNames()
Returns an iterator over the property names in this object.Iterator.next()returns aString.
-
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.
-
hashCode
public final int hashCode()
Final method disallows overriding.
-
-