|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.wordpress.tipsforjava.swing.ScrollBarToolTip
public class ScrollBarToolTip extends Object
The ScrollBarToolTip class allows you to simulate the display of a tooltip as the scrollbar thumb is being dragged. This may be usefull when scrolling through a large amount of data in a scrollpane. The STYLE of the tooltip can be specified. A "fixed" style implies that the tooltip is fixed at a certain spot when the mouse is pressed on the toolbar thumb. A "floating" style implies that the tooltip will move as the toolbar thumb is dragged. The POSITION of the tooltip indicates how the tooltip is placed relative to the scrollbar. The default tooltip text shows the relationship of the current position of the scrollbar to the maximum scrollbar value as a percentage.
| Nested Class Summary | |
|---|---|
enum |
ScrollBarToolTip.Position
|
enum |
ScrollBarToolTip.Style
|
| Field Summary | |
|---|---|
private static int |
ADJUSTMENT
|
private static int |
GAP
|
private Popup |
popup
|
private ScrollBarToolTip.Position |
position
|
private Point |
pressedPoint
|
private JScrollBar |
scrollBar
|
private ScrollBarToolTip.Style |
style
|
private JToolTip |
toolTip
|
| Constructor Summary | |
ScrollBarToolTip(JScrollBar scrollBar)
Convenience constructor with a Style enum of FIXED_PRESSED and a Position enum of INSIDE. |
|
ScrollBarToolTip(JScrollBar scrollBar, ScrollBarToolTip.Style style, ScrollBarToolTip.Position position)
Create a ScrollBarToolTip |
|
| Method Summary | |
|---|---|
private int
|
getHorizontalX(MouseEvent e)
|
private int
|
getHorizontalY(MouseEvent e)
|
ScrollBarToolTip.Position
|
getPosition()
Get the Position tooltip |
ScrollBarToolTip.Style
|
getStyle()
Get the Style tooltip |
protected Point
|
getToolTipLocation(MouseEvent event)
|
protected String
|
getToolTipText(MouseEvent event)
|
private int
|
getVerticalX(MouseEvent e)
|
private int
|
getVerticalY(MouseEvent e)
|
void
|
mouseClicked(MouseEvent e)
|
void
|
mouseDragged(MouseEvent e)
Update the tooltip text and/or position as the mouse is dragged |
void
|
mouseEntered(MouseEvent e)
|
void
|
mouseExited(MouseEvent e)
|
void
|
mouseMoved(MouseEvent e)
|
void
|
mousePressed(MouseEvent e)
|
void
|
mouseReleased(MouseEvent e)
|
void
|
setPosition(ScrollBarToolTip.Position position)
Set the Position of the tooltip relative to the scrollbar. |
void
|
setStyle(ScrollBarToolTip.Style style)
Set the Style of the tooltip. |
protected void
|
showToolTip(MouseEvent event)
|
ScrollBarToolTip
|
valueOf(String name)
Returns the enum constant of this type with the specified name. |
ScrollBarToolTip
|
valueOf(String name)
Returns the enum constant of this type with the specified name. |
ScrollBarToolTip[]
|
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
ScrollBarToolTip[]
|
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private static final int ADJUSTMENT
private static final int GAP
private Popup popup
private ScrollBarToolTip.Position position
private Point pressedPoint
private JScrollBar scrollBar
private ScrollBarToolTip.Style style
private JToolTip toolTip
| Constructor Detail |
|---|
public ScrollBarToolTip(JScrollBar scrollBar)
scrollBar - the JScrollBar the tooltip will be displayed for
public ScrollBarToolTip(JScrollBar scrollBar, ScrollBarToolTip.Style style, ScrollBarToolTip.Position position)
scrollBar - the JScrollBar the tooltip will be displayed forstyle - the style of the tooltip (see setStyle() for values)position - the position of the tooltip (see setPosition()
for values)
| Method Detail |
|---|
private int getHorizontalX(MouseEvent e)
private int getHorizontalY(MouseEvent e)
public ScrollBarToolTip.Position getPosition()
public ScrollBarToolTip.Style getStyle()
protected Point getToolTipLocation(MouseEvent event)
protected String getToolTipText(MouseEvent event)
private int getVerticalX(MouseEvent e)
private int getVerticalY(MouseEvent e)
de public public void mouseClicked(MouseEvent e)
de public public void mouseDragged(MouseEvent e)
de public public void mouseEntered(MouseEvent e)
de public public void mouseExited(MouseEvent e)
de public public void mouseMoved(MouseEvent e)
de public public void mousePressed(MouseEvent e)
de public public void mouseReleased(MouseEvent e)
public void setPosition(ScrollBarToolTip.Position position)
position - the Position of the tooltip
public void setStyle(ScrollBarToolTip.Style style)
style - the Style of the tooltip
protected void showToolTip(MouseEvent event)
ScrollBarToolTip valueOf(String name)
ScrollBarToolTip valueOf(String name)
ScrollBarToolTip[] values()
ScrollBarToolTip[] values()
Groovy Documentation