|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.inet.html.views.layouts.Layout
com.inet.html.views.layouts.ControlLayout
public class ControlLayout
Layouter for ControlViews. This layouter is basically broker between the HTML layout process and the Swing control component.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.inet.html.views.layouts.Layout |
---|
Layout.PositionInfo, Layout.ViewPosition |
Field Summary |
---|
Fields inherited from class com.inet.html.views.layouts.Layout |
---|
MARKER_OFFSET |
Constructor Summary | |
---|---|
ControlLayout(ControlView view)
Creates a new control layout for a control view |
Method Summary | |
---|---|
java.awt.Rectangle |
getSpan()
Returns the area affected by the current layout or any of it's siblings, relative the it's own left upper corner. |
ViewPositionInfo |
getViewForPosition(java.awt.Point position,
java.awt.Rectangle a)
Finds the view and it's location for a specific point of the screen |
java.awt.Rectangle |
layout(boolean hard)
This method will do the final layouting |
void |
layoutVerticalAlign(int align,
int baselineOffset)
This method performs the vertical alignment of the whole content within the box. |
void |
layoutWidth()
Set the width of the layouted component. |
java.awt.Shape |
modelToView(int pos,
java.awt.Shape a,
javax.swing.text.Position.Bias b)
Tries to find the rectangle representing a given model-position. |
void |
predictWidth(int width)
Can be used to force a view to a specified width. |
void |
preLayout()
This method doe's the part of the layouting, which has to be called only once per website. |
void |
setPreferredSize(int width,
int height)
Sets the preferred size of this layout |
int |
viewToModel(float x,
float y,
java.awt.Shape a,
javax.swing.text.Position.Bias[] biasReturn)
Searches the view-tree for a specified point and returns the model-offset for this position. |
Methods inherited from class com.inet.html.views.layouts.Layout |
---|
getChildAllocation, getChildPosition, getChildren, getCurrentHeight, getCurrentLeft, getCurrentSpan, getCurrentTop, getCurrentWidth, getMinimumHeight, getMinimumSpan, getMinimumWidth, getPreferredHeight, getPreferredSpan, getPreferredWidth, getView, getViewCount, isPreLayouted, offsetRelative, replace, setCurrentHeight, setCurrentWidth, setPreLayouted, toString, union, union |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ControlLayout(ControlView view)
view
- the view to layoutMethod Detail |
---|
public void layoutWidth()
layoutWidth
in class Layout
public java.awt.Rectangle layout(boolean hard)
layout
in class Layout
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 java.awt.Shape modelToView(int pos, java.awt.Shape a, javax.swing.text.Position.Bias b) throws javax.swing.text.BadLocationException
modelToView
in class Layout
pos
- the model position to be founda
- the reference area for the search process, is supposed to be the surrounding rectangle of the current viewb
- the search direction, empty interface implementation, has no effect
null
javax.swing.text.BadLocationException
- will be thrown if pos
is outside the model's rangepublic void preLayout()
preLayout
in class Layout
public int viewToModel(float x, float y, java.awt.Shape a, javax.swing.text.Position.Bias[] biasReturn)
viewToModel
in class Layout
x
- root-relative X offset in pixely
- root-relative Y offset in pixela
- the bounds of the current viewbiasReturn
- the search direction, empty interface implementation, has no effect
public void setPreferredSize(int width, int height)
width
- the preferred widthheight
- the preferre heightpublic void predictWidth(int width)
predictWidth
in class Layout
width
- Width to setpublic void layoutVerticalAlign(int align, int baselineOffset)
layoutVerticalAlign
in class Layout
align
- The AlignValue constantbaselineOffset
- The difference between the contents top and the first baseline in pixelpublic ViewPositionInfo getViewForPosition(java.awt.Point position, java.awt.Rectangle a)
getViewForPosition
in class Layout
position
- the location to searcha
- the bounds of THIS view
public java.awt.Rectangle getSpan()
getSpan
in class Layout
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |