GadgetContainer.Side
Modifier and Type | Field and Description |
---|---|
protected int |
firstBaseLine |
protected int |
lastBaseLine |
style
children, NO_GADGETS
Modifier | Constructor and Description |
---|---|
protected |
TextLineContainerBox() |
protected |
TextLineContainerBox(Style style) |
Modifier and Type | Method and Description |
---|---|
int |
getFirstBaseLine()
Returns the baseline of first text line if any and -1 otherwise.
|
int |
getLastBaseLine()
Returns the baseline of last text line if any and -1 otherwise.
|
void |
layout(int constrainedWidth,
int constrainedHeight,
boolean recursive)
Requests this gadget to relayout itself.
|
void |
paintRelayout(Gadget child,
int prevWidth,
int prevHeight,
GadgetContainer.Side damagedSide,
int damagedLength)
Invoked by a child gadget when its geometry (width, height, but also
for some gadgets baseline, reference point, etc) has changed.
|
void |
refresh()
Requests this gadget to relayout and repaint itself.
|
getMarginBottom, getMarginTop, getStyle, hasDynamicVerticalMargins, layoutContent, layoutEmptyContent, paint, paintContent, paintEmptyContent, print, printContent, printEmptyContent, setStyle
addChild, findGadgetAt, getChild, getChildCount, getChildren, getNonBreakableVerticalRanges, getSizeConstraints, indexOfChild, indexOfChildAt, insertChild, isAncestorOf, paintRelayout, removeAllChildren, removeChild, removeChild, replaceChild, replaceChild
focusGained, focusLost, gadgetToPanel, gadgetToRoot, getAncestors, getBounds, getBounds, getCursor, getEventDispatcher, getFontMetrics, getGadgetPanel, getGraphics, getLocation, getLocation, getRoot, getSize, getSize, getToolkit, getToolTip, grabsMouseButton, handleAppEvent, handleKeyEvent, handleMouseEvent, hasFocus, isAppEventHandler, layout, makeRectangleVisible, makeRectangleVisible, panelToGadget, relayout, relayout, repaint, repaint, requestFocus
protected TextLineContainerBox()
protected TextLineContainerBox(Style style)
public int getFirstBaseLine()
TextLines
getFirstBaseLine
in interface TextLines
public int getLastBaseLine()
TextLines
getLastBaseLine
in interface TextLines
public void refresh()
Gadget
This default implementation assumes that if, after the relayout, this gadget has not changed its width and height, a repaint is sufficient and its parent doesn't need to be notified.
public void layout(int constrainedWidth, int constrainedHeight, boolean recursive)
Gadget
This gadget responds by recomputing and updating its width and height.
layout
in class ContainerBox
constrainedWidth
- A stretchable gadget might be able to adapt its
size to this constrained width. A negative or null value means not
constrained.constrainedHeight
- A stretchable gadget might be able to adapt
its size to this constrained height. A negative or null value means not
constrained.recursive
- If true, recursively layout children too.public void paintRelayout(Gadget child, int prevWidth, int prevHeight, GadgetContainer.Side damagedSide, int damagedLength)
GadgetContainer
This parent gadget must at least respond by repainting its child but generally this parent gadget has to ``refresh'' itself.
This default implementation is a kind of light-weight Gadget.refresh()
where the relayout is not recursive. It should be redefined
by a faster, more container specific, version.
This default implementation assumes that if, after the relayout, this container has not changed its width and height, a repaint is sufficient and its own parent doesn't need to be notified.
paintRelayout
in class GadgetContainer
child
- the child that invoked this methodprevWidth
- child width before the relayoutprevHeight
- child height before the relayoutdamagedSide
- the side, if any, that was expanded or shrinkeddamagedLength
- If damagedSide is GadgetContainer.Side.TOP
, it is
sufficient to repaint (0, 0, width, damagedLength).
If damagedSide is GadgetContainer.Side.BOTTOM
, it is sufficient to repaint
(0, height-damagedLength, width, damagedLength).
If damagedSide is GadgetContainer.Side.LEFT
, it is sufficient to repaint
(0, 0, damagedLength, height).
If damagedSide is GadgetContainer.Side.RIGHT
, it is sufficient to repaint
(width-damagedLength, 0, damagedLength, height).
If damagedSide is GadgetContainer.Side.NONE
, (damagedLength is meaningless)
repaint the whole child.