Class DefaultGradientModel

All Implemented Interfaces:
BoundedTableModel, Serializable, TableModel

public class DefaultGradientModel extends AbstractBoundedTableModel
A very basic implementation of AbstractBoundedTableModel used by default by GradientBar. This implementation has bounds 0 - 100 and is mutable.
Author:
Michael Baranov
See Also:
  • Constructor Details

    • DefaultGradientModel

      public DefaultGradientModel()
      Constructor.
  • Method Details

    • getLowerBound

      public int getLowerBound()
      Description copied from interface: BoundedTableModel
      Returns some lower bound, further describing the data.
      Returns:
      lower bound.
    • getUpperBound

      public int getUpperBound()
      Description copied from interface: BoundedTableModel
      Returns some upper bound, further describing the data.
      Returns:
      upper bound.
    • getRowCount

      public int getRowCount()
    • getColumnCount

      public int getColumnCount()
    • getColumnClass

      public Class getColumnClass(int columnIndex)
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
    • getValueAt

      public Object getValueAt(int rowIndex, int columnIndex)
    • add

      public void add(Color color, int position)
      Adds a color point.
      Parameters:
      color -
      position -
    • remove

      public void remove(int index)
      Removes a color point at specified index.
      Parameters:
      index -
    • clear

      public void clear()
      Removes all color points.