Example usage for javax.swing.event EventListenerList EventListenerList

List of usage examples for javax.swing.event EventListenerList EventListenerList

Introduction

In this page you can find the example usage for javax.swing.event EventListenerList EventListenerList.

Prototype

EventListenerList

Source Link

Usage

From source file:org.jfree.experimental.chart.swt.ChartComposite.java

/**
 * Constructs a JFreeChart panel.//from   w ww.j a va 2s  .  c  o m
 * 
 * @param comp The parent.
 * @param style The style of the composite.
 * @param jfreechart the chart.
 * @param width the preferred width of the panel.
 * @param height the preferred height of the panel.
 * @param minimumDrawW the minimum drawing width.
 * @param minimumDrawH the minimum drawing height.
 * @param maximumDrawW the maximum drawing width.
 * @param maximumDrawH the maximum drawing height.
 * @param usingBuffer 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 ChartComposite(Composite comp, int style, JFreeChart jfreechart, int width, int height, int minimumDrawW,
        int minimumDrawH, int maximumDrawW, int maximumDrawH, boolean usingBuffer, boolean properties,
        boolean save, boolean print, boolean zoom, boolean tooltips) {
    super(comp, style);
    this.setChart(jfreechart);
    this.chartMouseListeners = new EventListenerList();
    this.setLayout(new FillLayout());
    this.info = new ChartRenderingInfo();
    this.useBuffer = usingBuffer;
    this.refreshBuffer = false;
    this.minimumDrawWidth = minimumDrawW;
    this.minimumDrawHeight = minimumDrawH;
    this.maximumDrawWidth = maximumDrawW;
    this.maximumDrawHeight = maximumDrawH;
    this.zoomTriggerDistance = DEFAULT_ZOOM_TRIGGER_DISTANCE;
    this.setDisplayToolTips(tooltips);
    // create the canvas and add the required listeners
    this.canvas = new Canvas(this, SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND);
    this.canvas.addPaintListener(this);
    this.canvas.addMouseListener(this);
    this.canvas.addMouseMoveListener(this);

    if (this.chart != null) {
        this.chart.addChangeListener(this);
        Plot plot = this.chart.getPlot();
        this.domainZoomable = false;
        this.rangeZoomable = false;
        if (plot instanceof Zoomable) {
            Zoomable z = (Zoomable) plot;
            this.domainZoomable = z.isDomainZoomable();
            this.rangeZoomable = z.isRangeZoomable();
            this.orientation = z.getOrientation();
        }
    }

    // set up popup menu...
    this.popup = null;
    if (properties || save || print || zoom)
        this.popup = createPopupMenu(properties, save, print, zoom);

    this.enforceFileExtensions = true;
}

From source file:KIDLYAbstractRenderer.java

/**
 * Default constructor./*from  www.  jav  a2  s  .  c  om*/
 */
public KIDLYAbstractRenderer() {

    this.seriesVisible = null;
    this.seriesVisibleList = new BooleanList();
    this.baseSeriesVisible = true;

    this.seriesVisibleInLegend = null;
    this.seriesVisibleInLegendList = new BooleanList();
    this.baseSeriesVisibleInLegend = true;

    this.paint = null;
    this.paintList = new PaintList();
    this.basePaint = DEFAULT_PAINT;
    this.autoPopulateSeriesPaint = true;

    this.fillPaint = null;
    this.fillPaintList = new PaintList();
    this.baseFillPaint = Color.white;
    this.autoPopulateSeriesFillPaint = false;

    this.outlinePaint = null;
    this.outlinePaintList = new PaintList();
    this.baseOutlinePaint = DEFAULT_OUTLINE_PAINT;
    this.autoPopulateSeriesOutlinePaint = false;

    this.stroke = null;
    this.strokeList = new StrokeList();
    this.baseStroke = DEFAULT_STROKE;
    this.autoPopulateSeriesStroke = true;

    this.outlineStroke = null;
    this.outlineStrokeList = new StrokeList();
    this.baseOutlineStroke = DEFAULT_OUTLINE_STROKE;
    this.autoPopulateSeriesOutlineStroke = false;

    this.shape = null;
    this.shapeList = new ShapeList();
    this.baseShape = DEFAULT_SHAPE;
    this.autoPopulateSeriesShape = true;

    this.itemLabelsVisible = null;
    this.itemLabelsVisibleList = new BooleanList();
    this.baseItemLabelsVisible = Boolean.FALSE;

    this.itemLabelFont = null;
    this.itemLabelFontList = new ObjectList();
    this.baseItemLabelFont = new Font("SansSerif", Font.PLAIN, 10);

    this.itemLabelPaint = null;
    this.itemLabelPaintList = new PaintList();
    this.baseItemLabelPaint = Color.black;

    this.positiveItemLabelPosition = null;
    this.positiveItemLabelPositionList = new ObjectList();
    this.basePositiveItemLabelPosition = new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12,
            TextAnchor.BOTTOM_CENTER);

    this.negativeItemLabelPosition = null;
    this.negativeItemLabelPositionList = new ObjectList();
    this.baseNegativeItemLabelPosition = new ItemLabelPosition(ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);

    this.createEntities = null;
    this.createEntitiesList = new BooleanList();
    this.baseCreateEntities = true;

    this.defaultEntityRadius = 3;

    this.legendShapeList = new ShapeList();
    this.baseLegendShape = null;

    this.treatLegendShapeAsLine = false;

    this.legendTextFont = new ObjectList();
    this.baseLegendTextFont = null;

    this.legendTextPaint = new PaintList();
    this.baseLegendTextPaint = null;

    this.listenerList = new EventListenerList();

}

