|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unibi.techfak.jpredictor.gui.MouseOverHintManager
public class MouseOverHintManager
This class is used, to add a hint for any number of components. If the mouse enters the area of one component the corresponding hint is set as text in the label given when constructing the class.
| Field Summary | |
|---|---|
private javax.swing.JLabel |
hintLabel
The label which is set with the hint. |
private java.util.Map |
hintMap
The map where the components and the corresponding hints are stored. |
| Constructor Summary | |
|---|---|
MouseOverHintManager(javax.swing.JLabel hintLabel)
Simple Constructor. |
|
| Method Summary | |
|---|---|
void |
addHintFor(java.awt.Component comp,
java.lang.String hintText)
Registers a component with its corresponding hint. |
void |
changeHintFor(java.awt.Component comp,
java.lang.String hintText)
Changes the hint for the given component to the new string. |
private java.lang.String |
getHintFor(java.awt.Component comp)
Get the hint for the Component given. |
void |
mouseClicked(java.awt.event.MouseEvent e)
That event is not processed. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Sets the corresponding hint text for a component, which area was entered by the mouse cursor. |
void |
mouseExited(java.awt.event.MouseEvent e)
Clears the text in the label, if the mouse cursor exits a components area. |
void |
mousePressed(java.awt.event.MouseEvent e)
That event is not processed. |
void |
mouseReleased(java.awt.event.MouseEvent e)
That event is not processed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.util.Map hintMap
private javax.swing.JLabel hintLabel
| Constructor Detail |
|---|
public MouseOverHintManager(javax.swing.JLabel hintLabel)
hintLabel - The label to which the hints are sent.| Method Detail |
|---|
public void addHintFor(java.awt.Component comp,
java.lang.String hintText)
comp - The component for which the hint is registered.hintText - The corresponding hint for the component.
public void changeHintFor(java.awt.Component comp,
java.lang.String hintText)
comp - The component for which the hint is changed.hintText - The new hint for the component.private java.lang.String getHintFor(java.awt.Component comp)
Component given. If the
Component is a JLabel, the hint
for the corresponding Component is returned.
If comp is a TableHeader the hint
for the corresponding table is returned.
comp - The Component to get the hint for.
String or
null, if no hint was set.public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenere - The description of the event.public void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenere - The description of the event.public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenere - The description of the event.public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - The description of the event.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - The description of the event.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||