|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--gishur.awt.ToolTipper
The ToolTipper class provides Windows-like tooltips without the need of an extra window.
Inner classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
java.awt.Color |
backcolor
The background color of the ToolTip. |
java.awt.Color |
textcolor
The text color of the ToolTip. |
java.awt.Font |
tip_font
The Font used by ToolTips. |
static int |
TIP_SPACE
Distance (in pixel) between Text and Tip-Border. |
static byte |
TOOLTIP_LOWER_LEFT
Alignment of the tooltip relative to the mouse position. |
static byte |
TOOLTIP_LOWER_RIGHT
Alignment of the tooltip relative to the mouse position. |
static byte |
TOOLTIP_UPPER_LEFT
Alignment of the tooltip relative to the mouse position. |
static byte |
TOOLTIP_UPPER_RIGHT
Alignment of the tooltip relative to the mouse position. |
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 | |
ToolTipper(java.awt.Container c)
Constructs a new ToolTipper on the Container c . |
|
ToolTipper(java.awt.Container c,
java.applet.Applet a)
Constructs a new ToolTipper on the Container c and
connects it with the Applet a |
Method Summary | |
void |
componentAdded(java.awt.event.ContainerEvent e)
Invoked when a component has been added to the container. |
void |
componentRemoved(java.awt.event.ContainerEvent e)
Invoked when a component has been removed from the container. |
byte |
getToolTipAlignment()
Returns the ToolTip alignment constant (one of { TOOLTIP_LOWER_RIGHT,
TOOLTIP_LOWER_LEFT,TOOLTIP_UPPER_RIGHT,TOOLTIP_UPPER_LEFT }). |
int |
getToolTipXDistance()
Returns the horizontal ToolTip distance relative to the mouse position. |
int |
getToolTipYDistance()
Returns the vertical ToolTip distance relative to the mouse position. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component. |
void |
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons no down). |
void |
mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component. |
void |
paint(java.awt.Graphics g)
Paints the ToolTip on the screen. |
void |
run()
The run method for the ToolTipper-thread. |
void |
setShowtime(long s)
Sets the showtime of the ToolTipper. |
void |
setSleeptime(long s)
Sets the sleeptime of the ToolTipper. |
void |
setToolTipAlignment(byte align)
Sets the alignment of the ToolTip. |
void |
setToolTipMouseDistance(int x,
int y)
Sets the distance of the ToolTip relative to the mouse position. |
long |
showtime()
Returns the time to wait while showing tip (in ms). |
long |
sleeptime()
Returns the time to wait until tip shows up (in ms). |
void |
update(java.awt.Graphics g)
Updates the ToolTip. |
Methods inherited from class java.awt.Canvas |
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte TOOLTIP_LOWER_RIGHT
public static final byte TOOLTIP_UPPER_RIGHT
public static final byte TOOLTIP_LOWER_LEFT
public static final byte TOOLTIP_UPPER_LEFT
public static int TIP_SPACE
public java.awt.Font tip_font
public java.awt.Color backcolor
public java.awt.Color textcolor
Constructor Detail |
public ToolTipper(java.awt.Container c, java.applet.Applet a)
Container
c
and
connects it with the Applet
a.
- Parameters:
c
- Container to add the ToolTipper toa
- Applet for displaying StatusTips
public ToolTipper(java.awt.Container c)
Container
c
.c
- Container to add the ToolTipper toMethod Detail |
public void run()
run
in interface java.lang.Runnable
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void update(java.awt.Graphics g)
update
in class java.awt.Component
g
- Graphics contextpublic void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
g
- Graphics contextpublic void componentAdded(java.awt.event.ContainerEvent e)
componentAdded
in interface java.awt.event.ContainerListener
public void componentRemoved(java.awt.event.ContainerEvent e)
componentRemoved
in interface java.awt.event.ContainerListener
public long sleeptime()
public void setSleeptime(long s)
s
- the time to wait until tip shows up (in ms)public long showtime()
public void setShowtime(long s)
s
- the time to wait while showing up (in ms)public byte getToolTipAlignment()
TOOLTIP_LOWER_RIGHT,
TOOLTIP_LOWER_LEFT,TOOLTIP_UPPER_RIGHT,TOOLTIP_UPPER_LEFT
}).public void setToolTipAlignment(byte align)
alignment
- constant (one of {TOOLTIP_LOWER_RIGHT,
TOOLTIP_LOWER_LEFT,TOOLTIP_UPPER_RIGHT,TOOLTIP_UPPER_LEFT
})public int getToolTipXDistance()
public int getToolTipYDistance()
public void setToolTipMouseDistance(int x, int y)
x
- horizontal distancey
- vertical distancepublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |