public class ComponentBox extends ComponentWrapper implements Styleable, TextLines
Modifier and Type | Field and Description |
---|---|
protected Style |
style |
component, stretch, STRETCH_X_MASK, STRETCH_Y_MASK
Constructor and Description |
---|
ComponentBox(Component component) |
ComponentBox(Style style,
Component component) |
Modifier and Type | Method and Description |
---|---|
protected int |
getBottomMargin() |
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.
|
protected int |
getLeftMargin() |
int |
getMarginBottom()
Same as
Styled.getMarginTop() but for the bottom margin. |
int |
getMarginTop()
Returns the top margin of this object.
|
protected int |
getRightMargin() |
Style |
getStyle()
Returns the style of this object.
|
protected int |
getTopMargin() |
boolean |
hasDynamicVerticalMargins() |
protected void |
paintBackground(Graphics g) |
void |
refresh()
Requests this gadget to relayout and repaint itself.
|
void |
setStyle(Style style) |
getComponent, initialize, isXStretchable, isYStretchable, layout, paint, relayout, setXStretchable, setYStretchable, updateComponentLocation
focusGained, focusLost, gadgetToPanel, gadgetToRoot, getAncestors, getBounds, getBounds, getCursor, getEventDispatcher, getFontMetrics, getGadgetPanel, getGraphics, getLocation, getLocation, getNonBreakableVerticalRanges, getRoot, getSize, getSize, getToolkit, getToolTip, grabsMouseButton, handleAppEvent, handleKeyEvent, handleMouseEvent, hasFocus, isAppEventHandler, layout, makeRectangleVisible, makeRectangleVisible, panelToGadget, print, relayout, repaint, repaint, requestFocus
protected Style style
public ComponentBox(Component component)
public Style getStyle()
Styled
null
.public boolean hasDynamicVerticalMargins()
hasDynamicVerticalMargins
in interface Styled
public int getMarginTop()
Styled
Style.marginTop
,
the returned value is not a static one and may depend on the contents
of this object.
This method is needed to implement collapsed vertical margins in the case of nested boxes.
getMarginTop
in interface Styled
public int getMarginBottom()
Styled
Styled.getMarginTop()
but for the bottom margin.getMarginBottom
in interface Styled
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 int getFirstBaseLine()
TextLines
getFirstBaseLine
in interface TextLines
public int getLastBaseLine()
TextLines
getLastBaseLine
in interface TextLines
protected int getTopMargin()
getTopMargin
in class ComponentWrapper
protected int getRightMargin()
getRightMargin
in class ComponentWrapper
protected int getBottomMargin()
getBottomMargin
in class ComponentWrapper
protected int getLeftMargin()
getLeftMargin
in class ComponentWrapper
protected void paintBackground(Graphics g)
paintBackground
in class ComponentWrapper