@Test public void testSetMouseWheelEnabled() { DefaultXYDataset dataset = new DefaultXYDataset(); JFreeChart chart = ChartFactory.createXYLineChart("TestChart", "X", "Y", dataset); ChartPanel panel = new ChartPanel(chart); panel.setMouseWheelEnabled(true); assertTrue(panel.isMouseWheelEnabled()); panel.setMouseWheelEnabled(true); assertTrue(panel.isMouseWheelEnabled()); panel.setMouseWheelEnabled(false); assertFalse(panel.isMouseWheelEnabled()); }
public void setMouseWheelEnabled(boolean flag) { if (flag && this.mouseWheelHandler == null) { this.mouseWheelHandler = new MouseWheelHandler(this); } else if (!flag && this.mouseWheelHandler != null) { this.removeMouseWheelListener(this.mouseWheelHandler); this.mouseWheelHandler = null; } }
ChartPanel extends JPanel implements ChartChangeListener,
        ChartProgressListener, ActionListener, MouseListener,
        MouseMotionListener, OverlayChangeListener, Printable, Serializable { public void setMouseWheelEnabled(boolean flag) { if (flag && this.mouseWheelHandler == null) { this.mouseWheelHandler = new MouseWheelHandler(this); } else if (!flag && this.mouseWheelHandler != null) { this.removeMouseWheelListener(this.mouseWheelHandler); this.mouseWheelHandler = null; } } }
ChartPanel extends JPanel implements ChartChangeListener,
        ChartProgressListener, ActionListener, MouseListener,
        MouseMotionListener, OverlayChangeListener, Printable, Serializable { public void setMouseWheelEnabled(boolean flag) { if (flag && this.mouseWheelHandler == null) { this.mouseWheelHandler = new MouseWheelHandler(this); } else if (!flag && this.mouseWheelHandler != null) { this.removeMouseWheelListener(this.mouseWheelHandler); this.mouseWheelHandler = null; } } ChartPanel(JFreeChart chart);  ChartPanel(JFreeChart chart, boolean useBuffer);  ChartPanel(JFreeChart chart,
                      boolean properties,
                      boolean save,
                      boolean print,
                      boolean zoom,
                      boolean tooltips);  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);  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); }
