|
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.GeneralPathNodePainter
public class GeneralPathNodePainter
A painter and contains test for GenericNodeRealizer
that
uses a pre-defined GeneralPath
as the shape for nodes.
GeneralPath
instances that are used with this painter/contains
test have to reside in the unit square, i.e.
the bounds
of these paths
must lie in [0,1]x[0,1]
.
Constructor Summary | |
---|---|
GeneralPathNodePainter(java.awt.geom.GeneralPath path)
Initializes a new GeneralPathNodePainter instance. |
Method Summary | |
---|---|
boolean |
contains(NodeRealizer context,
double x,
double y)
Used as a callback for the GenericNodeRealizer.contains(double, double) method. |
protected java.awt.Color |
getFillColor(NodeRealizer context,
boolean selected)
Returns the fill color for the specified realizer. |
protected void |
paintNode(NodeRealizer context,
java.awt.Graphics2D graphics,
boolean sloppy)
Callback method to be overwritten by subclasses called by AbstractCustomNodePainter.paint(NodeRealizer, Graphics2D) . |
Methods inherited from class y.view.AbstractCustomNodePainter |
---|
backupGraphics, createSelectionColor, 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 |
Constructor Detail |
---|
public GeneralPathNodePainter(java.awt.geom.GeneralPath path)
GeneralPathNodePainter
instance.
path
- the geometric shape used to represent nodes. Its bounds must
lie in [0,1]x[0,1]
.Method Detail |
---|
protected void paintNode(NodeRealizer context, java.awt.Graphics2D graphics, boolean sloppy)
AbstractCustomNodePainter
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.
paintNode
in class AbstractCustomNodePainter
context
- the context nodegraphics
- the graphics context to usesloppy
- whether to draw the node sloppilyAbstractCustomNodePainter.initializeLine(NodeRealizer, Graphics2D)
,
AbstractCustomNodePainter.initializeFill(NodeRealizer, Graphics2D)
protected java.awt.Color getFillColor(NodeRealizer context, boolean selected)
getFillColor
in class AbstractCustomNodePainter
selected
- ignored. Always considered to be false
.context
- the context node
null
public boolean contains(NodeRealizer context, double x, double y)
GenericNodeRealizer.ContainsTest
GenericNodeRealizer.contains(double, double)
method.
contains
in interface GenericNodeRealizer.ContainsTest
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |