Java Code Examples for javax.swing.ToolTipManager#sharedInstance()
The following examples show how to use
javax.swing.ToolTipManager#sharedInstance() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Test6657026.java From hottub with GNU General Public License v2.0 | 6 votes |
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(); }
Example 2
Source File: ChartPanel.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
/** * 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; } }
Example 3
Source File: ChartPanel.java From ECG-Viewer with GNU General Public License v2.0 | 6 votes |
/** * 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; } }
Example 4
Source File: Test6657026.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
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(); }
Example 5
Source File: TooltipHack.java From netbeans with Apache License 2.0 | 6 votes |
/** 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(); }
Example 6
Source File: TooltipHack.java From netbeans with Apache License 2.0 | 6 votes |
/** 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(); }
Example 7
Source File: ChartPanel.java From ccu-historian with GNU General Public License v3.0 | 6 votes |
/** * 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; } }
Example 8
Source File: Test6657026.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
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(); }
Example 9
Source File: Test6657026.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
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(); }
Example 10
Source File: Test6657026.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
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(); }
Example 11
Source File: ChartPanel.java From openstock with GNU General Public License v3.0 | 6 votes |
/** * 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; } }
Example 12
Source File: ChartPanel.java From ECG-Viewer with GNU General Public License v2.0 | 5 votes |
/** * 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; } }
Example 13
Source File: ChartPanel.java From ccu-historian with GNU General Public License v3.0 | 5 votes |
/** * 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; } }
Example 14
Source File: GuiInitializer.java From binnavi with Apache License 2.0 | 5 votes |
/** * 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); }
Example 15
Source File: ChartPanel.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * 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; } }
Example 16
Source File: ChartPanel.java From openstock with GNU General Public License v3.0 | 5 votes |
/** * 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; } }
Example 17
Source File: ChartPanel.java From ccu-historian with GNU General Public License v3.0 | 4 votes |
/** * 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 copy a flag indicating whether or not a copy option 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. * * @since 1.0.13 */ public ChartPanel(JFreeChart chart, int width, int height, int minimumDrawWidth, int minimumDrawHeight, int maximumDrawWidth, int maximumDrawHeight, boolean useBuffer, boolean properties, boolean copy, 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 || copy || save || print || zoom) { this.popup = createPopupMenu(properties, copy, 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; this.zoomOutlinePaint = Color.blue; this.zoomFillPaint = new Color(0, 0, 255, 63); this.panMask = InputEvent.CTRL_MASK; // for MacOSX we can't use the CTRL key for mouse drags, see: // http://developer.apple.com/qa/qa2004/qa1362.html String osName = System.getProperty("os.name").toLowerCase(); if (osName.startsWith("mac os x")) { this.panMask = InputEvent.ALT_MASK; } this.overlays = new java.util.ArrayList(); }
Example 18
Source File: ChartPanel.java From opensim-gui with Apache License 2.0 | 4 votes |
/** * 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(); }
Example 19
Source File: ChartPanel.java From SIMVA-SoS with Apache License 2.0 | 4 votes |
/** * 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 copy a flag indicating whether or not a copy option 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. * * @since 1.0.13 */ public ChartPanel(JFreeChart chart, int width, int height, int minimumDrawWidth, int minimumDrawHeight, int maximumDrawWidth, int maximumDrawHeight, boolean useBuffer, boolean properties, boolean copy, 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 || copy || save || print || zoom) { this.popup = createPopupMenu(properties, copy, 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; this.zoomOutlinePaint = Color.blue; this.zoomFillPaint = new Color(0, 0, 255, 63); this.panMask = InputEvent.CTRL_MASK; // for MacOSX we can't use the CTRL key for mouse drags, see: // http://developer.apple.com/qa/qa2004/qa1362.html String osName = System.getProperty("os.name").toLowerCase(); if (osName.startsWith("mac os x")) { this.panMask = InputEvent.ALT_MASK; } this.overlays = new java.util.ArrayList(); }
Example 20
Source File: ChartPanel.java From buffer_bci with GNU General Public License v3.0 | 4 votes |
/** * 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 copy a flag indicating whether or not a copy option 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. * * @since 1.0.13 */ public ChartPanel(JFreeChart chart, int width, int height, int minimumDrawWidth, int minimumDrawHeight, int maximumDrawWidth, int maximumDrawHeight, boolean useBuffer, boolean properties, boolean copy, 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 || copy || save || print || zoom) { this.popup = createPopupMenu(properties, copy, 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; this.zoomOutlinePaint = Color.blue; this.zoomFillPaint = new Color(0, 0, 255, 63); this.panMask = InputEvent.CTRL_MASK; // for MacOSX we can't use the CTRL key for mouse drags, see: // http://developer.apple.com/qa/qa2004/qa1362.html String osName = System.getProperty("os.name").toLowerCase(); if (osName.startsWith("mac os x")) { this.panMask = InputEvent.ALT_MASK; } this.overlays = new java.util.ArrayList(); }