ChartPanel extends JPanel implements ChartChangeListener,
        ChartProgressListener, ActionListener, MouseListener,
        MouseMotionListener, OverlayChangeListener, Printable, Serializable { public void setMouseWheelEnabled(boolean flag) { if (flag && this.mouseWheelHandler == null) { this.mouseWheelHandler = new MouseWheelHandler(this); } else if (!flag && this.mouseWheelHandler != null) { this.removeMouseWheelListener(this.mouseWheelHandler); this.mouseWheelHandler = null; } } ChartPanel(JFreeChart chart);  ChartPanel(JFreeChart chart, boolean useBuffer);  ChartPanel(JFreeChart chart,
                      boolean properties,
                      boolean save,
                      boolean print,
                      boolean zoom,
                      boolean tooltips);  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);  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); JFreeChart getChart(); void setChart(JFreeChart chart); int getMinimumDrawWidth(); void setMinimumDrawWidth(int width); int getMaximumDrawWidth(); void setMaximumDrawWidth(int width); int getMinimumDrawHeight(); void setMinimumDrawHeight(int height); int getMaximumDrawHeight(); void setMaximumDrawHeight(int height); double getScaleX(); double getScaleY(); Point2D getAnchor(); JPopupMenu getPopupMenu(); void setPopupMenu(JPopupMenu popup); ChartRenderingInfo getChartRenderingInfo(); void setMouseZoomable(boolean flag); void setMouseZoomable(boolean flag, boolean fillRectangle); boolean isDomainZoomable(); void setDomainZoomable(boolean flag); boolean isRangeZoomable(); void setRangeZoomable(boolean flag); boolean getFillZoomRectangle(); void setFillZoomRectangle(boolean flag); int getZoomTriggerDistance(); void setZoomTriggerDistance(int distance); boolean getHorizontalAxisTrace(); void setHorizontalAxisTrace(boolean flag); boolean getVerticalAxisTrace(); void setVerticalAxisTrace(boolean flag); File getDefaultDirectoryForSaveAs(); void setDefaultDirectoryForSaveAs(File directory); boolean isEnforceFileExtensions(); void setEnforceFileExtensions(boolean enforce); boolean getZoomAroundAnchor(); void setZoomAroundAnchor(boolean zoomAroundAnchor); Paint getZoomFillPaint(); void setZoomFillPaint(Paint paint); Paint getZoomOutlinePaint(); void setZoomOutlinePaint(Paint paint); boolean isMouseWheelEnabled(); void setMouseWheelEnabled(boolean flag); void addOverlay(Overlay overlay); void removeOverlay(Overlay overlay); @Override void overlayChanged(OverlayChangeEvent event); void setDisplayToolTips(boolean flag); @Override String getToolTipText(MouseEvent e); Point translateJava2DToScreen(Point2D java2DPoint); Point2D translateScreenToJava2D(Point screenPoint); Rectangle2D scale(Rectangle2D rect); ChartEntity getEntityForPoint(int viewX, int viewY); boolean getRefreshBuffer(); void setRefreshBuffer(boolean flag); @Override void paintComponent(Graphics g); @Override void chartChanged(ChartChangeEvent event); @Override void chartProgress(ChartProgressEvent event); @Override void actionPerformed(ActionEvent event); @Override void mouseEntered(MouseEvent e); @Override void mouseExited(MouseEvent e); @Override void mousePressed(MouseEvent e); @Override void mouseDragged(MouseEvent e); @Override void mouseReleased(MouseEvent e); void zoomMReleased(Rectangle2D selection); @Override void mouseClicked(MouseEvent event); @Override void mouseMoved(MouseEvent e); void zoomInBoth(double x, double y); void zoomInDomain(double x, double y); void zoomInRange(double x, double y); void zoomOutBoth(double x, double y); void zoomOutDomain(double x, double y); void zoomOutRange(double x, double y); void zoom(Rectangle2D selection); void restoreAutoBounds(); void restoreAutoDomainBounds(); void restoreAutoRangeBounds(); Rectangle2D getScreenDataArea(); Rectangle2D getScreenDataArea(int x, int y); int getInitialDelay(); int getReshowDelay(); int getDismissDelay(); void setInitialDelay(int delay); void setReshowDelay(int delay); void setDismissDelay(int delay); double getZoomInFactor(); void setZoomInFactor(double factor); double getZoomOutFactor(); void setZoomOutFactor(double factor); void doEditChartProperties(); void doCopy(); void doSaveAs(); void createChartPrintJob(); @Override int print(Graphics g, PageFormat pf, int pageIndex); void addChartMouseListener(ChartMouseListener listener); void removeChartMouseListener(ChartMouseListener listener); @Override T[] getListeners(Class<T> listenerType); @Override void updateUI(); boolean getUseBuffer(); PlotOrientation getOrientation(); void addMouseHandler(AbstractMouseHandler handler); boolean removeMouseHandler(AbstractMouseHandler handler); void clearLiveMouseHandler(); Shape getSelectionShape(); void setSelectionShape(Shape shape); Paint getSelectionFillPaint(); void setSelectionFillPaint(Paint paint); void setSelectionOutlinePaint(Paint paint); void setSelectionOutlineStroke(Stroke stroke); Rectangle2D getZoomRectangle(); void setZoomRectangle(Rectangle2D rect); ZoomHandler getZoomHandler(); SelectionManager getSelectionManager(); void setSelectionManager(SelectionManager manager); boolean removeListenerReleaseMouse(IDetailPanel l); void addListenerReleaseMouse(IDetailPanel l); }
