javax.swing.ToolTipManager#sharedInstance ( )源码实例Demo

下面列出了javax.swing.ToolTipManager#sharedInstance ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: ccu-historian   文件: ChartPanel.java
/**
 * 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;
    }
}
 
源代码2 项目: openstock   文件: ChartPanel.java
/**
 * 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 项目: openjdk-8   文件: Test6657026.java
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();
}
 
源代码4 项目: jdk8u-jdk   文件: Test6657026.java
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();
}
 
源代码5 项目: openjdk-jdk8u   文件: Test6657026.java
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 项目: hottub   文件: Test6657026.java
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();
}
 
源代码7 项目: netbeans   文件: TooltipHack.java
/** 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();
}
 
源代码8 项目: netbeans   文件: TooltipHack.java
/** 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();
}
 
源代码9 项目: openjdk-jdk8u-backup   文件: Test6657026.java
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();
}
 
源代码10 项目: ECG-Viewer   文件: ChartPanel.java
/**
 * 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;
    }
}
 
源代码11 项目: buffer_bci   文件: ChartPanel.java
/**
 * 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;
    }
}
 
源代码12 项目: openstock   文件: ChartPanel.java
/**
 * 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;
    }
}
 
源代码13 项目: buffer_bci   文件: ChartPanel.java
/**
 * 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;
    }
}
 
源代码14 项目: ECG-Viewer   文件: ChartPanel.java
/**
 * 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;
    }
}
 
源代码15 项目: ccu-historian   文件: ChartPanel.java
/**
 * 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;
    }
}
 
源代码16 项目: binnavi   文件: GuiInitializer.java
/**
 * 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);
}
 
源代码17 项目: opensim-gui   文件: ChartPanel.java
/**
 * 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();

}
 
源代码18 项目: ccu-historian   文件: ChartPanel.java
/**
 * 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();
}
 
源代码19 项目: SIMVA-SoS   文件: ChartPanel.java
/**
 * 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();
}
 
源代码20 项目: buffer_bci   文件: ChartPanel.java
/**
 * 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();
}