|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IBoxPainter
This is the basic box painter interface. the Box painter defines the box of a view in style and size. NOTE: BoxPainter are dedicated to a view in the means of relative values. Nevertheless it can be bound to a model element to reuse the painter for in-line boxes or content painters. http://www.w3.org/TR/1998/REC-CSS2/box.html
Field Summary | |
---|---|
static java.awt.Insets |
EMPTY_INSETS
|
static int |
PAINT_MODE_CENTER
paints the center of a inline box(no left/right borders/padding) |
static int |
PAINT_MODE_LEFTEDGE
paints the left edge of an inline box |
static int |
PAINT_MODE_NORMAL
paints a normal box as usual |
static int |
PAINT_MODE_RIGHTEDGE
paints the right edge of an inline box |
Method Summary | |
---|---|
com.inet.html.parser.converter.ColorValue |
getBorderBottomColor()
Returns the color of the bottom border, may be null |
java.awt.Insets |
getBorderInsets()
Get the border sizes set by html or CSS. |
com.inet.html.parser.converter.ColorValue |
getBorderLeftColor()
Returns the color of the left border, may be null |
com.inet.html.parser.converter.ColorValue |
getBorderRightColor()
Returns the color of the right border, may be null |
java.awt.Insets |
getBorderStyles()
Get the border styles set by CSS. |
com.inet.html.parser.converter.ColorValue |
getBorderTopColor()
Returns the color of the top border, may be null |
int |
getBottomBorderPadding()
Returns the bottom border width + padding width |
int |
getLeftBorderPadding()
Returns the distance between the outer border and the content area on the left side |
java.awt.Insets |
getMargins()
Get the CSS margins. |
java.awt.Insets |
getPadding()
This are the padding values set by the CSS. |
int |
getRightBorderPadding()
Returns the right border width + padding width |
int |
getTopBorderPadding()
Returns the top border width + padding width |
int |
getTotalHeightGain()
Returns the total difference in width between the content and the box around the margin |
int |
getTotalLeftGain()
Distance between the margins outer border to the left end the left border of the content |
int |
getTotalTopGain()
Distance between the margins outer border on the top and the top border of the content |
int |
getTotalWidthGain()
Returns the total difference in width between the content and the box around the margin |
BoxView |
getView()
Returns the view this painter is bound to, will not be null |
boolean |
isRelevant()
Returns true if this box painter has any visible effect (note: padding is visible as well!) |
void |
paint(java.awt.Graphics g,
int x,
int y,
int width,
int height,
int paintMode,
BoxView paintRef)
Paints the box or a part of the box represented by this painter. |
void |
paint(java.awt.Graphics g,
java.awt.Rectangle r,
int paintMode,
BoxView paintRef)
Paints the box or a part of the box represented by this painter. |
void |
setBorderBottomColor(com.inet.html.parser.converter.ColorValue borderBottomColor)
Sets the color of the bottom border |
java.awt.Insets |
setBorderInsets()
Returns a mutable insets object to manipulate the border width |
void |
setBorderInsets(java.awt.Insets borderInsets)
Sets the border insets. |
void |
setBorderLeftColor(com.inet.html.parser.converter.ColorValue borderLeftColor)
Sets the color of the left border |
void |
setBorderRightColor(com.inet.html.parser.converter.ColorValue borderRightColor)
Sets the color of the right border |
java.awt.Insets |
setBorderStyles()
Returns a mutable insets object to manipulate the border styles |
void |
setBorderStyles(java.awt.Insets borderStyles)
Sets the border styles. |
void |
setBorderTopColor(com.inet.html.parser.converter.ColorValue borderTopColor)
Sets the color of the top border |
java.awt.Insets |
setMargins()
Returns a mutable insets object to manipulate the margin width |
void |
setMargins(java.awt.Insets margins)
Sets the margin insets |
java.awt.Insets |
setPadding()
Returns a mutable insets object to manipulate the padding width |
void |
setPadding(java.awt.Insets padding)
Sets the padding insets |
void |
updateRelativeValues(int parentWidth)
Checks whether this view has relative paddings or margins an updates them. |
void |
updateRelevance()
Updates the internal relevance flag. |
Methods inherited from interface com.inet.html.views.IBackgroundPainter |
---|
getBackgroundValue, getElement, getLastPaint, getReferenceView, isInitDone, paintBackground, setBackgroundValue, setInitDone, setLastPaint, setReferenceView |
Field Detail |
---|
static final int PAINT_MODE_NORMAL
static final int PAINT_MODE_LEFTEDGE
static final int PAINT_MODE_CENTER
static final int PAINT_MODE_RIGHTEDGE
static final java.awt.Insets EMPTY_INSETS
Method Detail |
---|
void updateRelativeValues(int parentWidth)
parentWidth
- The width of the parent viewjava.awt.Insets getPadding()
java.awt.Insets getMargins()
java.awt.Insets getBorderInsets()
java.awt.Insets getBorderStyles()
int getTotalWidthGain()
int getTotalHeightGain()
int getLeftBorderPadding()
int getTopBorderPadding()
int getBottomBorderPadding()
int getRightBorderPadding()
int getTotalLeftGain()
int getTotalTopGain()
void paint(java.awt.Graphics g, java.awt.Rectangle r, int paintMode, BoxView paintRef)
g
- the graphics to paint tor
- the area do draw topaintMode
- the paint mode constantpaintRef
- the coordinate reference for inline background imagesPAINT_MODE_NORMAL
,
PAINT_MODE_LEFTEDGE
,
PAINT_MODE_CENTER
,
PAINT_MODE_RIGHTEDGE
void paint(java.awt.Graphics g, int x, int y, int width, int height, int paintMode, BoxView paintRef)
g
- the graphics to paint tox
- the x coordinate of the paint areay
- the y coordinate of the paint areawidth
- the width coordinate of the paint areaheight
- the height coordinate of the paint areapaintMode
- the paint mode constantpaintRef
- the coordinate reference for inline background imagesPAINT_MODE_NORMAL
,
PAINT_MODE_LEFTEDGE
,
PAINT_MODE_CENTER
,
PAINT_MODE_RIGHTEDGE
BoxView getView()
com.inet.html.parser.converter.ColorValue getBorderTopColor()
com.inet.html.parser.converter.ColorValue getBorderLeftColor()
com.inet.html.parser.converter.ColorValue getBorderRightColor()
com.inet.html.parser.converter.ColorValue getBorderBottomColor()
void setBorderBottomColor(com.inet.html.parser.converter.ColorValue borderBottomColor)
borderBottomColor
- the color of the bottom bordervoid setBorderLeftColor(com.inet.html.parser.converter.ColorValue borderLeftColor)
borderLeftColor
- color of the left bordervoid setBorderRightColor(com.inet.html.parser.converter.ColorValue borderRightColor)
borderRightColor
- color of the right bordervoid setBorderTopColor(com.inet.html.parser.converter.ColorValue borderTopColor)
borderTopColor
- color of the top borderboolean isRelevant()
isRelevant
in interface IBackgroundPainter
void updateRelevance()
void setBorderStyles(java.awt.Insets borderStyles)
borderStyles
- the border stylesvoid setBorderInsets(java.awt.Insets borderInsets)
borderInsets
- the border insetsvoid setPadding(java.awt.Insets padding)
padding
- the padding insetsvoid setMargins(java.awt.Insets margins)
margins
- the margin insetsjava.awt.Insets setBorderInsets()
java.awt.Insets setBorderStyles()
java.awt.Insets setMargins()
java.awt.Insets setPadding()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |