Search in sources :

Example 11 with ToolTipManager

use of javax.swing.ToolTipManager in project binnavi by google.

the class GuiInitializer method initializeTooltipDelay.

/**
 * Sets up the application-wide tooltip delay.
 */
private static void initializeTooltipDelay() {
    final ToolTipManager toolTipManager = ToolTipManager.sharedInstance();
    toolTipManager.setDismissDelay(60000);
    toolTipManager.setInitialDelay(1000);
    toolTipManager.setReshowDelay(1000);
}
Also used : ToolTipManager(javax.swing.ToolTipManager)

Example 12 with ToolTipManager

use of javax.swing.ToolTipManager in project SIMVA-SoS by SESoS.

the class ChartPanel method mouseExited.

/**
 * Handles a 'mouse exited' event. This method resets the tooltip delays of
 * ToolTipManager.sharedInstance() to their
 * original values in effect before mouseEntered()
 *
 * @param e  the mouse event.
 */
@Override
public void mouseExited(MouseEvent e) {
    if (this.ownToolTipDelaysActive) {
        // restore original tooltip dealys
        ToolTipManager ttm = ToolTipManager.sharedInstance();
        ttm.setInitialDelay(this.originalToolTipInitialDelay);
        ttm.setReshowDelay(this.originalToolTipReshowDelay);
        ttm.setDismissDelay(this.originalToolTipDismissDelay);
        this.ownToolTipDelaysActive = false;
    }
}
Also used : ToolTipManager(javax.swing.ToolTipManager)

Example 13 with ToolTipManager

use of javax.swing.ToolTipManager in project SIMVA-SoS by SESoS.

the class ChartPanel method mouseEntered.

/**
 * Handles a 'mouse entered' event. This method changes the tooltip delays
 * of ToolTipManager.sharedInstance() to the possibly different values set
 * for this chart panel.
 *
 * @param e  the mouse event.
 */
@Override
public void mouseEntered(MouseEvent e) {
    if (!this.ownToolTipDelaysActive) {
        ToolTipManager ttm = ToolTipManager.sharedInstance();
        this.originalToolTipInitialDelay = ttm.getInitialDelay();
        ttm.setInitialDelay(this.ownToolTipInitialDelay);
        this.originalToolTipReshowDelay = ttm.getReshowDelay();
        ttm.setReshowDelay(this.ownToolTipReshowDelay);
        this.originalToolTipDismissDelay = ttm.getDismissDelay();
        ttm.setDismissDelay(this.ownToolTipDismissDelay);
        this.ownToolTipDelaysActive = true;
    }
}
Also used : ToolTipManager(javax.swing.ToolTipManager)

Aggregations

ToolTipManager (javax.swing.ToolTipManager)13 BorderLayout (java.awt.BorderLayout)5 Dimension (java.awt.Dimension)5 JPanel (javax.swing.JPanel)5 Insets (java.awt.Insets)4 ActionEvent (java.awt.event.ActionEvent)4 MouseEvent (java.awt.event.MouseEvent)4 JLabel (javax.swing.JLabel)4 Color (java.awt.Color)3 Point (java.awt.Point)3 ActionListener (java.awt.event.ActionListener)3 MouseAdapter (java.awt.event.MouseAdapter)3 BoxLayout (javax.swing.BoxLayout)3 ButtonGroup (javax.swing.ButtonGroup)3 JButton (javax.swing.JButton)3 Document (gate.Document)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 JComponent (javax.swing.JComponent)2 JRadioButton (javax.swing.JRadioButton)2