本文整理汇总了Java中javax.swing.ToolTipManager.getInitialDelay方法的典型用法代码示例。如果您正苦于以下问题:Java ToolTipManager.getInitialDelay方法的具体用法?Java ToolTipManager.getInitialDelay怎么用?Java ToolTipManager.getInitialDelay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.ToolTipManager
的用法示例。
在下文中一共展示了ToolTipManager.getInitialDelay方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: invokeTip
import javax.swing.ToolTipManager; //导入方法依赖的package包/类
/** Hack to invoke tooltip on given JComponent, with given dismiss delay.
* Triggers <br>
* <code>comp.getToolTipText(MouseEvent)</code> and
* <code>comp.getToolTipLocation(MouseEvent)</code> with fake mousemoved
* MouseEvent, set to given coordinates.
*/
public static void invokeTip (JComponent comp, int x, int y, int dismissDelay) {
final ToolTipManager ttm = ToolTipManager.sharedInstance();
final int prevInit = ttm.getInitialDelay();
prevDismiss = ttm.getDismissDelay();
ttm.setInitialDelay(0);
ttm.setDismissDelay(dismissDelay);
MouseEvent fakeEvt = new MouseEvent(
comp, MouseEvent.MOUSE_MOVED, System.currentTimeMillis(),
0, x, y, 0, false);
ttm.mouseMoved(fakeEvt);
ttm.setInitialDelay(prevInit);
Timer timer = new Timer(20, instance());
timer.setRepeats(false);
timer.start();
}
示例2: mouseEntered
import javax.swing.ToolTipManager; //导入方法依赖的package包/类
/**
* 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;
}
}
示例3: mouseEntered
import javax.swing.ToolTipManager; //导入方法依赖的package包/类
/**
* 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.
*/
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;
}
}
示例4: mouseEntered
import javax.swing.ToolTipManager; //导入方法依赖的package包/类
/**
* 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.
*/
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;
}
}
示例5: main
import javax.swing.ToolTipManager; //导入方法依赖的package包/类
public static void main(String[] args) throws InterruptedException {
ToolTipManager manager = ToolTipManager.sharedInstance();
if (DISMISS != manager.getDismissDelay()) {
throw new Error("unexpected dismiss delay");
}
if (INITIAL != manager.getInitialDelay()) {
throw new Error("unexpected initial delay");
}
if (RESHOW != manager.getReshowDelay()) {
throw new Error("unexpected reshow delay");
}
manager.setDismissDelay(DISMISS + 1);
manager.setInitialDelay(INITIAL + 1);
manager.setReshowDelay(RESHOW + 1);
ThreadGroup group = new ThreadGroup("$$$");
Thread thread = new Thread(group, new Test6657026());
thread.start();
thread.join();
}
示例6: mouseEntered
import javax.swing.ToolTipManager; //导入方法依赖的package包/类
/**
* 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;
}
}
示例7: mouseEntered
import javax.swing.ToolTipManager; //导入方法依赖的package包/类
/**
* 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.
*/
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;
}
}
示例8: showToolTipNow
import javax.swing.ToolTipManager; //导入方法依赖的package包/类
public static void showToolTipNow(JComponent component) {
// HACKHACK: trick the tooltip manager into showing the tooltip right now
ToolTipManager manager = ToolTipManager.sharedInstance();
int oldDelay = manager.getInitialDelay();
manager.setInitialDelay(0);
manager.mouseMoved(new MouseEvent(component, MouseEvent.MOUSE_MOVED, System.currentTimeMillis(), 0, 0, 0, 0, false));
manager.setInitialDelay(oldDelay);
}
示例9: run
import javax.swing.ToolTipManager; //导入方法依赖的package包/类
public void run() {
SunToolkit.createNewAppContext();
ToolTipManager manager = ToolTipManager.sharedInstance();
if (DISMISS != manager.getDismissDelay()) {
throw new Error("shared dismiss delay");
}
if (INITIAL != manager.getInitialDelay()) {
throw new Error("shared initial delay");
}
if (RESHOW != manager.getReshowDelay()) {
throw new Error("shared reshow delay");
}
}
示例10: showToolTipNow
import javax.swing.ToolTipManager; //导入方法依赖的package包/类
public static void showToolTipNow(JComponent component)
{
// HACKHACK: trick the tooltip manager into showing the tooltip right
// now
ToolTipManager manager = ToolTipManager.sharedInstance();
int oldDelay = manager.getInitialDelay();
manager.setInitialDelay(0);
manager.mouseMoved(new MouseEvent(component, MouseEvent.MOUSE_MOVED,
System.currentTimeMillis(), 0, 0, 0, 0, false));
manager.setInitialDelay(oldDelay);
}
示例11: ChartPanel
import javax.swing.ToolTipManager; //导入方法依赖的package包/类
/**
* Constructs a JFreeChart panel.
*
* @param chart the chart.
* @param width the preferred width of the panel.
* @param height the preferred height of the panel.
* @param minimumDrawWidth the minimum drawing width.
* @param minimumDrawHeight the minimum drawing height.
* @param maximumDrawWidth the maximum drawing width.
* @param maximumDrawHeight the maximum drawing height.
* @param useBuffer a flag that indicates whether to use the off-screen
* buffer to improve performance (at the expense of memory).
* @param properties a flag indicating whether or not the chart property
* editor should be available via the popup menu.
* @param save a flag indicating whether or not save options should be
* available via the popup menu.
* @param print a flag indicating whether or not the print option
* should be available via the popup menu.
* @param zoom a flag indicating whether or not zoom options should be added to the
* popup menu.
* @param tooltips a flag indicating whether or not tooltips should be enabled for the chart.
*/
public ChartPanel(JFreeChart chart,
int width,
int height,
int minimumDrawWidth,
int minimumDrawHeight,
int maximumDrawWidth,
int maximumDrawHeight,
boolean useBuffer,
boolean properties,
boolean save,
boolean print,
boolean zoom,
boolean tooltips) {
this.chart = chart;
this.chartMouseListeners = new java.util.ArrayList();
if (chart != null) {
chart.addChangeListener(this);
}
this.info = new ChartRenderingInfo();
setPreferredSize(new Dimension(width, height));
this.useBuffer = useBuffer;
this.refreshBuffer = false;
this.minimumDrawWidth = minimumDrawWidth;
this.minimumDrawHeight = minimumDrawHeight;
this.maximumDrawWidth = maximumDrawWidth;
this.maximumDrawHeight = maximumDrawHeight;
this.zoomTriggerDistance = DEFAULT_ZOOM_TRIGGER_DISTANCE;
// set up popup menu...
this.popup = null;
if (properties || save || print || zoom) {
this.popup = createPopupMenu(properties, save, print, zoom);
}
enableEvents(AWTEvent.MOUSE_EVENT_MASK);
enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);
setDisplayToolTips(tooltips);
addMouseListener(this);
addMouseMotionListener(this);
this.enforceFileExtensions = true;
// initialize ChartPanel-specific tool tip delays with
// values the from ToolTipManager.sharedInstance()
ToolTipManager ttm = ToolTipManager.sharedInstance();
this.ownToolTipInitialDelay = ttm.getInitialDelay();
this.ownToolTipDismissDelay = ttm.getDismissDelay();
this.ownToolTipReshowDelay = ttm.getReshowDelay();
}
示例12: ChartPanel
import javax.swing.ToolTipManager; //导入方法依赖的package包/类
/**
* Constructs a JFreeChart panel.
*
* @param chart the chart.
* @param width the preferred width of the panel.
* @param height the preferred height of the panel.
* @param minimumDrawWidth the minimum drawing width.
* @param minimumDrawHeight the minimum drawing height.
* @param maximumDrawWidth the maximum drawing width.
* @param maximumDrawHeight the maximum drawing height.
* @param useBuffer a flag that indicates whether to use the off-screen
* buffer to improve performance (at the expense of
* memory).
* @param properties a flag indicating whether or not the chart property
* editor should be available via the popup menu.
* @param save a flag indicating whether or not save options should be
* available via the popup menu.
* @param print a flag indicating whether or not the print option
* should be available via the popup menu.
* @param zoom a flag indicating whether or not zoom options should be
* added to the popup menu.
* @param tooltips a flag indicating whether or not tooltips should be
* enabled for the chart.
*/
public ChartPanel(JFreeChart chart,
int width,
int height,
int minimumDrawWidth,
int minimumDrawHeight,
int maximumDrawWidth,
int maximumDrawHeight,
boolean useBuffer,
boolean properties,
boolean save,
boolean print,
boolean zoom,
boolean tooltips) {
this.setChart(chart);
this.chartMouseListeners = new EventListenerList();
this.info = new ChartRenderingInfo();
setPreferredSize(new Dimension(width, height));
this.useBuffer = useBuffer;
this.refreshBuffer = false;
this.minimumDrawWidth = minimumDrawWidth;
this.minimumDrawHeight = minimumDrawHeight;
this.maximumDrawWidth = maximumDrawWidth;
this.maximumDrawHeight = maximumDrawHeight;
this.zoomTriggerDistance = DEFAULT_ZOOM_TRIGGER_DISTANCE;
// set up popup menu...
this.popup = null;
if (properties || save || print || zoom) {
this.popup = createPopupMenu(properties, save, print, zoom);
}
enableEvents(AWTEvent.MOUSE_EVENT_MASK);
enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);
setDisplayToolTips(tooltips);
addMouseListener(this);
addMouseMotionListener(this);
this.enforceFileExtensions = true;
// initialize ChartPanel-specific tool tip delays with
// values the from ToolTipManager.sharedInstance()
ToolTipManager ttm = ToolTipManager.sharedInstance();
this.ownToolTipInitialDelay = ttm.getInitialDelay();
this.ownToolTipDismissDelay = ttm.getDismissDelay();
this.ownToolTipReshowDelay = ttm.getReshowDelay();
}
示例13: ChartPanel
import javax.swing.ToolTipManager; //导入方法依赖的package包/类
/**
* Constructs a JFreeChart panel.
*
* @param chart the chart.
* @param width the preferred width of the panel.
* @param height the preferred height of the panel.
* @param minimumDrawWidth the minimum drawing width.
* @param minimumDrawHeight the minimum drawing height.
* @param maximumDrawWidth the maximum drawing width.
* @param maximumDrawHeight the maximum drawing height.
* @param useBuffer a flag that indicates whether to use the off-screen
* buffer to improve performance (at the expense of
* memory).
* @param properties a flag indicating whether or not the chart property
* editor should be available via the popup menu.
* @param save a flag indicating whether or not save options should be
* available via the popup menu.
* @param print a flag indicating whether or not the print option
* should be available via the popup menu.
* @param zoom a flag indicating whether or not zoom options should be
* added to the popup menu.
* @param tooltips a flag indicating whether or not tooltips should be
* enabled for the chart.
*/
public ChartPanel(JFreeChart chart,
int width,
int height,
int minimumDrawWidth,
int minimumDrawHeight,
int maximumDrawWidth,
int maximumDrawHeight,
boolean useBuffer,
boolean properties,
boolean save,
boolean print,
boolean zoom,
boolean tooltips) {
setChart(chart);
this.chartMouseListeners = new EventListenerList();
this.info = new ChartRenderingInfo();
setPreferredSize(new Dimension(width, height));
this.useBuffer = useBuffer;
this.refreshBuffer = false;
this.minimumDrawWidth = minimumDrawWidth;
this.minimumDrawHeight = minimumDrawHeight;
this.maximumDrawWidth = maximumDrawWidth;
this.maximumDrawHeight = maximumDrawHeight;
this.zoomTriggerDistance = DEFAULT_ZOOM_TRIGGER_DISTANCE;
// set up popup menu...
this.popup = null;
if (properties || save || print || zoom) {
this.popup = createPopupMenu(properties, save, print, zoom);
}
enableEvents(AWTEvent.MOUSE_EVENT_MASK);
enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);
setDisplayToolTips(tooltips);
addMouseListener(this);
addMouseMotionListener(this);
this.defaultDirectoryForSaveAs = null;
this.enforceFileExtensions = true;
// initialize ChartPanel-specific tool tip delays with
// values the from ToolTipManager.sharedInstance()
ToolTipManager ttm = ToolTipManager.sharedInstance();
this.ownToolTipInitialDelay = ttm.getInitialDelay();
this.ownToolTipDismissDelay = ttm.getDismissDelay();
this.ownToolTipReshowDelay = ttm.getReshowDelay();
this.zoomAroundAnchor = false;
}