y.view
Class GeneralPathNodePainter

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

public class GeneralPathNodePainter
extends AbstractCustomNodePainter
implements GenericNodeRealizer.ContainsTest

This class represents a custom painter and ContainsTest implementation for GenericNodeRealizer that can be used with any kind of GeneralPath.

 

Constructor Summary
GeneralPathNodePainter(GeneralPath path)
           
 
Method Summary
 boolean contains(NodeRealizer context, double x, double y)
          Used as a callback for the GenericNodeRealizer.contains(double, double) method.
protected  Color getFillColor(NodeRealizer context, boolean selected)
          Overrides the default fill color to be the same as the unselected fill color.
protected  void paintNode(NodeRealizer context, 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, paintSloppy, restoreGraphics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneralPathNodePainter

public GeneralPathNodePainter(GeneralPath path)
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)

getFillColor

protected Color getFillColor(NodeRealizer context,
                             boolean selected)
Overrides the default fill color to be the same as the unselected fill color.

Overrides:
getFillColor in class AbstractCustomNodePainter
Parameters:
context - the context node
selected - whether the node is currently selected
Returns:
the Color to use or null

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.