|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.AbstractCustomNodePainter y.view.BevelNodePainter
public class BevelNodePainter
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.
Field Summary | |
---|---|
static String |
SHADOW_PAINTING_STYLE_ID
Style property key to selectively turn shadow painting on or off. |
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()
|
protected double |
getInset(NodeRealizer context)
Callback to allow subclass to customize the bevel inset depending on context. |
double |
getRadius()
Returns the radius of the rounded corners of the rounded rectangle shape. |
protected double |
getRadius(NodeRealizer context)
Callback to allow subclass to customize the corner radius depending on context. |
Color |
getShadowColor()
Gets the color of the shadow. |
protected Color |
getShadowColor(NodeRealizer context)
Callback invoked from paintNode(NodeRealizer, java.awt.Graphics2D, boolean)
to allow subclasses to customize shadow painting depending on context. |
boolean |
isDrawShadow()
Returns whether the painter will draw a drop shadow effect. |
protected boolean |
isDrawShadow(NodeRealizer context)
Callback invoked from paintNode(NodeRealizer, java.awt.Graphics2D, boolean)
to allow subclasses to customize shadow painting depending on context. |
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, paintHotSpots, paintPorts, paintSloppy, paintText, restoreGraphics |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SHADOW_PAINTING_STYLE_ID
Boolean.TRUE
will turn on shadow painting.
An associated value of Boolean.FALSE
will turn off shadow painting.
YRenderingHints.isShadowPaintingEnabled(java.awt.Graphics2D)
,
Constant Field ValuesConstructor Detail |
---|
public BevelNodePainter()
Method Detail |
---|
protected void paintNode(NodeRealizer context, Graphics2D graphics, boolean sloppy)
paintNode
in class AbstractCustomNodePainter
context
- the node realizer to be drawngraphics
- where to draw the node realizersloppy
- if true, only a rectangle is drawnAbstractCustomNodePainter.initializeLine(NodeRealizer, Graphics2D)
,
AbstractCustomNodePainter.initializeFill(NodeRealizer, Graphics2D)
protected double getRadius(NodeRealizer context)
getRadius()
.
context
- the context node
public double getRadius()
public void setRadius(double radius)
radius
- the radius to use for the rounded rectangle corners.protected double getInset(NodeRealizer context)
getInset()
.
context
- the context node
public double getInset()
public void setInset(double inset)
inset
- inset of bevel borderprotected boolean isDrawShadow(NodeRealizer context)
paintNode(NodeRealizer, java.awt.Graphics2D, boolean)
to allow subclasses to customize shadow painting depending on context.
The default implementation calls isDrawShadow()
.
context
- the context node
true
if the painter should draw a shadow;
false
otherwise.public boolean isDrawShadow()
false
.
public void setDrawShadow(boolean drawShadow)
false
.
drawShadow
- whether to draw a shadow.protected Color getShadowColor(NodeRealizer context)
paintNode(NodeRealizer, java.awt.Graphics2D, boolean)
to allow subclasses to customize shadow painting depending on context.
The default implementation calls getShadowColor()
.
context
- the node context
public Color getShadowColor()
public void setShadowColor(Color shadowColor)
shadowColor
- the color of the shadow.public boolean contains(NodeRealizer context, double x, double y)
GenericNodeRealizer.ContainsTest
GenericNodeRealizer.contains(double, double)
method.
contains
in interface GenericNodeRealizer.ContainsTest
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |