|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.AbstractCustomHotSpotPainter
public abstract class AbstractCustomHotSpotPainter
Abstract base class that can be used with customizations of GenericNodeRealizer
instances.
This base class contains utility functions and delegate the actual work to
simpler abstract methods.
Constructor Summary | |
---|---|
AbstractCustomHotSpotPainter()
Creates a new instance of AbstractCustomHotspotPainter that
paints all 8 possible hot spots. |
|
AbstractCustomHotSpotPainter(int mask)
Creates a new instance of AbstractCustomHotspotPainter using a
bit mask to determine which of the 8 possible hotspots to use. |
Method Summary | |
---|---|
byte |
hotSpotHit(NodeRealizer context,
double hx,
double hy)
Used as a callback for the GenericNodeRealizer.hotSpotHit(double, double) method. |
protected void |
initGraphics(NodeRealizer context,
java.awt.Graphics2D graphics)
Utility method used by paintHotSpots(NodeRealizer, java.awt.Graphics2D)
to initialize the graphics context. |
protected abstract boolean |
isHit(byte hotSpot,
double centerX,
double centerY,
double testX,
double testY)
Callback method used by hotSpotHit(NodeRealizer, double ,double) |
protected abstract void |
paint(byte hotSpot,
double centerX,
double centerY,
java.awt.Graphics2D graphics)
Callback method called during paintHotSpots(NodeRealizer, java.awt.Graphics2D) |
void |
paintHotSpots(NodeRealizer context,
java.awt.Graphics2D graphics)
Used as a callback for the GenericNodeRealizer.paintHotSpots(Graphics2D) method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractCustomHotSpotPainter()
AbstractCustomHotspotPainter
that
paints all 8 possible hot spots.
public AbstractCustomHotSpotPainter(int mask)
AbstractCustomHotspotPainter
using a
bit mask to determine which of the 8 possible hotspots to use.
mask
- the bit mask that specifies which hot spots to use.
Consult the following table to determine which bit corresponds to which hot
spot.
Bit | Hot Spot |
1 | north west |
2 | north |
3 | north east |
4 | west |
5 | east |
6 | south west |
7 | south |
8 | south east |
mask
equals
24
) the western and eastern hot spots will be used.Method Detail |
---|
protected abstract void paint(byte hotSpot, double centerX, double centerY, java.awt.Graphics2D graphics)
paintHotSpots(NodeRealizer, java.awt.Graphics2D)
hotSpot
- a NodeRealizer
HOTSPOT constant defining the type of hotspot to paintcenterX
- the center of the hotspotcenterY
- the center of the hotspotgraphics
- the graphics to draw onprotected abstract boolean isHit(byte hotSpot, double centerX, double centerY, double testX, double testY)
hotSpotHit(NodeRealizer, double ,double)
hotSpot
- a NodeRealizer
HOTSPOT constant defining the type of hotspot to testcenterX
- the center of the hotspotcenterY
- the center of the hotspottestX
- the center of the hit-testtestY
- the center of the hit-test
protected void initGraphics(NodeRealizer context, java.awt.Graphics2D graphics)
paintHotSpots(NodeRealizer, java.awt.Graphics2D)
to initialize the graphics context.
context
- the realizer to obtain the context fromgraphics
- the graphics to initializepublic void paintHotSpots(NodeRealizer context, java.awt.Graphics2D graphics)
GenericNodeRealizer.HotSpotPainter
GenericNodeRealizer.paintHotSpots(Graphics2D)
method.
paintHotSpots
in interface GenericNodeRealizer.HotSpotPainter
public byte hotSpotHit(NodeRealizer context, double hx, double hy)
GenericNodeRealizer.HotSpotHitTest
GenericNodeRealizer.hotSpotHit(double, double)
method.
hotSpotHit
in interface GenericNodeRealizer.HotSpotHitTest
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |