Package elki.visualization.svg
Class SVGScoreBar
- java.lang.Object
-
- elki.visualization.svg.SVGScoreBar
-
public class SVGScoreBar extends java.lang.Object
Draw 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.NumberFormat
format
Number format, set to print the actual scoreprotected java.lang.String
label
Label (on the right)protected double
max
Value, minimum and maximum valuesprotected double
min
Value, minimum and maximum valuesprotected boolean
reversed
Reversed flag.protected double
val
Value, minimum and maximum values
-
Constructor Summary
Constructors Constructor Description SVGScoreBar()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLabel(java.lang.String text)
Set label (right of the bar)org.w3c.dom.Element
build(SVGPlot svgp, double x, double y, double width, double height)
Build the actual elementvoid
setFill(double val, double min, double max)
Set the fill of the score bar.void
setReversed(boolean reversed)
Set the reversed flag.void
showValues(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
-
-