public class PaintSettings extends java.lang.Object
AlignmentArea
.Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_CURSOR_LINE_WIDTH
The initial cursor line width.
|
Constructor and Description |
---|
PaintSettings(AlignmentArea owner)
Creates a new instance of this class using default values for the properties.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addListener(PaintSettingsListener listener)
Attaches a paint settings listener to this instance.
|
protected void |
firePropertyChanged(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue) |
protected void |
fireTokenPainterListChange() |
protected void |
fireTokenPainterReplaced(TokenPainter previousPainter,
TokenPainter newPainter,
int index) |
protected void |
fireZoomChange(double oldZoomX,
double oldZoomY) |
java.awt.Color |
getCursorColor() |
double |
getCursorLineWidth() |
AlignmentArea |
getOwner()
Returns the alignment area using this instance.
|
java.awt.Color |
getSelectionColor() |
double |
getTokenHeight()
Returns the height of tokens displayed in this alignment recognizing the current value of
getZoomY() . |
java.awt.Font |
getTokenHeightFont()
Returns a sans serif plain font object with the size according to the token height in the current zoom factor.
|
TokenPainterList |
getTokenPainterList()
Returns the list of token painters to be used for the output of the data from the alignment model.
|
double |
getTokenWidth(int columnIndex)
Returns the width of the column with the specified index.
|
double |
getZoomX()
Returns the vertical zoom factor in an alignment area, that e.g.
|
double |
getZoomY()
Returns the horizontal zoom factor in an alignment area, that e.g.
|
boolean |
isChangeZoomXOnMouseWheel()
Indicates whether the horizontal zoom factor shall be changed, if the user moves the mouse wheel
while pressing the control button (or meta button on Macs).
|
boolean |
isChangeZoomYOnMouseWheel()
Indicates whether the vertical zoom factor shall be changed, if the user moves the mouse wheel
while pressing the control button (or meta button on Macs).
|
double |
maxTokenWidth()
Returns the maximal token width in the alignment according to the current zoom factor.
|
double |
minTokenWidth()
Returns the minimal token width in the alignment according to the current zoom factor.
|
boolean |
removeListener(PaintSettingsListener listener)
Removes a paint settings listener from this instance.
|
void |
setChangeZoomXOnMouseWheel(boolean zoomXOnMouseWheel) |
void |
setChangeZoomYOnMouseWheel(boolean zoomYOnMouseWheel) |
void |
setCursorColor(java.awt.Color cursorColor)
Sets a new color to paint the alignment cursor.
|
void |
setCursorLineWidth(double cursorLineWidth) |
void |
setSelectionColor(java.awt.Color selectionColor)
Sets a new color of the selection in the owning alignment area.
|
void |
setZoom(double zoomX,
double zoomY)
Allows to specify a new horizontal and vertical zoom factor in a single operation.
|
void |
setZoomX(double zoomX)
Allows to specify a new horizontal zoom factor.
|
void |
setZoomY(double zoomY)
Allows to specify a new vertical zoom factor.
|
java.awt.Font |
zoomFont(java.awt.Font font) |
public static final double DEFAULT_CURSOR_LINE_WIDTH
public PaintSettings(AlignmentArea owner)
owner
- the alignment area using this instancepublic AlignmentArea getOwner()
public TokenPainterList getTokenPainterList()
The size and the order of the list are updated automatically depending on alignment model changes (events).
public java.awt.Color getCursorColor()
public void setCursorColor(java.awt.Color cursorColor)
cursorColor
- the new cursor colorjava.lang.NullPointerException
- if null
is specifiedpublic java.awt.Color getSelectionColor()
public void setSelectionColor(java.awt.Color selectionColor)
selectionColor
- the new selection colorjava.lang.NullPointerException
- if null
is specifiedpublic double getCursorLineWidth()
public void setCursorLineWidth(double cursorLineWidth)
public double getZoomX()
1.0
indicates 100 % zoom (original size)public double getZoomY()
1.0
indicates 100 % zoom (original size)public void setZoomX(double zoomX)
Note that setZoom(double, double)
should always be preferred (when both properties
are to be set) over calling both single parameter setters in sequence to avoid unnecessary
repaint and resize operations.
zoomX
- the new horizontal zoom factorjava.lang.IllegalArgumentException
- if a zoom factor <= 0 is specifiedsetZoom(double, double)
,
setChangeZoomXOnMouseWheel(boolean)
public void setZoomY(double zoomY)
Note that setZoom(double, double)
should always be preferred (when both properties
are to be set) over calling both single parameter setters in sequence to avoid unnecessary
repaint and resize operations.
zoomY
- the new vertical zoom factorjava.lang.IllegalArgumentException
- if a zoom factor <= 0 is specifiedsetZoom(double, double)
,
setChangeZoomYOnMouseWheel(boolean)
public void setZoom(double zoomX, double zoomY)
zoomX
- the new horizontal zoom factorzoomY
- the new vertical zoom factorjava.lang.IllegalArgumentException
- if a zoom factor <= 0 is specifiedsetChangeZoomXOnMouseWheel(boolean)
,
setChangeZoomYOnMouseWheel(boolean)
public boolean isChangeZoomXOnMouseWheel()
true
if the zoom will be changed, false
otherwisepublic void setChangeZoomXOnMouseWheel(boolean zoomXOnMouseWheel)
public boolean isChangeZoomYOnMouseWheel()
true
if the zoom will be changed, false
otherwisepublic void setChangeZoomYOnMouseWheel(boolean zoomYOnMouseWheel)
public double getTokenWidth(int columnIndex)
columnIndex
- the index of the column to determine the width frompublic double maxTokenWidth()
The preferred with of a respective default painter is considered if a painter for at least one
alignment model (if model models are present using ConcatenatedAlignmentModel
) is missing
in the list.
public double minTokenWidth()
The preferred with of a respective default painter is considered if a painter for at least one
alignment model (if model models are present using ConcatenatedAlignmentModel
) is missing
in the list.
public double getTokenHeight()
getZoomY()
.public java.awt.Font getTokenHeightFont()
public java.awt.Font zoomFont(java.awt.Font font)
public boolean addListener(PaintSettingsListener listener)
listener
- the listener to be attachedtrue
if the new listener was added, false
if that listener was already attachedpublic boolean removeListener(PaintSettingsListener listener)
listener
- the listener to be removedtrue
if the listener was removed, false
if it was not attached before calling this methodprotected void firePropertyChanged(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
protected void fireZoomChange(double oldZoomX, double oldZoomY)
protected void fireTokenPainterReplaced(TokenPainter previousPainter, TokenPainter newPainter, int index)
protected void fireTokenPainterListChange()