public abstract class LineGlyph extends DrawingGlyph
toThicker(uk.ac.starlink.ttools.plot2.layer.PixerFactory, uk.ac.starlink.ttools.plot2.layer.StrokeKit)
method is supplied to generate another glyph
based on this one but with thicker drawing lines.
Concrete implementations have to be able to supply bounds, and draw the shape onto a supplied PixelDrawing, or to a Graphics context with a given StrokeSet.
Constructor and Description |
---|
LineGlyph() |
Modifier and Type | Method and Description |
---|---|
static PixerFactory |
createKernel(MarkerShape shape,
int nthick)
Returns a smoothing kernel derived from a given marker shape.
|
PixelDrawing |
createPixerFactory(Rectangle clip)
Returns a PixerFactory that produces the pixels for this glyph.
|
static PixerFactory |
createThickKernel(int nthick)
Returns a (roughly circular) smoothing kernel for a thick line.
|
static StrokeKit |
createThickStrokeKit(int nthick)
Returns a stroke kit for drawing a thick line.
|
abstract void |
drawShape(PixelDrawing drawing)
Draws this shape onto a given drawing, whose bounds have
been set appropriately.
|
abstract Rectangle |
getPixelBounds()
Returns the boundary rectangle containing the whole of
the shape that will be drawn to a PixelDrawing.
|
void |
paintGlyph(Graphics g)
Paints a representation of a point considered to be at the origin.
|
abstract void |
paintGlyph(Graphics g,
StrokeKit strokeKit)
Paints this shape onto a graphics context with given line strokes.
|
DrawingGlyph |
toThicker(PixerFactory kernel,
StrokeKit strokeKit)
Returns a glyph that is the same as this one, but with thicker
pen strokes.
|
createPixer
public abstract Rectangle getPixelBounds()
This method is called by createPixerFactory(java.awt.Rectangle)
,
but not by drawShape(uk.ac.starlink.ttools.plot2.layer.PixelDrawing)
.
public abstract void drawShape(PixelDrawing drawing)
drawing
- graphics destinationpublic abstract void paintGlyph(Graphics g, StrokeKit strokeKit)
g
- graphics contextstrokeKit
- supplier of line drawing strokespublic PixelDrawing createPixerFactory(Rectangle clip)
createPixerFactory
in class DrawingGlyph
clip
- clip boundspublic void paintGlyph(Graphics g)
Glyph
g
- graphics contextpublic DrawingGlyph toThicker(PixerFactory kernel, StrokeKit strokeKit)
kernel
- smoothing kernelstrokeKit
- line strokes to use for paintingpublic static PixerFactory createThickKernel(int nthick)
nthick
- line thickness, >=0public static PixerFactory createKernel(MarkerShape shape, int nthick)
shape
- shapenthick
- thickness index >=0public static StrokeKit createThickStrokeKit(int nthick)
nthick
- line thickness, >=0Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.