Package elki.visualization.svg
Class SVGScoreBar
- java.lang.Object
-
- elki.visualization.svg.SVGScoreBar
-
public class SVGScoreBar extends java.lang.ObjectDraw a score bar. Essentially like a progress bar, left-to-right, displaying a relative score.- Since:
- 0.5.0
- Author:
- Sascha Goldhofer
-
-
Field Summary
Fields Modifier and Type Field Description private java.text.NumberFormatformatNumber format, set to print the actual scoreprotected java.lang.StringlabelLabel (on the right)protected doublemaxValue, minimum and maximum valuesprotected doubleminValue, minimum and maximum valuesprotected booleanreversedReversed flag.protected doublevalValue, minimum and maximum values
-
Constructor Summary
Constructors Constructor Description SVGScoreBar()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLabel(java.lang.String text)Set label (right of the bar)org.w3c.dom.Elementbuild(SVGPlot svgp, double x, double y, double width, double height)Build the actual elementvoidsetFill(double val, double min, double max)Set the fill of the score bar.voidsetReversed(boolean reversed)Set the reversed flag.voidshowValues(java.text.NumberFormat format)To show score values, set a number format
-
-
-
Field Detail
-
val
protected double val
Value, minimum and maximum values
-
min
protected double min
Value, minimum and maximum values
-
max
protected double max
Value, minimum and maximum values
-
reversed
protected boolean reversed
Reversed flag.
-
label
protected java.lang.String label
Label (on the right)
-
format
private java.text.NumberFormat format
Number format, set to print the actual score
-
-
Method Detail
-
setFill
public void setFill(double val, double min, double max)Set the fill of the score bar.- Parameters:
val- Valuemin- Minimum valuemax- Maximum value
-
setReversed
public void setReversed(boolean reversed)
Set the reversed flag.- Parameters:
reversed- Reversed flag.
-
addLabel
public void addLabel(java.lang.String text)
Set label (right of the bar)- Parameters:
text- Label text
-
showValues
public void showValues(java.text.NumberFormat format)
To show score values, set a number format- Parameters:
format- Number format
-
build
public org.w3c.dom.Element build(SVGPlot svgp, double x, double y, double width, double height)
Build the actual element- Parameters:
svgp- Plot to draw tox- X coordinatey- Y coordinatewidth- Widthheight- Height- Returns:
- new element
-
-