y.view
Class ShinyPlateNodePainter

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

public class ShinyPlateNodePainter
extends AbstractCustomNodePainter
implements GenericNodeRealizer.ContainsTest

Draws a simple floating shiny plate with a slight gradient, a thin border and an optional simple drop shadow.

 
Your browser does not support SVG content.

Constructor Summary
ShinyPlateNodePainter()
          Creates a new instance of this Painter.
 
Method Summary
 boolean contains(NodeRealizer context, double x, double y)
          Used as a callback for the GenericNodeRealizer.contains(double, double) method.
 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)
          Callback method to be overwritten by subclasses called by AbstractCustomNodePainter.paint(NodeRealizer, Graphics2D).
 void setDrawShadow(boolean drawShadow)
          Sets whether the painter will draw a drop shadow effect.
 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

ShinyPlateNodePainter

public ShinyPlateNodePainter()
Creates a new instance of this Painter.

Method Detail

paintNode

protected void paintNode(NodeRealizer context,
                         Graphics2D graphics,
                         boolean sloppy)
Description copied from class: AbstractCustomNodePainter
Callback method to be overwritten by subclasses called by AbstractCustomNodePainter.paint(NodeRealizer, Graphics2D). This method is responsible for drawing the actual node only - neither the hotspots, nor the labels, should be painted by this method.

Specified by:
paintNode in class AbstractCustomNodePainter
Parameters:
context - the context node
graphics - the graphics context to use
sloppy - whether to draw the node sloppily
See Also:
AbstractCustomNodePainter.initializeLine(NodeRealizer, Graphics2D), AbstractCustomNodePainter.initializeFill(NodeRealizer, Graphics2D)

isDrawShadow

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

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 true.

Parameters:
drawShadow - Whether to draw a drop shadow.

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.

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.