public class AlignmentPaintEvent extends TICPaintEvent
AlignmentSubArea
that provides information on the area of a component
displaying a part of an alignment to be painted and the graphics context.
The coordinates used in TICPaintEvent.getRectangle()
and TICPaintEvent.getGraphics()
are relative to the left
most pixel of first column of the alignment. Therefore the x-coordinate 0 does necessarily not reference
the left most pixel of the whole component if data areas use space left of the alignment.
Constructor and Description |
---|
AlignmentPaintEvent(java.lang.Object source,
AlignmentArea parentAlignmentArea,
int firstColumn,
int lastColumn,
java.awt.Graphics2D graphics,
java.awt.geom.Rectangle2D rectangle)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
int |
getFirstColumn()
Returns the index of the left most alignment column in the area to be (at least partly) painted.
|
int |
getLastColumn()
Returns the index after the right most alignment alignment column in the area to be (at least partly)
painted.
|
AlignmentArea |
getParentAlignmentArea()
Returns the alignment area that contains the component that triggered this event.
|
getGraphics, getRectangle
public AlignmentPaintEvent(java.lang.Object source, AlignmentArea parentAlignmentArea, int firstColumn, int lastColumn, java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D rectangle)
source
- the object that triggered the eventparentAlignmentArea
- the alignment area containing the component to be repaintedfirstColumn
- the first column of the alignment that shall be (partly) repainted (If only space left of the
alignment shall be repainted, this value should still be 0.)lastColumn
- the index after the last column that shall be (partly) repainted (If only space right of the
alignment shall be repainted, this value should still be equal to the number of columns in the alignment.)graphics
- the swing graphics context used to repaint the componentrectangle
- the rectangle that has to be repainted with coordinates relative to the left most pixel of the
first column of the alignmentjava.lang.IllegalArgumentException
- if source
, parentAlignmentArea
, graphics
or rectangle
are
null
or if firstColumn
or lastColumn
are below 0public AlignmentArea getParentAlignmentArea()
public int getFirstColumn()
If only space left of the alignment shall be repainted, this method will still return 0, even if the first
column is not part if the area to be repainted. (The x-coordinate of TICPaintEvent.getRectangle()
will be
negative in such cases.)
public int getLastColumn()
If only space right of the alignment shall be repainted, this method will always return the index after
the last column of the alignment and coordinates returned by TICPaintEvent.getRectangle()
will be relative to
it, even if the last column is not part if the area to be repainted.