public class TracePainterFill extends TracePainterPolyline
Additionally it increases performance by summing up all points to render for
a paint iteration (submitted by
paintPoint(int, int, int, int, Graphics, ITracePoint2D)
between
TracePainterPolyline.startPaintIteration(Graphics)
and
endPaintIteration(Graphics)
) and only invoking only one polygon
paint for a paint call of the corresponding
Chart2D
.
m_xPoints, m_yPoints
Constructor and Description |
---|
TracePainterFill(Chart2D chart)
Constructor with the corresponding chart.
|
Modifier and Type | Method and Description |
---|---|
void |
discontinue(Graphics g2d)
Invoked to inform the painter that a discontinue in the trace to # paint has occured.
|
protected void |
doDrawOperation(Graphics g2d,
int[] x,
int[] y,
int length)
This implementation calls the draw operation
Graphics.fillPolygon(int[], int[], int) . |
void |
endPaintIteration(Graphics g2d)
FIXME: Check design if it is possible to reuse the code of superclass
TracePainterPolyline.endPaintIteration(Graphics) here to avoid code
duplication. |
boolean |
equals(Object obj) |
int |
hashCode() |
void |
paintPoint(int absoluteX,
int absoluteY,
int nextX,
int nextY,
Graphics g,
ITracePoint2D original)
Paint the point given by absolute coordinates on the given graphic context.
|
calculateMaxX, calculateMaxY, calculateMinX, calculateMinY, isAdditionalSpaceRequiredX, isAdditionalSpaceRequiredY, isPixelTransformationNeededX, isPixelTransformationNeededY, startPaintIteration
compareTo, getPreviousPoint, getPreviousX, getPreviousY
public TracePainterFill(Chart2D chart)
chart
- needed to get the start pixel coordinates of traces.public void discontinue(Graphics g2d)
ITracePainter
This only has to be implemented by painters that collect several points of
IPointPainter.paintPoint(int, int, int, int, Graphics, ITracePoint2D)
to draw them as polygons (e.g.:
Graphics.drawPolyline(int[], int[], int)
).
discontinue
in interface ITracePainter<ATracePainter>
discontinue
in class ATracePainter
g2d
- provided in case pending paint operations have to be performed.ITracePainter.discontinue(java.awt.Graphics)
public void endPaintIteration(Graphics g2d)
TracePainterPolyline.endPaintIteration(Graphics)
here to avoid code
duplication.
endPaintIteration
in interface IPointPainter<ATracePainter>
endPaintIteration
in class TracePainterPolyline
g2d
- provided in case pending paint operations have to be performed.IPointPainter.endPaintIteration(java.awt.Graphics)
protected void doDrawOperation(Graphics g2d, int[] x, int[] y, int length)
Graphics.fillPolygon(int[], int[], int)
.
doDrawOperation
in class TracePainterPolyline
TracePainterPolyline.doDrawOperation(java.awt.Graphics,
int[], int[], int)
public boolean equals(Object obj)
equals
in class TracePainterPolyline
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class TracePainterPolyline
Object.hashCode()
public void paintPoint(int absoluteX, int absoluteY, int nextX, int nextY, Graphics g, ITracePoint2D original)
IPointPainter
The next coordinates are also provided to allow to check how much distance is available for the graphic representation of the current point.
paintPoint
in interface IPointPainter<ATracePainter>
paintPoint
in class TracePainterPolyline
absoluteX
- the ready to use x value for the point to paint.absoluteY
- the ready to use y value for the point to paint.nextX
- the ready to use next x value for the point to paint.nextY
- the ready to use next y value for the point to paint.g
- the graphic context to paint on.original
- just for information, for painting this should be irrelevant and
it should not be changed too!ATracePainter.paintPoint(int,
int, int, int, java.awt.Graphics,
info.monitorenter.gui.chart.ITracePoint2D)
Copyright © 2019. All rights reserved.