ChartPanel extends JPanel implements ChartChangeListener,
        ChartProgressListener, ActionListener, MouseListener,
        MouseMotionListener, OverlayChangeListener, Printable, Serializable { public void setMouseWheelEnabled(boolean flag) { if (flag && this.mouseWheelHandler == null) { this.mouseWheelHandler = new MouseWheelHandler(this); } else if (!flag && this.mouseWheelHandler != null) { this.removeMouseWheelListener(this.mouseWheelHandler); this.mouseWheelHandler = null; } } ChartPanel(JFreeChart chart);  ChartPanel(JFreeChart chart, boolean useBuffer);  ChartPanel(JFreeChart chart,
                      boolean properties,
                      boolean save,
                      boolean print,
                      boolean zoom,
                      boolean tooltips);  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);  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); JFreeChart getChart(); void setChart(JFreeChart chart); int getMinimumDrawWidth(); void setMinimumDrawWidth(int width); int getMaximumDrawWidth(); void setMaximumDrawWidth(int width); int getMinimumDrawHeight(); void setMinimumDrawHeight(int height); int getMaximumDrawHeight(); void setMaximumDrawHeight(int height); double getScaleX(); double getScaleY(); Point2D getAnchor(); JPopupMenu getPopupMenu(); void setPopupMenu(JPopupMenu popup); ChartRenderingInfo getChartRenderingInfo(); void setMouseZoomable(boolean flag); void setMouseZoomable(boolean flag, boolean fillRectangle); boolean isDomainZoomable(); void setDomainZoomable(boolean flag); boolean isRangeZoomable(); void setRangeZoomable(boolean flag); boolean getFillZoomRectangle(); void setFillZoomRectangle(boolean flag); int getZoomTriggerDistance(); void setZoomTriggerDistance(int distance); boolean getHorizontalAxisTrace(); void setHorizontalAxisTrace(boolean flag); boolean getVerticalAxisTrace(); void setVerticalAxisTrace(boolean flag); File getDefaultDirectoryForSaveAs(); void setDefaultDirectoryForSaveAs(File directory); boolean isEnforceFileExtensions(); void setEnforceFileExtensions(boolean enforce); boolean getZoomAroundAnchor(); void setZoomAroundAnchor(boolean zoomAroundAnchor); Paint getZoomFillPaint(); void setZoomFillPaint(Paint paint); Paint getZoomOutlinePaint(); void setZoomOutlinePaint(Paint paint); boolean isMouseWheelEnabled(); void setMouseWheelEnabled(boolean flag); void addOverlay(Overlay overlay); void removeOverlay(Overlay overlay); @Override void overlayChanged(OverlayChangeEvent event); void setDisplayToolTips(boolean flag); @Override String getToolTipText(MouseEvent e); Point translateJava2DToScreen(Point2D java2DPoint); Point2D translateScreenToJava2D(Point screenPoint); Rectangle2D scale(Rectangle2D rect); ChartEntity getEntityForPoint(int viewX, int viewY); boolean getRefreshBuffer(); void setRefreshBuffer(boolean flag); @Override void paintComponent(Graphics g); @Override void chartChanged(ChartChangeEvent event); @Override void chartProgress(ChartProgressEvent event); @Override void actionPerformed(ActionEvent event); @Override void mouseEntered(MouseEvent e); @Override void mouseExited(MouseEvent e); @Override void mousePressed(MouseEvent e); @Override void mouseDragged(MouseEvent e); @Override void mouseReleased(MouseEvent e); void zoomMReleased(Rectangle2D selection); @Override void mouseClicked(MouseEvent event); @Override void mouseMoved(MouseEvent e); void zoomInBoth(double x, double y); void zoomInDomain(double x, double y); void zoomInRange(double x, double y); void zoomOutBoth(double x, double y); void zoomOutDomain(double x, double y); void zoomOutRange(double x, double y); void zoom(Rectangle2D selection); void restoreAutoBounds(); void restoreAutoDomainBounds(); void restoreAutoRangeBounds(); Rectangle2D getScreenDataArea(); Rectangle2D getScreenDataArea(int x, int y); int getInitialDelay(); int getReshowDelay(); int getDismissDelay(); void setInitialDelay(int delay); void setReshowDelay(int delay); void setDismissDelay(int delay); double getZoomInFactor(); void setZoomInFactor(double factor); double getZoomOutFactor(); void setZoomOutFactor(double factor); void doEditChartProperties(); void doCopy(); void doSaveAs(); void createChartPrintJob(); @Override int print(Graphics g, PageFormat pf, int pageIndex); void addChartMouseListener(ChartMouseListener listener); void removeChartMouseListener(ChartMouseListener listener); @Override T[] getListeners(Class<T> listenerType); @Override void updateUI(); boolean getUseBuffer(); PlotOrientation getOrientation(); void addMouseHandler(AbstractMouseHandler handler); boolean removeMouseHandler(AbstractMouseHandler handler); void clearLiveMouseHandler(); Shape getSelectionShape(); void setSelectionShape(Shape shape); Paint getSelectionFillPaint(); void setSelectionFillPaint(Paint paint); void setSelectionOutlinePaint(Paint paint); void setSelectionOutlineStroke(Stroke stroke); Rectangle2D getZoomRectangle(); void setZoomRectangle(Rectangle2D rect); ZoomHandler getZoomHandler(); SelectionManager getSelectionManager(); void setSelectionManager(SelectionManager manager); boolean removeListenerReleaseMouse(IDetailPanel l); void addListenerReleaseMouse(IDetailPanel l); static final boolean DEFAULT_BUFFER_USED; static final int DEFAULT_WIDTH; static final int DEFAULT_HEIGHT; static final int DEFAULT_MINIMUM_DRAW_WIDTH; static final int DEFAULT_MINIMUM_DRAW_HEIGHT; static final int DEFAULT_MAXIMUM_DRAW_WIDTH; static final int DEFAULT_MAXIMUM_DRAW_HEIGHT; static final int DEFAULT_ZOOM_TRIGGER_DISTANCE; static final String PROPERTIES_COMMAND; static final String COPY_COMMAND; static final String SAVE_COMMAND; static final String PRINT_COMMAND; static final String ZOOM_IN_BOTH_COMMAND; static final String ZOOM_IN_DOMAIN_COMMAND; static final String ZOOM_IN_RANGE_COMMAND; static final String ZOOM_OUT_BOTH_COMMAND; static final String ZOOM_OUT_DOMAIN_COMMAND; static final String ZOOM_OUT_RANGE_COMMAND; static final String ZOOM_RESET_BOTH_COMMAND; static final String ZOOM_RESET_DOMAIN_COMMAND; static final String ZOOM_RESET_RANGE_COMMAND; }