Package org.jjazz.flatcomponents.api
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Client Property: bottom color, used to created the gradientstatic final String
Client Property: top color, used to created the gradientstatic final String
Client Property: hide value : 0=false, 1=truestatic final String
Client Property: hide value text if not active : 0=false, 1=truestatic final String
Client Property: line thicknessstatic final String
Client Property: number of graduation marksstatic final String
static final String
Client Property: float number, ratio used to calculate the preferred sizeFields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
int
int
The last MouseEvent corresponding to the last mouse drag or wheel user action to change the slider value.int
int
int
getValue()
void
void
void
void
void
void
void
void
void
void
void
Overridden to update our settings.void
setColorKnobFill
(Color colorKnobFill) void
setColorLine
(Color colorLine) void
setEnabled
(boolean b) void
setFaderHeight
(int faderHeight) void
setGraduationLength
(int graduationLength) void
setKnobDiameter
(int knobDiameter) void
setMaxValue
(int maxValue) void
setMinValue
(int minValue) void
setValue
(int v) Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
PROP_VALUE
- See Also:
-
PROP_COLOR_RIGHT
Client Property: top color, used to created the gradient- See Also:
-
PROP_COLOR_LEFT
Client Property: bottom color, used to created the gradient- See Also:
-
PROP_LINE_THICKNESS
Client Property: line thickness- See Also:
-
PROP_NB_GRADUATION_MARKS
Client Property: number of graduation marks- See Also:
-
PROP_HIDE_VALUE_IF_NOT_ACTIVE
Client Property: hide value text if not active : 0=false, 1=true- See Also:
-
PROP_HIDE_VALUE
Client Property: hide value : 0=false, 1=true- See Also:
-
PROP_WH_RATIO
Client Property: float number, ratio used to calculate the preferred size- See Also:
-
-
Constructor Details
-
FlatIntegerHorizontalSlider
public FlatIntegerHorizontalSlider()
-
-
Method Details
-
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
- Returns:
- the colorLine
-
setColorLine
- 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
- Returns:
- the colorKnobFill
-
setColorKnobFill
- 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
-
setValue
public void setValue(int v) -
getValue
public int getValue() -
setBorder
Overridden to update our settings.- Overrides:
setBorder
in classJComponent
- Parameters:
b
-
-
getPreferredSize
- Overrides:
getPreferredSize
in classJComponent
-
setEnabled
public void setEnabled(boolean b) - Overrides:
setEnabled
in classJComponent
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
-
mousePressed
- Specified by:
mousePressed
in interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
-
mouseDragged
- Specified by:
mouseDragged
in interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
-
mouseWheelMoved
- Specified by:
mouseWheelMoved
in interfaceMouseWheelListener
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-