Package com.compomics.util.gui.spectrum
Class ReferenceArea
java.lang.Object
com.compomics.util.gui.spectrum.ReferenceArea
A reference area to be added to a GraphicsPanel.
- Author:
- Harald Barsnes.
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty default constructorReferenceArea(String identifier, String label, double start, double end, Color areaColor, float alpha, boolean drawOnTop, boolean drawLabel, boolean aboveXAxis) Creates a new ReferenceArea.ReferenceArea(String identifier, String label, double start, double end, Color areaColor, float alpha, boolean drawOnTop, boolean drawLabel, Color labelColor, boolean boldFont, Color borderColor, float borderWidth, double percentLength, boolean aboveXAxis) Creates a new ReferenceArea. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the label is to be drawn, false otherwise.booleanReturns true if the area is to be drawn in front of the data, false otherwise.floatgetAlpha()Get the alpha level (transparency).Get the area color.Returns the border color.floatReturns the border width.doublegetEnd()Get the end value.Returns the reference identifier.getLabel()Returns the label.Returns the label color.doubleReturns the length of the reference area in percent.doublegetStart()Get the start value.booleanReturns true if the reference area is added above the x-axis, false adds the reference are below the x-axisvoidsetAboveXAxis(boolean aboveXAxis) Set if the reference area is to be added above the x-axis, false adds the reference are below the x-axisvoidsetAlpha(float alpha) Set the alpha level (transparency).voidsetAreaColor(Color areaColor) Set the area color.voidsetBoldFont(boolean boldFont) Set if the label is to be in bold.voidsetBorderColor(Color borderColor) Set the border color.voidsetBorderWidth(float borderWidth) Set the border width.voidsetDrawLabel(boolean drawLabel) Set to true if the label is to be drawn, false otherwise.voidsetDrawOnTop(boolean drawOnTop) Set to true if the area is to be drawn in front of the data, false otherwise.voidsetEnd(double end) Set the end value.voidsetIdentifier(String identifier) Sets the references identifier.voidSets the label.voidsetLabelColor(Color labelColor) Set the label color.voidsetPercentLength(double percentLength) Set the length of the reference area in percent.voidsetStart(double start) Set the start value.booleanReturns true of the label should be in bold.
-
Constructor Details
-
ReferenceArea
public ReferenceArea()Empty default constructor -
ReferenceArea
public ReferenceArea(String identifier, String label, double start, double end, Color areaColor, float alpha, boolean drawOnTop, boolean drawLabel, boolean aboveXAxis) throws IllegalArgumentException Creates a new ReferenceArea.- Parameters:
identifier- the reference identifier, has to be uniquelabel- the reference label, i.e., what is shown on the screenstart- the start of the reference areaend- the end of the reference areaareaColor- the color of the reference areaalpha- the alpha level (transparency) of the reference areadrawOnTop- if the area is to be drawn on top of or behind the datadrawLabel- if the label is to be drawn or notaboveXAxis- if true the reference area is added above the x-axis, false adds the reference are below the x-axis- Throws:
IllegalArgumentException- alpha must be in the range 0.0f to 1.0f
-
ReferenceArea
public ReferenceArea(String identifier, String label, double start, double end, Color areaColor, float alpha, boolean drawOnTop, boolean drawLabel, Color labelColor, boolean boldFont, Color borderColor, float borderWidth, double percentLength, boolean aboveXAxis) throws IllegalArgumentException Creates a new ReferenceArea.- Parameters:
identifier- the reference identifier, has to be uniquelabel- the reference label, i.e., what is shown on the screenstart- the start of the reference areaend- the end of the reference areaareaColor- the color of the reference areaalpha- the alpha level (transparency) of the reference areadrawOnTop- if the area is to be drawn on top of or behind the datadrawLabel- if the label is to be drawn or notlabelColor- the color to use for the labelboldFont- if the label is to be in bold fontborderColor- the border colorborderWidth- the border widthpercentLength- the length in percent, [0.0 - 1.0].aboveXAxis- if true the reference area is added above the x-axis, false adds the reference are below the x-axis- Throws:
IllegalArgumentException- alpha must be in the range 0.0f to 1.0f
-
-
Method Details
-
getLabel
Returns the label.- Returns:
- the label
-
setLabel
Sets the label.- Parameters:
label- the label to set
-
getStart
public double getStart()Get the start value.- Returns:
- the start
-
setStart
public void setStart(double start) Set the start value.- Parameters:
start- the start to set
-
getEnd
public double getEnd()Get the end value.- Returns:
- the end
-
setEnd
public void setEnd(double end) Set the end value.- Parameters:
end- the end to set
-
getAreaColor
Get the area color.- Returns:
- the areaColor
-
setAreaColor
Set the area color.- Parameters:
areaColor- the areaColor to set
-
getAlpha
public float getAlpha()Get the alpha level (transparency).- Returns:
- the alpha level
-
setAlpha
public void setAlpha(float alpha) Set the alpha level (transparency).- Parameters:
alpha- the alpha level to set
-
drawOnTop
public boolean drawOnTop()Returns true if the area is to be drawn in front of the data, false otherwise.- Returns:
- true if the area is to be drawn in front of the data, false otherwise
-
setDrawOnTop
public void setDrawOnTop(boolean drawOnTop) Set to true if the area is to be drawn in front of the data, false otherwise.- Parameters:
drawOnTop- if the area is to be drawn in front of the data
-
drawLabel
public boolean drawLabel()Returns true if the label is to be drawn, false otherwise.- Returns:
- true if the label is to be drawn, false otherwise
-
setDrawLabel
public void setDrawLabel(boolean drawLabel) Set to true if the label is to be drawn, false otherwise.- Parameters:
drawLabel- if the label is to be drawn
-
getLabelColor
Returns the label color.- Returns:
- the labelColor
-
setLabelColor
Set the label color.- Parameters:
labelColor- the labelColor to set
-
useBoldFont
public boolean useBoldFont()Returns true of the label should be in bold.- Returns:
- the boldFont
-
setBoldFont
public void setBoldFont(boolean boldFont) Set if the label is to be in bold.- Parameters:
boldFont- the boldFont to set
-
getBorderColor
Returns the border color.- Returns:
- the borderColor
-
setBorderColor
Set the border color.- Parameters:
borderColor- the borderColor to set
-
getBorderWidth
public float getBorderWidth()Returns the border width.- Returns:
- the borderWidth
-
setBorderWidth
public void setBorderWidth(float borderWidth) Set the border width.- Parameters:
borderWidth- the borderWidth to set
-
getPercentLength
public double getPercentLength()Returns the length of the reference area in percent. For x-axis areas this is the height of the area from the x-axis upwards, while for y-axis area this is the width of the area from the y-axis and to the right. Range: [0.0 - 1.0].- Returns:
- the percentLength
-
setPercentLength
public void setPercentLength(double percentLength) Set the length of the reference area in percent. For x-axis areas this is the height of the area from the x-axis upwards, while for y-axis area this is the width of the area from the y-axis and to the right. Range: [0.0 - 1.0].- Parameters:
percentLength- the percentLength to set
-
getIdentifier
Returns the reference identifier.- Returns:
- the identifier
-
setIdentifier
Sets the references identifier. Has to be unique.- Parameters:
identifier- the identifier to set
-
isAboveXAxis
public boolean isAboveXAxis()Returns true if the reference area is added above the x-axis, false adds the reference are below the x-axis- Returns:
- true if the reference area is added above the x-axis, false adds the reference are below the x-axis
-
setAboveXAxis
public void setAboveXAxis(boolean aboveXAxis) Set if the reference area is to be added above the x-axis, false adds the reference are below the x-axis- Parameters:
aboveXAxis- if the reference area is to be added above the x-axis
-