y.view
Class BevelNodePainter

java.lang.Object
  extended by y.view.AbstractCustomNodePainter
      extended by y.view.BevelNodePainter
All Implemented Interfaces:
GenericNodeRealizer.ContainsTest, GenericNodeRealizer.Painter

public class BevelNodePainter
extends AbstractCustomNodePainter
implements GenericNodeRealizer.ContainsTest

This class is an implementation of GenericNodeRealizer.Painter that draws a rounded rectangle with a bevel border and an optional simple drop shadow in a shiny fashion.

 

Constructor Summary
BevelNodePainter()
           
 
Method Summary
 boolean contains(NodeRealizer context, double x, double y)
          Used as a callback for the GenericNodeRealizer.contains(double, double) method.
 double getInset()
           
 double getRadius()
          Returns the radius of the rounded corners of the rounded rectangle shape.
 Color getShadowColor()
          Gets the color of the shadow.
 boolean isDrawShadow()
          Returns whether the painter will draw a drop shadow effect.
protected  void paintNode(NodeRealizer context, Graphics2D graphics, boolean sloppy)
          paints a node realizer with a bevel border in a shiny fashion.
 void setDrawShadow(boolean drawShadow)
          Sets whether the painter will draw a drop shadow effect.
 void setInset(double inset)
          sets the distance of the bevel border from the real border.
 void setRadius(double radius)
          Sets the radius of the rounded corners of the rounded rectangle shape.
 void setShadowColor(Color shadowColor)
          Sets the color of the shadow.
 
Methods inherited from class y.view.AbstractCustomNodePainter
backupGraphics, createSelectionColor, getFillColor, getFillColor2, getFillPaint, getLineColor, getLinePaint, getLineStroke, initializeFill, initializeLine, paint, paintSloppy, restoreGraphics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BevelNodePainter

public BevelNodePainter()
Method Detail

paintNode

protected void paintNode(NodeRealizer context,
                         Graphics2D graphics,
                         boolean sloppy)
paints a node realizer with a bevel border in a shiny fashion. The fill color is the basis for drawing the node. If the second fill color is set, it is used for creating gradients. If the line color is set, it is used for drawing the bevel border.

Specified by:
paintNode in class AbstractCustomNodePainter
Parameters:
context - the node realizer to be drawn
graphics - where to draw the node realizer
sloppy - if true, only a rectangle is drawn
See Also:
AbstractCustomNodePainter.initializeLine(NodeRealizer, Graphics2D), AbstractCustomNodePainter.initializeFill(NodeRealizer, Graphics2D)

getRadius

public double getRadius()
Returns the radius of the rounded corners of the rounded rectangle shape.

Returns:
The radius of the rounded rectangle corners.

setRadius

public void setRadius(double radius)
Sets the radius of the rounded corners of the rounded rectangle shape.

Parameters:
radius - the radius to use for the rounded rectangle corners.

getInset

public double getInset()
Returns:
the distance of the bevel border from the real border.

setInset

public void setInset(double inset)
sets the distance of the bevel border from the real border.

Parameters:
inset - inset of bevel border

isDrawShadow

public boolean isDrawShadow()
Returns whether the painter will draw a drop shadow effect. The default is false.

Returns:
whether the painter will draw a shadow.

setDrawShadow

public void setDrawShadow(boolean drawShadow)
Sets whether the painter will draw a drop shadow effect. The default is false.

Parameters:
drawShadow - whether to draw a shadow.

getShadowColor

public Color getShadowColor()
Gets the color of the shadow.

Returns:
the color of the shadow.

setShadowColor

public void setShadowColor(Color shadowColor)
Sets the color of the shadow.

Parameters:
shadowColor - the color of the shadow.

contains

public boolean contains(NodeRealizer context,
                        double x,
                        double y)
Description copied from interface: GenericNodeRealizer.ContainsTest
Used as a callback for the GenericNodeRealizer.contains(double, double) method.

Specified by:
contains in interface GenericNodeRealizer.ContainsTest

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