From source file:rulebender.editors.dat.view.CustomizedChartComposite.java

/**
 * Constructs a JFreeChart panel./*w w  w.  j a  v a  2s . c  o m*/
 *
 * @param comp The parent.
 * @param style The style of the composite.
 * @param jfreechart  the chart.
 * @param width  the preferred width of the panel.
 * @param height  the preferred height of the panel.
 * @param minimumDrawW  the minimum drawing width.
 * @param minimumDrawH  the minimum drawing height.
 * @param maximumDrawW  the maximum drawing width.
 * @param maximumDrawH  the maximum drawing height.
 * @param usingBuffer  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 CustomizedChartComposite(Composite comp, int style, JFreeChart jfreechart, int width, int height,
        int minimumDrawW, int minimumDrawH, int maximumDrawW, int maximumDrawH, boolean usingBuffer,
        boolean properties, boolean save, boolean print, boolean zoom, boolean tooltips) {
    super(comp, style);
    setChart(jfreechart);
    this.chartMouseListeners = new EventListenerList();
    setLayout(new FillLayout());
    this.info = new ChartRenderingInfo();
    this.useBuffer = usingBuffer;
    this.refreshBuffer = false;
    this.minimumDrawWidth = minimumDrawW;
    this.minimumDrawHeight = minimumDrawH;
    this.maximumDrawWidth = maximumDrawW;
    this.maximumDrawHeight = maximumDrawH;
    this.zoomTriggerDistance = DEFAULT_ZOOM_TRIGGER_DISTANCE;
    setDisplayToolTips(tooltips);
    // create the canvas and add the required listeners
    this.canvas = new Canvas(this, SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND);
    this.canvas.addPaintListener(this);
    this.canvas.addMouseListener(this);
    this.canvas.addMouseMoveListener(this);

    // set up popup menu...
    this.popup = null;
    if (properties || save || print || zoom)
        this.popup = createPopupMenu(properties, save, print, zoom);

    this.enforceFileExtensions = true;
}

From source file:com.rcp.wbw.demo.ChartComposite.java

/**
 * Constructs a JFreeChart panel./* w  w  w.jav  a2s . co  m*/
 * 
 * @param comp
 *            The parent.
 * @param style
 *            The style of the composite.
 * @param jfreechart
 *            the chart.
 * @param width
 *            the preferred width of the panel.
 * @param height
 *            the preferred height of the panel.
 * @param minimumDrawW
 *            the minimum drawing width.
 * @param minimumDrawH
 *            the minimum drawing height.
 * @param maximumDrawW
 *            the maximum drawing width.
 * @param maximumDrawH
 *            the maximum drawing height.
 * @param usingBuffer
 *            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 ChartComposite(Composite comp, int style, JFreeChart jfreechart, int width, int height, int minimumDrawW,
        int minimumDrawH, int maximumDrawW, int maximumDrawH, boolean usingBuffer, boolean properties,
        boolean save, boolean print, boolean zoom, boolean tooltips) {
    super(comp, style);
    setChart(jfreechart);
    this.chartMouseListeners = new EventListenerList();
    setLayout(new FillLayout());
    this.info = new ChartRenderingInfo();
    this.useBuffer = usingBuffer;
    this.refreshBuffer = false;
    this.minimumDrawWidth = minimumDrawW;
    this.minimumDrawHeight = minimumDrawH;
    this.maximumDrawWidth = maximumDrawW;
    this.maximumDrawHeight = maximumDrawH;
    this.zoomTriggerDistance = DEFAULT_ZOOM_TRIGGER_DISTANCE;
    setDisplayToolTips(tooltips);
    // create the canvas and add the required listeners
    this.canvas = new Canvas(this, SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND);
    this.canvas.addPaintListener(this);
    this.canvas.addMouseListener(this);
    this.canvas.addMouseMoveListener(this);

    // set up popup menu...
    this.popup = null;
    if (properties || save || print || zoom)
        this.popup = createPopupMenu(properties, save, print, zoom);

    this.enforceFileExtensions = true;
}

