com.inet.html.views
Interface IBackgroundPainter

All Known Subinterfaces:
IBoxPainter
All Known Implementing Classes:
BackgroundPainter, BlankBoxPainter, BoxPainter, TableBoxPainter

public interface IBackgroundPainter

The background painter is the implementation of the CSS 'background' attribute. It defines how to draw the background of a box or table.


Method Summary
 com.inet.html.parser.converter.ColorValue getBackgroundValue()
          Returns the background color, may be null
 javax.swing.text.Element getElement()
          Returns the element which is the value source for this painter
 java.awt.Rectangle getLastPaint()
          Returns the coordinates of the last paint operation
 BoxView getReferenceView()
          Returns the view this painter is bound to, will not be null
 boolean isInitDone()
          Returns true if a table layout has modified this painter
 boolean isRelevant()
          Returns true if this box painter has any visible effect (note: padding is visible as well!)
 void paintBackground(java.awt.Graphics g, int x, int y, int width, int height, BoxView currentView)
          Paints the background fill and/or image
 void setBackgroundValue(com.inet.html.parser.converter.ColorValue backgroundValue)
          Set the background color of this painter, may be null
 void setInitDone()
          To be used in table context.
 void setLastPaint(java.awt.Rectangle lastPaint)
          Sets the coordinates of the last paint operation
 void setReferenceView(BoxView view)
          Sets the view which is the first view to be painted by this painter.
 

Method Detail

paintBackground

void paintBackground(java.awt.Graphics g,
                     int x,
                     int y,
                     int width,
                     int height,
                     BoxView currentView)
Paints the background fill and/or image

Parameters:
g - the graphics to draw on, must not be null
x - the x offset in pixel relative to the graphics
y - the y offset in pixel relative to the graphics
width - the width to draw in pixel
height - the height to draw in pixel
currentView - the view for which the background is painted, required to create seamless BG-Images

getReferenceView

BoxView getReferenceView()
Returns the view this painter is bound to, will not be null

Returns:
the view this painter is bound to, will not be null

isInitDone

boolean isInitDone()
Returns true if a table layout has modified this painter

Returns:
true if a table layout has modified this painter

setInitDone

void setInitDone()
To be used in table context. The table changes several layout settings - this has to be done only once! This flag has to be set to true afterwards.


getBackgroundValue

com.inet.html.parser.converter.ColorValue getBackgroundValue()
Returns the background color, may be null

Returns:
the background color, may be null

setBackgroundValue

void setBackgroundValue(com.inet.html.parser.converter.ColorValue backgroundValue)
Set the background color of this painter, may be null

Parameters:
backgroundValue - the background color of this painter, may be null

setReferenceView

void setReferenceView(BoxView view)
Sets the view which is the first view to be painted by this painter. All subsequent calls will be painted relatively to this view

Parameters:
view - the coordinate root for this painter

getElement

javax.swing.text.Element getElement()
Returns the element which is the value source for this painter

Returns:
the element which is the value source for this painter

getLastPaint

java.awt.Rectangle getLastPaint()
Returns the coordinates of the last paint operation

Returns:
the coordinates of the last paint operation

setLastPaint

void setLastPaint(java.awt.Rectangle lastPaint)
Sets the coordinates of the last paint operation

Parameters:
lastPaint - the coordinates of the last paint operation

isRelevant

boolean isRelevant()
Returns true if this box painter has any visible effect (note: padding is visible as well!)

Returns:
true if this box painter has any visible effect