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.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringClient Property: bottom color, used to created the gradientstatic final StringClient Property: top color, used to created the gradientstatic final StringClient Property: hide value : 0=false, 1=truestatic final StringClient Property: hide value text if not active : 0=false, 1=truestatic final StringClient Property: line thicknessstatic final StringClient Property: number of graduation marksstatic final Stringstatic final StringClient 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_WINDOWFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintThe last MouseEvent corresponding to the last mouse drag or wheel user action to change the slider value.intintintgetValue()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidOverridden to update our settings.voidsetColorKnobFill(Color colorKnobFill) voidsetColorLine(Color colorLine) voidsetEnabled(boolean b) voidsetFaderHeight(int faderHeight) voidsetGraduationLength(int graduationLength) voidsetKnobDiameter(int knobDiameter) voidsetMaxValue(int maxValue) voidsetMinValue(int minValue) voidsetValue(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, updateUIMethods 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, validateMethods 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:
setBorderin classJComponent- Parameters:
b-
-
getPreferredSize
- Overrides:
getPreferredSizein classJComponent
-
setEnabled
public void setEnabled(boolean b) - Overrides:
setEnabledin classJComponent
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
mouseWheelMoved
- Specified by:
mouseWheelMovedin interfaceMouseWheelListener
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-