y.view
Class RadialBackgroundRenderer

java.lang.Object
  |
  +--y.view.DefaultBackgroundRenderer
        |
        +--y.view.RadialBackgroundRenderer
All Implemented Interfaces:
BackgroundRenderer

public class RadialBackgroundRenderer
extends DefaultBackgroundRenderer

Background renderer that paints radial shapes around a specific node.


Field Summary
 
Fields inherited from class y.view.DefaultBackgroundRenderer
BRICKED, CENTERED, DYNAMIC, FULLSCREEN, PLAIN, TILED, view
 
Constructor Summary
RadialBackgroundRenderer(Graph2DView view)
          Instantiates a new RadialBackgroundRenderer for the given view.
RadialBackgroundRenderer(Graph2DView view, Color bgColor)
          Instantiates a new RadialBackgroundRenderer for the given view.
 
Method Summary
 void addRadial(double radius)
          Adds a new radial with specified radius to this renderer.
 void paint(Graphics2D gfx, int x, int y, int w, int h)
          Paints the background.
 void setCenterNode(Node v)
          Sets the center node around which the radials should be painted.
 void setRadialColors(Color innerColor, Color outerColor)
          Sets the radial colors that should be used.
 void setRadials(int num, int dist)
          Sets equidistant radials for this renderer.
 void setRadials(Vector r)
          Sets the radials for this renderer.
 
Methods inherited from class y.view.DefaultBackgroundRenderer
getColor, getImage, getImageOrigin, getImageResource, getMode, redoWorldTransform, setColor, setGraph2DView, setImage, setImageOrigin, setImageResource, setMode, undoWorldTransform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RadialBackgroundRenderer

public RadialBackgroundRenderer(Graph2DView view)
Instantiates a new RadialBackgroundRenderer for the given view.


RadialBackgroundRenderer

public RadialBackgroundRenderer(Graph2DView view,
                                Color bgColor)
Instantiates a new RadialBackgroundRenderer for the given view.

Parameters:
bgColor - the color that is used to paint the solid background.
Method Detail

addRadial

public void addRadial(double radius)
Adds a new radial with specified radius to this renderer.


setRadials

public void setRadials(Vector r)
Sets the radials for this renderer. The given vector must contain values of type Double that holds the radius for a radial.


setRadials

public void setRadials(int num,
                       int dist)
Sets equidistant radials for this renderer.

Parameters:
num - number of radials
dist - the radial distance between two adjacent radials

setRadialColors

public void setRadialColors(Color innerColor,
                            Color outerColor)
Sets the radial colors that should be used. The innerColor is the color used for the most inner (smallest) radial. The outerColor ist the color used for the most outer (biggest) radial. The radials in between these two extremes will receive gradient color values that lie between the given colors.


setCenterNode

public void setCenterNode(Node v)
Sets the center node around which the radials should be painted. If no center node is given or a set center node gets removed from the grpah then this renderer only paints a solid background.


paint

public void paint(Graphics2D gfx,
                  int x,
                  int y,
                  int w,
                  int h)
Paints the background.

Specified by:
paint in interface BackgroundRenderer
Overrides:
paint in class DefaultBackgroundRenderer

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003