
eu.hansolo.steelseries.gauges.AbstractLinearBargraph Maven / Gradle / Ivy
package eu.hansolo.steelseries.gauges;
/**
*
* @author hansolo
*/
public abstract class AbstractLinearBargraph extends AbstractLinear
{
//
private int tickLabelPeriod = 10; // Draw value at every nth tickmark
private eu.hansolo.steelseries.tools.ColorDef barGraphColor = eu.hansolo.steelseries.tools.ColorDef.RED;
private eu.hansolo.steelseries.tools.CustomColorDef customBarGraphColor = new eu.hansolo.steelseries.tools.CustomColorDef(java.awt.Color.RED);
private boolean peakValueEnabled = false;
//
//
public AbstractLinearBargraph()
{
super();
}
//
//
// @Override
// public void setMinValue(final double MIN_VALUE)
// {
// super.setMinValue(MIN_VALUE);
// if (MIN_VALUE < 0)
// {
// setValue(MIN_VALUE);
// }
// }
/**
* Returns the period between tickmarks.
* Means if the ticklabel period = 10 => every 10th tickmark will
* be painted
* @return integer that represents the period between the tickmarks
*/
public int getTickLabelPeriod()
{
return this.tickLabelPeriod;
}
/**
* Sets the period between tickmarks.
* Means if the ticklabel period = 10 => every 10th tickmark will
* be painted
* @param TICK_LABEL_PERIOD
*/
public void setTickLabelPeriod(final int TICK_LABEL_PERIOD)
{
this.tickLabelPeriod = TICK_LABEL_PERIOD;
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.TICKMARKS);
init(getInnerBounds().width, getInnerBounds().height);
repaint(getInnerBounds());
}
/**
* Returns the enum colordef that is defined for the current bargraph
* @return enum colordef that represents the current bargraph color
*/
public eu.hansolo.steelseries.tools.ColorDef getBarGraphColor()
{
return this.barGraphColor;
}
/**
* Sets the current bargraph color to the given enum colordef
* @param BARGRAPH_COLOR
*/
public void setBarGraphColor(final eu.hansolo.steelseries.tools.ColorDef BARGRAPH_COLOR)
{
this.barGraphColor = BARGRAPH_COLOR;
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.BARGRAPHTRACK);
init(getInnerBounds().width, getInnerBounds().height);
repaint(getInnerBounds());
}
/**
* Returns the color that will be used to calculate the custom bargraph color
* @return the color that will be used to calculate the custom bargraph color
*/
public java.awt.Color getCustomBargraphColor()
{
return this.customBarGraphColor.COLOR;
}
/**
* Sets the color that will be used to calculate the custom bargraph color
* @param COLOR
*/
public void setCustomBarGraphColor(final java.awt.Color COLOR)
{
this.customBarGraphColor = new eu.hansolo.steelseries.tools.CustomColorDef(COLOR);
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.BARGRAPHTRACK);
init(getInnerBounds().width, getInnerBounds().width);
repaint(getInnerBounds());
}
/**
* Returns the object that represents holds the custom bargraph color
* @return the object that represents the custom bargraph color
*/
public eu.hansolo.steelseries.tools.CustomColorDef getCustomBarGraphColorObject()
{
return this.customBarGraphColor;
}
/**
* Returns true if the peak value is visible
* @return true if the park value is visible
*/
public boolean isPeakValueEnabled()
{
return this.peakValueEnabled;
}
/**
* Enables/Disables the visibility of the peak value
* @param PEAK_VALUE_ENABLED
*/
public void setPeakValueEnabled(final boolean PEAK_VALUE_ENABLED)
{
this.peakValueEnabled = PEAK_VALUE_ENABLED;
}
//
@Override
protected void recreateAllImages()
{
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.FRAME);
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.BACKGROUND);
//IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.POSTS);
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.BARGRAPHTRACK);
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.TRACK);
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.TICKMARKS);
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.TITLE);
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.THRESHOLD);
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.LOW);
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.HIGH);
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.LCD);
//IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.POINTER);
//IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.POINTER_SHADOW);
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.FOREGROUND);
IMAGES_TO_UPDATE.add(eu.hansolo.steelseries.tools.ImageType.DISABLED);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy