|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot2.layer.XYShape
public abstract class XYShape
Abstract superclass for shapes characterised by a pair of short integer values. These values typically represent the horizontal and vertical extent of a shape, but they don't have to.
This object acts as a factory for Glyphs. These glyphs are lazily cached per instance of this class for small values of the X and Y coordinates (since there aren't very many of them, and they are probably used frequently); for larger values, the glyphs are created on demand.
Field Summary | |
---|---|
static Glyph |
POINT
Glyph that paints a single pixel at the origin. |
Constructor Summary | |
---|---|
protected |
XYShape(String name)
Constructs a shape with a default cache limit. |
protected |
XYShape(String name,
int maxCacheRadius)
Constructs a shape with a specified cache limit. |
Method Summary | |
---|---|
protected abstract Glyph |
createGlyph(short sx,
short sy)
Constructs a new glyph with given coordinates. |
static Icon |
createIcon(XYShape shape,
int width,
int height,
boolean useComponentColor)
Returns an icon displaying a given shape. |
Glyph |
getGlyph(short sx,
short sy)
Obtains a glyph characterised by a given pair of values. |
String |
getName()
Returns the name of this shape. |
boolean |
isCached(short sx,
short sy)
Indicates whether a glyph of a given size will be cached. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static Glyph POINT
Constructor Detail |
---|
protected XYShape(String name, int maxCacheRadius)
name
- shape namemaxCacheRadius
- glyphs are cached if both input values
have an absolute value lower than or equal
to this limitprotected XYShape(String name)
name
- shape nameMethod Detail |
---|
public String getName()
public boolean isCached(short sx, short sy)
sx
- X radiussy
- Y radius
public Glyph getGlyph(short sx, short sy)
sx
- X valuesy
- Y value
protected abstract Glyph createGlyph(short sx, short sy)
sx
- X valuesy
- Y value
public String toString()
toString
in class Object
public static Icon createIcon(XYShape shape, int width, int height, boolean useComponentColor)
shape
- shapewidth
- icon widthheight
- icon heightuseComponentColor
- if true, the glyph will be painted in
the component's foreground colour
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |