Class FlatIntegerHorizontalSlider

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.jjazz.flatcomponents.api.FlatIntegerHorizontalSlider
All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener

public class FlatIntegerHorizontalSlider extends JComponent implements MouseListener, MouseMotionListener, MouseWheelListener, PropertyChangeListener
An horizontal flat slider.
See Also:
  • Field Details

    • PROP_VALUE

      public static final String PROP_VALUE
      See Also:
    • PROP_COLOR_RIGHT

      public static final String PROP_COLOR_RIGHT
      Client Property: top color, used to created the gradient
      See Also:
    • PROP_COLOR_LEFT

      public static final String PROP_COLOR_LEFT
      Client Property: bottom color, used to created the gradient
      See Also:
    • PROP_LINE_THICKNESS

      public static final String PROP_LINE_THICKNESS
      Client Property: line thickness
      See Also:
    • PROP_NB_GRADUATION_MARKS

      public static final String PROP_NB_GRADUATION_MARKS
      Client Property: number of graduation marks
      See Also:
    • PROP_HIDE_VALUE_IF_NOT_ACTIVE

      public static final String PROP_HIDE_VALUE_IF_NOT_ACTIVE
      Client Property: hide value text if not active : 0=false, 1=true
      See Also:
    • PROP_HIDE_VALUE

      public static final String PROP_HIDE_VALUE
      Client Property: hide value : 0=false, 1=true
      See Also:
    • PROP_WH_RATIO

      public static final String PROP_WH_RATIO
      Client Property: float number, ratio used to calculate the preferred size
      See Also:
  • Constructor Details

    • FlatIntegerHorizontalSlider

      public FlatIntegerHorizontalSlider()
  • Method Details

    • getLastMouseEvent

      public MouseEvent getLastMouseEvent()
      The last MouseEvent corresponding to the last mouse drag or wheel user action to change the slider value.

      Can be used by listeners to retrieve the shift/ctrl/alt modifiers after having received a value property change.

      Returns:
      Can be null if last user action was not a mouse drag/wheel (e.g. if he used the inline editor)
    • getColorLine

      public Color getColorLine()
      Returns:
      the colorLine
    • setColorLine

      public void setColorLine(Color colorLine)
      Parameters:
      colorLine - the colorLine to set
    • getKnobDiameter

      public int getKnobDiameter()
      Returns:
      the knobDiameter
    • setKnobDiameter

      public void setKnobDiameter(int knobDiameter)
      Parameters:
      knobDiameter - the knobDiameter to set
    • getColorKnobFill

      public Color getColorKnobFill()
      Returns:
      the colorKnobFill
    • setColorKnobFill

      public void setColorKnobFill(Color colorKnobFill)
      Parameters:
      colorKnobFill - the colorKnobFill to set
    • getFaderHeight

      public int getFaderHeight()
      Returns:
      the faderHeight
    • setFaderHeight

      public void setFaderHeight(int faderHeight)
      Parameters:
      faderHeight - the faderHeight to set
    • getMinValue

      public int getMinValue()
      Returns:
      the minValue
    • setMinValue

      public void setMinValue(int minValue)
      Parameters:
      minValue - the minValue to set
    • getMaxValue

      public int getMaxValue()
      Returns:
      the maxValue
    • setMaxValue

      public void setMaxValue(int maxValue)
      Parameters:
      maxValue - the maxValue to set
    • getGraduationLength

      public int getGraduationLength()
      Returns:
      the graduationLength
    • setGraduationLength

      public void setGraduationLength(int graduationLength)
      Parameters:
      graduationLength - the graduationLength to set
    • paintComponent

      public void paintComponent(Graphics g)
    • setValue

      public void setValue(int v)
    • getValue

      public int getValue()
    • setBorder

      public void setBorder(Border b)
      Overridden to update our settings.
      Overrides:
      setBorder in class JComponent
      Parameters:
      b -
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • setEnabled

      public void setEnabled(boolean b)
      Overrides:
      setEnabled in class JComponent
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      Specified by:
      mouseClicked in interface MouseListener
    • mousePressed

      public void mousePressed(MouseEvent e)
      Specified by:
      mousePressed in interface MouseListener
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Specified by:
      mouseReleased in interface MouseListener
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Specified by:
      mouseEntered in interface MouseListener
    • mouseExited

      public void mouseExited(MouseEvent e)
      Specified by:
      mouseExited in interface MouseListener
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      Specified by:
      mouseDragged in interface MouseMotionListener
    • mouseMoved

      public void mouseMoved(MouseEvent e)
      Specified by:
      mouseMoved in interface MouseMotionListener
    • mouseWheelMoved

      public void mouseWheelMoved(MouseWheelEvent e)
      Specified by:
      mouseWheelMoved in interface MouseWheelListener
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener