| 
 | Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.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 java.lang.String | SHADOW_PAINTING_STYLE_IDStyle property key to selectively turn shadow painting on or off. | 
| Constructor Summary | |
|---|---|
| BevelNodePainter() | |
| Method Summary | |
|---|---|
|  boolean | contains(NodeRealizer context,
         double x,
         double y)Determines if the point (x,y)lies within the given visual
 representation of a node. | 
|  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. | 
|  java.awt.Color | getShadowColor()Gets the color of the shadow. | 
| protected  java.awt.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,
          java.awt.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(java.awt.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 java.lang.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 Values| Constructor Detail | 
|---|
public BevelNodePainter()
| Method Detail | 
|---|
protected void paintNode(NodeRealizer context,
                         java.awt.Graphics2D graphics,
                         boolean sloppy)
paintNode in class AbstractCustomNodePaintercontext - 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 java.awt.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 java.awt.Color getShadowColor()
public void setShadowColor(java.awt.Color shadowColor)
shadowColor - the color of the shadow.
public boolean contains(NodeRealizer context,
                        double x,
                        double y)
(x,y) lies within the given visual
 representation of a node.
contains in interface GenericNodeRealizer.ContainsTestcontext - the visual representation of a node.x - the x-coordinate of the point.y - the y-coordinate of the point.
true if the point lies within the node;
 false otherwise.| 
 | © Copyright 2000-2025, yWorks GmbH. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||