From source file:com.munch.exchange.parts.neuralnetwork.results.NeuralNetworkResultChartComposite.java

/**
 * Constructs a JFreeChart panel./*from  ww w .  jav  a2  s . c  om*/
 *
 * @param comp The parent.
 * @param style The style of the composite.
 * @param jfreechart  the chart.
 * @param width  the preferred width of the panel.
 * @param height  the preferred height of the panel.
 * @param minimumDrawW  the minimum drawing width.
 * @param minimumDrawH  the minimum drawing height.
 * @param maximumDrawW  the maximum drawing width.
 * @param maximumDrawH  the maximum drawing height.
 * @param usingBuffer  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 NeuralNetworkResultChartComposite(Composite comp, int style, JFreeChart jfreechart, int width,
        int height, int minimumDrawW, int minimumDrawH, int maximumDrawW, int maximumDrawH, boolean usingBuffer,
        boolean properties, boolean save, boolean print, boolean zoom, boolean tooltips) {
    super(comp, style);
    setChart(jfreechart);
    this.chartMouseListeners = new EventListenerList();
    setLayout(new FillLayout());
    this.info = new ChartRenderingInfo();
    this.useBuffer = usingBuffer;
    this.refreshBuffer = false;
    this.minimumDrawWidth = minimumDrawW;
    this.minimumDrawHeight = minimumDrawH;
    this.maximumDrawWidth = maximumDrawW;
    this.maximumDrawHeight = maximumDrawH;
    this.zoomTriggerDistance = DEFAULT_ZOOM_TRIGGER_DISTANCE;
    setDisplayToolTips(tooltips);
    // create the canvas and add the required listeners
    this.canvas = new Canvas(this, SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND);
    this.canvas.addPaintListener(this);
    this.canvas.addMouseListener(this);
    this.canvas.addMouseMoveListener(this);
    this.canvas.addDisposeListener(new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
            org.eclipse.swt.graphics.Image img;
            img = (org.eclipse.swt.graphics.Image) canvas.getData("double-buffer-image");
            if (img != null) {
                img.dispose();
            }
        }
    });

    // set up popup menu...
    this.popup = null;
    if (properties || save || print || zoom)
        this.popup = createPopupMenu(properties, save, print, zoom);

    this.enforceFileExtensions = true;
}

From source file:com.munch.exchange.ExchangeChartComposite.java

