public abstract class MultiThumbSliderUI extends ComponentUI implements MouseListener, MouseMotionListener
MultiThumbSliders| Modifier and Type | Class and Description |
|---|---|
(package private) class |
MultiThumbSliderUI.State
This records the positions/values of each thumb.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) Runnable |
animatingRunnable |
(package private) Thread |
animatingThread |
(package private) ComponentListener |
compListener |
private int |
currentIndicatedThumb |
(package private) int |
DEPTH
The height of a horizontal slider -- or width of a vertical slider.
|
private int |
dx |
private int |
dy |
(package private) FocusListener |
focusListener |
(package private) float |
indication
The overall indication of the thumbs.
|
private float |
indicationGoal
This is used by the animating thread.
|
(package private) KeyListener |
keyListener |
(package private) int |
MAX_LENGTH
The maximum width returned by
getMaximumSize(). |
(package private) int |
MIN_LENGTH
The minimum width returned by
getMinimumSize(). |
private boolean |
mouseInside |
private boolean |
mouseIsDown |
(package private) int |
PREF_LENGTH
The maximum width returned by
getPreferredSize(). |
private MultiThumbSliderUI.State |
pressedState |
(package private) PropertyChangeListener |
propertyListener |
protected MultiThumbSlider |
slider |
protected float[] |
thumbIndications
A float from zero to one, indicating whether that thumb should be highlighted
or not.
|
(package private) int[] |
thumbPositions
The pixel position of the thumbs.
|
protected Rectangle |
trackRect
The rectangle the track should be painted in.
|
| Constructor and Description |
|---|
MultiThumbSliderUI(MultiThumbSlider slider) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addThumb(int index1,
int index2)
This will try to add a thumb between index1 and index2.
|
protected void |
calculateGeometry() |
protected Rectangle |
calculateTrackRect() |
abstract int |
getClickLocationTolerance()
How many pixels can you deviate from a thumb and and still "click" it
|
private int |
getIndex(MouseEvent e) |
Dimension |
getMaximumSize(JComponent s) |
Dimension |
getMinimumSize(JComponent s) |
Dimension |
getPreferredSize(JComponent s) |
static String |
getProperty(JComponent jc,
String propertyName,
String defaultValue)
This retrieves a property.
|
void |
installUI(JComponent slider) |
void |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
private void |
nudge(int thumbIndex,
int direction) |
void |
paint(Graphics g,
JComponent slider2) |
protected abstract void |
paintFocus(Graphics2D g) |
protected abstract void |
paintThumbs(Graphics2D g) |
protected abstract void |
paintTrack(Graphics2D g) |
private void |
setCurrentIndicatedThumb(int i) |
private void |
setMouseInside(boolean b) |
void |
uninstallUI(JComponent slider) |
protected void |
updateIndication() |
protected static boolean |
validatePositions(MultiThumbSliderUI.State state)
Makes sure the thumbs are in the right order.
|
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, updateprotected MultiThumbSlider slider
int MAX_LENGTH
getMaximumSize().
(or if the slider is vertical, this is the maximum height.)int MIN_LENGTH
getMinimumSize().
(or if the slider is vertical, this is the minimum height.)int PREF_LENGTH
getPreferredSize().
(or if the slider is vertical, this is the preferred height.)int DEPTH
int[] thumbPositions
protected float[] thumbIndications
private float indicationGoal
float indication
protected Rectangle trackRect
Thread animatingThread
Runnable animatingRunnable
private int currentIndicatedThumb
private boolean mouseInside
private boolean mouseIsDown
private MultiThumbSliderUI.State pressedState
private int dx
private int dy
FocusListener focusListener
KeyListener keyListener
PropertyChangeListener propertyListener
ComponentListener compListener
public MultiThumbSliderUI(MultiThumbSlider slider)
public Dimension getMaximumSize(JComponent s)
getMaximumSize in class ComponentUIpublic Dimension getMinimumSize(JComponent s)
getMinimumSize in class ComponentUIpublic Dimension getPreferredSize(JComponent s)
getPreferredSize in class ComponentUIpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerprivate int getIndex(MouseEvent e)
public void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerprivate void setCurrentIndicatedThumb(int i)
private void setMouseInside(boolean b)
public void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic static String getProperty(JComponent jc, String propertyName, String defaultValue)
component.putClientProperty()), then that value will be returned.
Otherwise this method refers to UIManager.get(). If that
value is missing, this returns defaultValue.jc - componentpropertyName - the property namedefaultValue - if no other value is found, this is returnedpublic abstract int getClickLocationTolerance()
protected static boolean validatePositions(MultiThumbSliderUI.State state)
state - stateprotected boolean addThumb(int index1,
int index2)
This method will not add a thumb if there is already a very small distance between these two endpoints
index1 - index 1index2 - index 2protected void updateIndication()
protected void calculateGeometry()
protected Rectangle calculateTrackRect()
private void nudge(int thumbIndex,
int direction)
public void installUI(JComponent slider)
installUI in class ComponentUIpublic void paint(Graphics g, JComponent slider2)
paint in class ComponentUIprotected abstract void paintTrack(Graphics2D g)
protected abstract void paintFocus(Graphics2D g)
protected abstract void paintThumbs(Graphics2D g)
public void uninstallUI(JComponent slider)
uninstallUI in class ComponentUICopyright © 2007–2017 Gephi Consortium. All rights reserved.