Klasse BarChartElement

java.lang.Object
visualizationElements.BarChartElement

public class BarChartElement extends Object
Represents a bar within a bar chart.
  • Felddetails

    • color

      private Color color
    • value

      private int value
  • Konstruktordetails

    • BarChartElement

      public BarChartElement(int value, Color color)
      Creates a new BarChartElement.
      Parameter:
      value - Value (size) of the bar.
      color - Coloring of the bar.
    • BarChartElement

      public BarChartElement(int value)
      Creates a new BarChartElement.
      Parameter:
      value - Value (size) of the bar.
  • Methodendetails

    • draw

      public void draw(Graphics g, int xpos, int yPos, int width, int height)
      Draws the BarChartElement
      Parameter:
      g - The Graphics object to draw the element to the DrawArea.
      xpos - Horizontal position where the barChartElement is drawn.
      yPos - Vertical position where the barChartElement is drawn.
      width - Width of the barChartElement.
      height - Height of the barChartElement.
    • setValue

      public void setValue(int value)
      Parameter:
      value - the value to set
    • getValue

      public int getValue()
      Gibt zurück:
      the value
    • setColor

      public void setColor(Color color)
      Parameter:
      color - the color to set
    • getColor

      public Color getColor()
      Gibt zurück:
      the color