/**
 * Constructs a JFreeChart panel.//w w  w. j  av  a  2 s.c o  m
 *
 * @param comp The parent.
 * @param style The style of the composite.
 * @param jfreechart  the chart.
 * @param width  the preferred width of the panel.
 * @param height  the preferred height of the panel.
 * @param minimumDrawW  the minimum drawing width.
 * @param minimumDrawH  the minimum drawing height.
 * @param maximumDrawW  the maximum drawing width.
 * @param maximumDrawH  the maximum drawing height.
 * @param usingBuffer  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 ExchangeChartComposite(Composite comp, int style, JFreeChart jfreechart, int width, int height,
        int minimumDrawW, int minimumDrawH, int maximumDrawW, int maximumDrawH, boolean usingBuffer,
        boolean properties, boolean save, boolean print, boolean zoom, boolean tooltips) {
    super(comp, style);
    setChart(jfreechart);
    this.chartMouseListeners = new EventListenerList();
    setLayout(new FillLayout());
    this.info = new ChartRenderingInfo();
    this.useBuffer = usingBuffer;
    this.refreshBuffer = false;
    this.minimumDrawWidth = minimumDrawW;
    this.minimumDrawHeight = minimumDrawH;
    this.maximumDrawWidth = maximumDrawW;
    this.maximumDrawHeight = maximumDrawH;
    this.zoomTriggerDistance = DEFAULT_ZOOM_TRIGGER_DISTANCE;
    setDisplayToolTips(tooltips);
    // create the canvas and add the required listeners
    this.canvas = new Canvas(this, SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND);
    this.canvas.addPaintListener(this);
    this.canvas.addMouseListener(this);
    this.canvas.addMouseMoveListener(this);
    this.canvas.addMouseWheelListener(this);
    this.canvas.addMouseTrackListener(this);
    //TODO Add other listener
    this.canvas.addDisposeListener(new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
            org.eclipse.swt.graphics.Image img;
            img = (org.eclipse.swt.graphics.Image) canvas.getData("double-buffer-image");
            if (img != null) {
                img.dispose();
            }
        }
    });

    // set up popup menu...
    this.popup = null;
    if (properties || save || print || zoom)
        this.popup = createPopupMenu(properties, save, print, zoom);

    this.enforceFileExtensions = true;
}

From source file:edu.pitt.dbmi.odie.ui.jfreechart.EnhancedChartComposite.java

/**
 * Constructs a JFreeChart panel.//  ww w .  j  av a2  s  .  c o  m
 * 
 * @param comp
 *            The parent.
 * @param style
 *            The style of the composite.
 * @param jfreechart
 *            the chart.
 * @param width
 *            the preferred width of the panel.
 * @param height
 *            the preferred height of the panel.
 * @param minimumDrawW
 *            the minimum drawing width.
 * @param minimumDrawH
 *            the minimum drawing height.
 * @param maximumDrawW
 *            the maximum drawing width.
 * @param maximumDrawH
 *            the maximum drawing height.
 * @param usingBuffer
 *            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 EnhancedChartComposite(Composite comp, int style, JFreeChart jfreechart, int width, int height,
        int minimumDrawW, int minimumDrawH, int maximumDrawW, int maximumDrawH, boolean usingBuffer,
        boolean properties, boolean save, boolean print, boolean zoom, boolean tooltips) {
    super(comp, style);
    setChart(jfreechart);
    this.chartMouseListeners = new EventListenerList();
    setLayout(new FillLayout());
    this.info = new ChartRenderingInfo();
    this.useBuffer = usingBuffer;
    this.refreshBuffer = false;
    this.minimumDrawWidth = minimumDrawW;
    this.minimumDrawHeight = minimumDrawH;
    this.maximumDrawWidth = maximumDrawW;
    this.maximumDrawHeight = maximumDrawH;
    this.zoomTriggerDistance = DEFAULT_ZOOM_TRIGGER_DISTANCE;
    setDisplayToolTips(tooltips);
    // create the canvas and add the required listeners
    this.canvas = new Canvas(this, SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND);
    this.canvas.addPaintListener(this);
    this.canvas.addMouseListener(this);
    this.canvas.addMouseMoveListener(this);

    // set up popup menu...
    this.popup = null;
    if (properties || save || print || zoom)
        this.popup = createPopupMenu(properties, save, print, zoom);

    this.enforceFileExtensions = true;
}

From source file:com.rapidminer.gui.plotter.charts.AbstractChartPanel.java

/**
 * Constructs a JFreeChart panel./*from  w w  w. j av a  2  s.c  o m*/
 * 
 * @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 AbstractChartPanel(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) {
    super(chart, width, height, minimumDrawWidth, minimumDrawHeight, maximumDrawWidth, maximumDrawHeight, false,
            properties, copy, save, print, zoom, tooltips);
    setChart(chart);
    this.chartMouseListeners = new EventListenerList();
    this.info = new ChartRenderingInfo();
    setPreferredSize(new Dimension(width, height));

    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);
    // mouse listener registered in super class
    // 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.selectionOutlinePaint = Color.blue;
    this.selectionFillPaint = 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<>();

    // adding wheel listener
    addMouseWheelListener(new MouseWheelListener() {

        @Override
        public void mouseWheelMoved(MouseWheelEvent e) {
            if (e.getScrollType() != MouseWheelEvent.WHEEL_UNIT_SCROLL) {
                return;
            }
            if (e.getWheelRotation() < 0) {
                shrinkSelectionOnCenter(e.getX(), e.getY(), e);
            } else {
                enlargeSelectionOnCenter(e.getX(), e.getY(), e);
            }
        }
    });
}

From source file:com.isti.traceview.common.TraceViewChartPanel.java

/**
 * Constructs a JFreeChart panel./*w w  w . ja v  a 2s  .c  o  m*/
 * 
 * @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 TraceViewChartPanel(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();
}

From source file:org.rdv.viz.chart.ChartPanel.java

/**
 * Constructs a JFreeChart panel./*  w ww  . j a va  2  s  . c o  m*/
 *
 * @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.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.rangeHistory = new Stack<Range>();
}