|
JFormDesigner 5.0.4 Runtime API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jformdesigner.model.FormObject
com.jformdesigner.model.FormComponent
public class FormComponent
A form component represents a java.awt.Component
in the form model.
It has a name, a class name and properties.
The name is used by the Java code generator as variable name or by the
FormLoader to access the Swing component.
FormContainer
must be used for container components;
FormWindow
for java.awt.Window
and derived components;
FormNonVisual
for non-visual JavaBeans (not derived from
java.awt.Component
).
Example:
FormComponent label = new FormComponent("javax.swing.JLabel"); label.setProperty("text", "hello"); label.setProperty("foreground", Color.red);The same in Swing:
JLabel label = new JLabel(); label.setText("hello"); label.setForeground(Color.red);
Field Summary | |
---|---|
static java.lang.String |
FIELD_NAME
|
Fields inherited from class com.jformdesigner.model.FormObject |
---|
NULL_VALUE |
Constructor Summary | |
---|---|
FormComponent(java.lang.String className)
Constructs a form component for the specified class. |
Method Summary | |
---|---|
boolean |
accept(FormComponentVisitor visitor)
Accepts the given visitor. |
void |
addEvent(FormEvent event)
Adds a form event to the end of this form component. |
void |
addEvent(FormEvent event,
int index)
Adds a form event to this form component at the specified position. |
FormObject |
auxiliary()
Returns a object that contains auxiliary property. |
java.lang.Object |
clone()
Clones this form component. |
boolean |
getAuxiliaryPropertyBoolean(java.lang.String name,
boolean def)
Convenience method to get an auxiliary boolean property value. |
int |
getAuxiliaryPropertyInt(java.lang.String name,
int def)
Convenience method to get an auxiliary integer property value. |
java.lang.String |
getAuxiliaryPropertyString(java.lang.String name,
java.lang.String def)
Convenience method to get an auxiliary String property value. |
java.lang.String |
getClassName()
Returns the class name of this form component. |
FormLayoutConstraints |
getConstraints()
Returns the form layout constraints of this form component if the parent container has a form layout manager which uses constraints. |
FormEvent |
getEvent(int index)
Returns the form event at index . |
int |
getEventCount()
Returns the number of form events in this form component. |
FormEvent[] |
getEvents()
Returns all form events in this form component. |
FormModel |
getModel()
Returns the form model of this form component. |
java.lang.String |
getName()
Returns the name of this form component. |
FormContainer |
getParent()
Returns the parent of this form component. |
boolean |
hasAuxiliary()
Returns whether this form component has auxiliary properties or not. |
void |
removeEvent(FormEvent event)
Removes the specified form event from this form component. |
void |
removeEvent(int index)
Removes the form event at the specified index from this form component. |
void |
setName(java.lang.String name)
Sets the name of this form component. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class com.jformdesigner.model.FormObject |
---|
getProperties, getProperty, getProperty, getPropertyBoolean, getPropertyBoolean, getPropertyCount, getPropertyDouble, getPropertyDouble, getPropertyInt, getPropertyInt, getPropertyNames, getPropertyString, getPropertyString, getReferenceCount, properties, propertyNames, setProperty, setProperty, setProperty, setPropertyBoolean, setPropertyBoolean, setPropertyDouble, setPropertyDouble, setPropertyInt, setPropertyInt, setPropertyString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FIELD_NAME
Constructor Detail |
---|
public FormComponent(java.lang.String className)
Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getClassName()
public FormContainer getParent()
null
if the form component has no parent.
public FormModel getModel()
public FormObject auxiliary()
public boolean hasAuxiliary()
public java.lang.String getAuxiliaryPropertyString(java.lang.String name, java.lang.String def)
def
if the auxiliary property is not a String or does not exist.
public int getAuxiliaryPropertyInt(java.lang.String name, int def)
def
if the auxiliary property is not an integer or does not exist.
public boolean getAuxiliaryPropertyBoolean(java.lang.String name, boolean def)
def
if the auxiliary property is not a boolean or does not exist.
public FormLayoutConstraints getConstraints()
public boolean accept(FormComponentVisitor visitor)
FormComponentVisitor.visit(com.jformdesigner.model.FormComponent)
is called
with this form component.
visitor
- The visitor.
FormComponentVisitor.visit(com.jformdesigner.model.FormComponent)
.public int getEventCount()
public FormEvent getEvent(int index)
index
.
public FormEvent[] getEvents()
public void addEvent(FormEvent event)
public void addEvent(FormEvent event, int index)
event
- The form event to be added.index
- The position in the component's event list at which
to insert the event; or -1 to insert at the endpublic void removeEvent(FormEvent event)
public void removeEvent(int index)
public java.lang.String toString()
toString
in class FormObject
|
JFormDesigner 5.0.4 Runtime API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |