Class ChartPanel



  • public class ChartPanel
    extends javax.swing.JPanel
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class javax.swing.JPanel

        javax.swing.JPanel.AccessibleJPanel
    • Field Summary

      • Fields inherited from class java.awt.Component

        accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • Fields inherited from class javax.swing.JComponent

        listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addPointSelectedListener​(IPointSelectedListener listener)  
      void firePointSelectedEvent​()  
      Chart getChart​()
      Get chart
      int getFigureHeight​()
      Get Figure height
      int getFigureWidth​()
      Get figure width
      MouseMode getMouseMode​()
      Get mouse mode
      javax.swing.JPopupMenu getPopupMenu​()
      Get popup menu
      java.util.List<int[]> getSelectedPoints​()
      Get selected chart points
      java.awt.image.BufferedImage getViewImage​()
      Get view image
      boolean hasWebMap​()
      Check if has web map layer
      void onUndoZoomClick​()
      Zoom back to full extent
      void paintComponent​(java.awt.Graphics g)
      Paint component
      void paintGraphics​()
      Paint graphics
      void paintGraphics​(java.awt.Graphics2D g)  
      void paintGraphics​(java.awt.Graphics2D g, int width, int height)  
      java.awt.image.BufferedImage paintViewImage​()
      Paint view image
      void removePointSelectedListener​(IPointSelectedListener listener)  
      void saveImage​(java.lang.String aFile)
      Save image to a picture file
      void saveImage​(java.lang.String fileName, int dpi)
      Save image
      void saveImage​(java.lang.String fileName, int dpi, int width, int height, java.lang.Integer sleep)
      Save image
      void saveImage​(java.lang.String aFile, int width, int height, java.lang.Integer sleep)
      Save image to a picture file
      void saveImage​(java.lang.String fileName, int dpi, java.lang.Integer sleep)
      Save image
      void saveImage​(java.lang.String aFile, java.lang.Integer sleep)
      Save image to a picture file
      boolean saveImage_Jpeg​(java.lang.String file, int dpi)  
      boolean saveImage_Jpeg​(java.lang.String file, int width, int height, int dpi)  
      void saveImage_Jpeg_old​(java.lang.String fileName, int dpi)
      Save image to Jpeg file
      Plot selPlot​(int x, int y)
      Select a plot by point
      void setChart​(Chart value)
      Set chart
      void setMouseMode​(MouseMode value)
      Set mouse mode
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ChartPanel

        public ChartPanel​()
        Constructor
      • ChartPanel

        public ChartPanel​(Chart chart)
        Constructor
        Parameters:
        chart - Chart
      • ChartPanel

        public ChartPanel​(Chart chart,
                          int width,
                          int height)
        Constructor
        Parameters:
        chart - Chart
        width - Chart width
        height - Chart height
    • Method Detail

      • getChart

        public Chart getChart​()
        Get chart
        Returns:
        Chart
      • setChart

        public void setChart​(Chart value)
        Set chart
        Parameters:
        value -
      • getPopupMenu

        public javax.swing.JPopupMenu getPopupMenu​()
        Get popup menu
        Returns:
        Popup menu
      • getMouseMode

        public MouseMode getMouseMode​()
        Get mouse mode
        Returns:
        Mouse mode
      • setMouseMode

        public void setMouseMode​(MouseMode value)
        Set mouse mode
        Parameters:
        value - Mouse mode
      • getSelectedPoints

        public java.util.List<int[]> getSelectedPoints​()
        Get selected chart points
        Returns:
        Selected chart points
      • firePointSelectedEvent

        public void firePointSelectedEvent​()
      • getFigureWidth

        public int getFigureWidth​()
        Get figure width
        Returns:
        Figure width
      • getFigureHeight

        public int getFigureHeight​()
        Get Figure height
        Returns:
        Figure height
      • selPlot

        public Plot selPlot​(int x,
                            int y)
        Select a plot by point
        Parameters:
        x - X
        y - Y
        Returns:
        Selected plot
      • paintComponent

        public void paintComponent​(java.awt.Graphics g)
        Paint component
        Overrides:
        paintComponent in class javax.swing.JComponent
        Parameters:
        g - Graphics
      • paintGraphics

        public void paintGraphics​()
        Paint graphics
      • paintGraphics

        public void paintGraphics​(java.awt.Graphics2D g)
      • paintGraphics

        public void paintGraphics​(java.awt.Graphics2D g,
                                  int width,
                                  int height)
      • onUndoZoomClick

        public void onUndoZoomClick​()
        Zoom back to full extent
      • saveImage

        public void saveImage​(java.lang.String aFile)
                       throws java.io.FileNotFoundException,
                              javax.print.PrintException,
                              java.io.IOException,
                              java.lang.InterruptedException
        Save image to a picture file
        Parameters:
        aFile - File path
        Throws:
        java.io.FileNotFoundException
        javax.print.PrintException
        java.lang.InterruptedException
        java.io.IOException
      • saveImage

        public void saveImage​(java.lang.String aFile,
                              java.lang.Integer sleep)
                       throws java.io.FileNotFoundException,
                              javax.print.PrintException,
                              java.io.IOException,
                              java.lang.InterruptedException
        Save image to a picture file
        Parameters:
        aFile - File path
        sleep - Sleep seconds for web map layer
        Throws:
        java.io.FileNotFoundException
        javax.print.PrintException
        java.lang.InterruptedException
        java.io.IOException
      • saveImage

        public void saveImage​(java.lang.String aFile,
                              int width,
                              int height,
                              java.lang.Integer sleep)
                       throws java.io.FileNotFoundException,
                              javax.print.PrintException,
                              java.io.IOException,
                              java.lang.InterruptedException
        Save image to a picture file
        Parameters:
        aFile - File path
        width - Width
        height - Height
        sleep - Sleep seconds for web map layer
        Throws:
        java.io.FileNotFoundException
        javax.print.PrintException
        java.lang.InterruptedException
        java.io.IOException
      • saveImage_Jpeg_old

        public void saveImage_Jpeg_old​(java.lang.String fileName,
                                       int dpi)
                                throws java.io.IOException
        Save image to Jpeg file
        Parameters:
        fileName - File name
        dpi - DPI
        Throws:
        java.io.IOException
      • saveImage_Jpeg

        public boolean saveImage_Jpeg​(java.lang.String file,
                                      int dpi)
      • saveImage_Jpeg

        public boolean saveImage_Jpeg​(java.lang.String file,
                                      int width,
                                      int height,
                                      int dpi)
      • saveImage

        public void saveImage​(java.lang.String fileName,
                              int dpi)
                       throws java.io.IOException,
                              java.lang.InterruptedException
        Save image
        Parameters:
        fileName - File name
        dpi - DPI
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • saveImage

        public void saveImage​(java.lang.String fileName,
                              int dpi,
                              java.lang.Integer sleep)
                       throws java.io.IOException,
                              java.lang.InterruptedException
        Save image
        Parameters:
        fileName - File name
        dpi - DPI
        sleep - Sleep seconds for web map layer
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • saveImage

        public void saveImage​(java.lang.String fileName,
                              int dpi,
                              int width,
                              int height,
                              java.lang.Integer sleep)
                       throws java.io.IOException,
                              java.lang.InterruptedException
        Save image
        Parameters:
        fileName - File name
        dpi - DPI
        width - Width
        height - Height
        sleep - Sleep seconds for web map layer
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • getViewImage

        public java.awt.image.BufferedImage getViewImage​()
        Get view image
        Returns:
        View image
      • paintViewImage

        public java.awt.image.BufferedImage paintViewImage​()
        Paint view image
        Returns:
        View image
      • hasWebMap

        public boolean hasWebMap​()
        Check if has web map layer
        Returns:
        Boolean