|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.View
com.inet.html.views.BoxView
com.inet.html.views.ControlView
public class ControlView
This class represents a HTML form control element like a button or an input. It uses regular swing components to render the view and to perform inputs.
Field Summary | |
---|---|
static int |
TYPE_BUTTON
|
static int |
TYPE_CHECKBOX
|
static int |
TYPE_HIDDEN
|
static int |
TYPE_MENU
|
static int |
TYPE_RADIOBUTTON
|
static int |
TYPE_SELECT
|
static int |
TYPE_TEXTAREA
|
static int |
TYPE_TEXTFIELD
|
Fields inherited from class com.inet.html.views.BoxView |
---|
BASELINE, STATUS_REQ_LAYOUT, STATUS_REQ_PRELAYOUT, STATUS_UPTODATE |
Fields inherited from class javax.swing.text.View |
---|
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Constructor Summary | |
---|---|
ControlView(javax.swing.text.Element elem)
Constructs a new ControlView, does nothing else. |
|
ControlView(javax.swing.text.Element elem,
ViewPainter painter)
new ControlView with element and painter |
Method Summary | |
---|---|
javax.swing.JComponent |
getControl()
This will return the component which displays the controls content. |
int |
getControlHeight()
Returns the height(in PX) of the control JComponent encapsulated by this view |
javax.swing.JComponent |
getControlPanel()
This will return the root swing component which will be triggered to display the complete control. |
int |
getControlWidth()
Returns the width(in PX) of the control JComponent encapsulated by this view |
int |
getFirstLineBaseLine()
Returns the baseline of the first content descendand of this view relative to the upper bound of this view |
Layout |
getLayout()
Returns the layouter object used by this view |
java.lang.String |
getName()
Returns the name of this component. |
float |
getPreferredSpan(int axis)
|
int |
getType()
Returns the type constant, which indicates which tpye of JComponent/HTML Control type is displayed by this view. |
java.lang.Object |
getValue()
Returns the current value of the encapsuled control. |
boolean |
isReset()
returns true if this control can reset a form |
boolean |
isSubmit()
returns true if this control can submit a form |
boolean |
isSuccessful(ControlView activator)
Determines the current success status for a submit. |
java.awt.Shape |
modelToView(int pos,
java.awt.Shape a,
javax.swing.text.Position.Bias b)
|
void |
paint(java.awt.Graphics g,
java.awt.Shape allocation)
|
java.awt.Rectangle |
performLayout(boolean hard)
This is the final layout method. |
void |
performLayoutVAlign(int baseline)
If this box has a overall vertical align, like in table cells for instance, this method calculates teh offset to align the content. |
void |
performLayoutWidth()
Layout what is required to determin the width of this view. |
void |
performPreLayout()
Causes this view to layout all fixed values and to calculate it's minimum and preferred width. |
void |
predictWidth(int width)
Forces a width on the control JComponent encapsulated by this view |
void |
setParent(javax.swing.text.View parent)
|
java.lang.String |
toString()
|
int |
viewToModel(float x,
float y,
java.awt.Shape a,
javax.swing.text.Position.Bias[] biasReturn)
|
Methods inherited from class javax.swing.text.View |
---|
append, breakView, changedUpdate, createFragment, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, insert, insertUpdate, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, removeUpdate, replace, viewToModel |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_BUTTON
public static final int TYPE_TEXTFIELD
public static final int TYPE_TEXTAREA
public static final int TYPE_RADIOBUTTON
public static final int TYPE_CHECKBOX
public static final int TYPE_SELECT
public static final int TYPE_MENU
public static final int TYPE_HIDDEN
Constructor Detail |
---|
public ControlView(javax.swing.text.Element elem)
elem
- the underlying model element for this view, must not be nullpublic ControlView(javax.swing.text.Element elem, ViewPainter painter)
elem
- elementpainter
- painterMethod Detail |
---|
public void setParent(javax.swing.text.View parent)
setParent
in class BoxView
public float getPreferredSpan(int axis)
getPreferredSpan
in class javax.swing.text.View
public java.awt.Shape modelToView(int pos, java.awt.Shape a, javax.swing.text.Position.Bias b) throws javax.swing.text.BadLocationException
modelToView
in class javax.swing.text.View
javax.swing.text.BadLocationException
public void paint(java.awt.Graphics g, java.awt.Shape allocation)
paint
in class BoxView
public int viewToModel(float x, float y, java.awt.Shape a, javax.swing.text.Position.Bias[] biasReturn)
viewToModel
in class javax.swing.text.View
public java.awt.Rectangle performLayout(boolean hard)
performLayout
in class BoxView
hard
- If set to true, the status of the children will be ignored and all views will be layouted. This
should be done on view-size changes. If set to false the status of the children will be respected and
up-to-date views will not be layouted again.
public int getControlWidth()
JComponent
encapsulated by this view
JComponent
encapsulated by this viewpublic int getControlHeight()
JComponent
encapsulated by this view
JComponent
encapsulated by this viewpublic void performLayoutWidth()
performLayoutWidth
in class BoxView
public Layout getLayout()
getLayout
in interface ILayouted
public void performPreLayout()
performPreLayout
in interface ILayouted
performPreLayout
in class BoxView
public void predictWidth(int width)
JComponent
encapsulated by this view
predictWidth
in interface ILayouted
width
- the width to set in PXpublic java.lang.String toString()
toString
in class java.lang.Object
public javax.swing.JComponent getControl()
public javax.swing.JComponent getControlPanel()
public void performLayoutVAlign(int baseline)
performLayoutVAlign
in class BoxView
baseline
- external prediction of the first baseline for BASELINE alignmentpublic int getFirstLineBaseLine()
getFirstLineBaseLine
in class BoxView
public int getType()
public boolean isSubmit()
public boolean isReset()
public java.lang.Object getValue()
public java.lang.String getName()
public boolean isSuccessful(ControlView activator)
activator
- the current button, which submitted the form
http://www.w3.org/TR/REC-html40/interact/forms.html#successful-controls
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |