bibliothek.gui.dock.station.support
Class StationPaintWrapper

java.lang.Object
  extended by bibliothek.gui.dock.station.support.StationPaintWrapper
All Implemented Interfaces:
StationPaint

public class StationPaintWrapper
extends Object
implements StationPaint

A wrapper for a StationPaint. The wrapper uses a delegate, and if no delegate is known, the DockUI is asked to provide a paint appropriate to the current DockTheme.

Author:
Benjamin Sigg

Constructor Summary
StationPaintWrapper()
           
 
Method Summary
 void drawDivider(Graphics g, DockStation station, Rectangle bounds)
          Draws a divider between two elements.
 void drawInsertion(Graphics g, DockStation station, Rectangle stationBounds, Rectangle dockableBounds)
          Paints some markings when a Dockable is added to a DockStation.
 void drawInsertionLine(Graphics g, DockStation station, int x1, int y1, int x2, int y2)
          Paints a single line from x1/y1 to x2/y2.
 StationPaint getDelegate()
          Gets the StationPaint to which calls to this paint are forwarded.
 void setDelegate(StationPaint delegate)
          Sets the delegate property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StationPaintWrapper

public StationPaintWrapper()
Method Detail

getDelegate

public StationPaint getDelegate()
Gets the StationPaint to which calls to this paint are forwarded.

Returns:
the delegate or null
See Also:
setDelegate(StationPaint)

setDelegate

public void setDelegate(StationPaint delegate)
Sets the delegate property. If this property is set, all calls to the Methods of StationPaint are forwarded to it. Otherwise a default paint is used.

Parameters:
delegate - the delegate or null

drawDivider

public void drawDivider(Graphics g,
                        DockStation station,
                        Rectangle bounds)
Description copied from interface: StationPaint
Draws a divider between two elements.

Specified by:
drawDivider in interface StationPaint
Parameters:
g - the graphics context used for painting
station - the station on which to paint
bounds - the rectangle which marks the whole divider

drawInsertion

public void drawInsertion(Graphics g,
                          DockStation station,
                          Rectangle stationBounds,
                          Rectangle dockableBounds)
Description copied from interface: StationPaint
Paints some markings when a Dockable is added to a DockStation.

Specified by:
drawInsertion in interface StationPaint
Parameters:
g - the graphics context used for painting
station - the station on which to paint
stationBounds - the area on the station which will be affected by the insertion
dockableBounds - the bounds that the new child will have

drawInsertionLine

public void drawInsertionLine(Graphics g,
                              DockStation station,
                              int x1,
                              int y1,
                              int x2,
                              int y2)
Description copied from interface: StationPaint
Paints a single line from x1/y1 to x2/y2.

Specified by:
drawInsertionLine in interface StationPaint
Parameters:
g - the graphics context used for painting
station - the station on which to paint
x1 - the x-coordinate of the first end of the line
y1 - the y-coordinate of the first end of the line
x2 - the x-coordinate of the second end of the line
y2 - the y-coordinate of the second end of the line