Class FlatIntegerKnob

All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class FlatIntegerKnob extends JPanel implements MouseMotionListener, MouseWheelListener, MouseListener
A flat knob.

Value can be changed by dragging mouse or mouse wheel. ctrl-click reset the value. Whatever the actual component size, the drawing is done at preferred size.

See Also:
  • Field Details

    • PROP_VALUE

      public static final String PROP_VALUE
      Fire a PROP_Value property change event when user changes the value.
      See Also:
  • Constructor Details

    • FlatIntegerKnob

      public FlatIntegerKnob()
  • Method Details

    • getPreferredSize

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

      public void paintComponent(Graphics g)
    • setEnabled

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

      public Color getValueLineColor()
      Returns:
      the valueLineColor
    • setValueLineColor

      public void setValueLineColor(Color valueLineColor)
      Parameters:
      valueLineColor - the valueLineColor to set
    • getValueLineThickness

      public double getValueLineThickness()
      Returns:
      the valueLineThickness
    • setValueLineThickness

      public void setValueLineThickness(double valueLineThickness)
      Parameters:
      valueLineThickness - the valueLineThickness 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
    • getTooltipLabel

      public String getTooltipLabel()
    • setTooltipLabel

      public void setTooltipLabel(String tooltipLabel)
      If not null and isUseValueTooltip==true, use tooltipLabel to automatically form the tooltip.
      Parameters:
      tooltipLabel -
      See Also:
    • isUseValueTooltip

      public boolean isUseValueTooltip()
      True if the tooltip is automatically set from the value and tooltipLabel.
      Returns:
      True by default.
      See Also:
    • setUseValueTooltip

      public void setUseValueTooltip(boolean useValueTooltip)
      If true the tooltip is automatically set using the tooltip label (if not null) and the knob value.
      Parameters:
      useValueTooltip -
      See Also:
    • setValue

      public void setValue(int v)
    • getValue

      public int getValue()
    • getKnobRadius

      public double getKnobRadius()
      Returns:
      the knobRadius
    • setKnobRadius

      public void setKnobRadius(double knobRadius)
      Parameters:
      knobRadius - the knobRadius to set
    • getKnobStartAngle

      public double getKnobStartAngle()
      Returns:
      the knobStartAngle
    • setKnobStartAngle

      public void setKnobStartAngle(double angle)
      Parameters:
      angle - Between 180 and 270 degrees.
    • getKnobUpperColor

      public Color getKnobUpperColor()
      Returns:
      the knobUpperColor
    • setKnobUpperColor

      public void setKnobUpperColor(Color knobUpperColor)
      Parameters:
      knobUpperColor - the knobUpperColor to set
    • getKnobLowerColor

      public Color getKnobLowerColor()
      Returns:
      the knobLowerColor
    • setKnobLowerColor

      public void setKnobLowerColor(Color knobLowerColor)
      Parameters:
      knobLowerColor - the knobLowerColor to set
    • getValueLineGap

      public double getValueLineGap()
      Returns:
      the valueLineGap
    • setValueLineGap

      public void setValueLineGap(double valueLineGap)
      Parameters:
      valueLineGap - the valueLineGap to set
    • getKnobRectColor

      public Color getKnobRectColor()
      Returns:
      the knobRectColor
    • setKnobRectColor

      public void setKnobRectColor(Color knobRectColor)
      Parameters:
      knobRectColor - the knobRectColor to set
    • getPadding

      public int getPadding()
      Returns:
      the padding
    • setPadding

      public void setPadding(int padding)
      Parameters:
      padding - the padding to set
    • getKnobRectColorDisabled

      public Color getKnobRectColorDisabled()
      Returns:
      the knobRectColorDisabled
    • setKnobRectColorDisabled

      public void setKnobRectColorDisabled(Color knobRectColorDisabled)
      Parameters:
      knobRectColorDisabled - the knobRectColorDisabled to set
    • isPanoramicType

      public boolean isPanoramicType()
      Returns:
      the panoramicType. Default is false.
    • setPanoramicType

      public void setPanoramicType(boolean panoramicType)
      Parameters:
      panoramicType - the panoramicType to set
    • mouseDragged

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

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

      public void mouseClicked(MouseEvent e)
      Specified by:
      mouseClicked 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
    • mousePressed

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

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

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