Class ViewJFrameGraph

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.ComponentListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    public class ViewJFrameGraph
    extends javax.swing.JFrame
    implements java.awt.event.ComponentListener, java.awt.event.ActionListener, javax.swing.event.ChangeListener, java.awt.event.WindowListener
    This is a frame which holds a graph in one panel and a set of user buttons in the other. It uses swing components for all of the graphics and calls ViewJComponentGraph for the graph.
    Version:
    1.0 Aug 1, 1999
    Author:
    Neva Cherniavsky (primary), Harman Singh aev* @see ViewJComponentGraph
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) class  ViewJFrameGraph.bColorListener
      This class is called by the color chooser when the user selects a a color from the background color chooser dialog box.
      (package private) class  ViewJFrameGraph.CancelListener
      This class is called by the color chooser when the user cancels.
      (package private) class  ViewJFrameGraph.ColorListener
      This class is called by the color chooser when the user selects a a color from the function line color chooser dialog.
      static class  ViewJFrameGraph.FitMode  
      • Nested classes/interfaces inherited from class javax.swing.JFrame

        javax.swing.JFrame.AccessibleJFrame
      • Nested classes/interfaces inherited from class java.awt.Frame

        java.awt.Frame.AccessibleAWTFrame
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      ViewJFrameGraph​(float[][] xInit, float[][] yInit, java.lang.String title)
      Constructor Constructs the frame, with the graph component in one panel and the user options in the other.
      ViewJFrameGraph​(float[][] x, float[][] y, java.lang.String title, VOI v)
      Constructor Constructs the frame, with the graph component in one panel and the user options in the other.
      ViewJFrameGraph​(float[][] xInit, float[][] yInit, java.lang.String title, VOI v, java.lang.String units)
      Constructor Constructs the frame, with the graph component in one panel and the user options in the other.
      ViewJFrameGraph​(float[][] xInit, float[][] yInit, java.lang.String title, java.lang.String labelX, java.lang.String labelY)
      Constructor Constructs the frame, with the graph component in one panel and the user options in the other.
      ViewJFrameGraph​(float[][] xInit, float[][] yInit, java.lang.String title, java.lang.String labelX, java.lang.String labelY, java.awt.Color[] colorArray)
      Constructor Constructs the frame, with the graph component in one panel and the user options in the other.
      ViewJFrameGraph​(float[] xInit, float[] yInit, java.lang.String title, int[][] xyCoords)
      Constructor Constructs the frame, with the graph component in one panel and the user options in the other.
      ViewJFrameGraph​(float[] x, float[] y, java.lang.String title, VOI v)
      Constructor Constructs the frame, with the graph component in one panel and the user options in the other.
      ViewJFrameGraph​(float[] xInit, float[] yInit, java.lang.String title, VOI v, java.lang.String units, int[][] xyCoords)
      Constructor Constructs the frame, with the graph component in one panel and the user options in the other.
      ViewJFrameGraph​(float[] xInit, float[] yInit, java.lang.String title, java.lang.String labelX, java.lang.String labelY)
      Constructor Constructs the frame, with the graph component in one panel and the user options in the other.
      ViewJFrameGraph​(float[] xInit, float[] yInit, java.lang.String title, java.lang.String labelX, java.lang.String labelY, boolean visible)
      Constructor Constructs the frame, with the graph component in one panel and the user options in the other.
      ViewJFrameGraph​(float[] xInit, float[] yInit, java.lang.String title, java.lang.String labelX, java.lang.String labelY, java.awt.Color color)
      Constructor Constructs the frame, with the graph component in one panel and the user options in the other.
      ViewJFrameGraph​(ModelImage image, int RGBOffset, boolean entireImage, int initialSummaryBins, double initialUserMin, double initialUserMax, float[] xInit, float[] yInit, java.lang.String title, java.lang.String labelX, java.lang.String labelY)
      Constructor Constructs the frame, with the graph component in one panel and the user options in the other.
      ViewJFrameGraph​(java.lang.String title, boolean openFileGUI)
      Constructor Constructs the frame, with the graph component in one panel and the user options in the other.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)
      Takes the action commands and paints if the apply button is pressed, closes if the close button is pressed.
      private void buildFitFunctPanel()
      Creates a panel to edit various fitted function features.
      private void buildFunctionPanel()
      Creates a panel where various features of the functions can be edited, such as showing the legend, and changing function names.
      private void buildMenu()
      Function that builds the menu of various tools to be used in conjunction with the graph. ie: opening / saving files, changing gridlines, title / axis labels, etc.
      private void buildModifyGraphPanel()
      Creats a panel where various featuers of the graph can be edited, such as visbility of gridlines and minor tick marks, number of gridlines, background color, range, and labels for the title, x and y axiis.
      void componentHidden​(java.awt.event.ComponentEvent event)
      DOCUMENT ME!
      void componentMoved​(java.awt.event.ComponentEvent event)
      DOCUMENT ME!
      void componentResized​(java.awt.event.ComponentEvent event)
      Resets the bounds of component graph if the window is resized.
      void componentShown​(java.awt.event.ComponentEvent event)
      DOCUMENT ME!
      private void createModifyDialog()
      Creates a dialog box in which the user can modify various features of the graph.
      void deleteFunct​(int index)
      Deletes the indicated function from the graph.
      private void fitFunctions​(ViewJFrameGraph.FitMode mode)  
      void focusGained​(java.awt.event.FocusEvent event)
      Unchanged.
      void focusLost​(java.awt.event.FocusEvent event)
      Unchanged.
      java.lang.String getDefaultDirectory()
      Accessor that gets the default directory.
      java.awt.Graphics getFrameGraphics()  
      ViewJComponentGraph getGraph()  
      private float getMedian​(float[] toSort)
      DOCUMENT ME!
      void itemStateChanged​(java.awt.event.ItemEvent event)
      Unchanged.
      void makeRangeSymmetric()
      DOCUMENT ME!
      boolean openNew()
      Opens Excel data (tab-delimited fields) into a new graph.
      boolean openSame()
      Opens Excel data (tab-delimited fields) into this graph.
      private float[] parseString​(java.lang.String s, int len)
      DOCUMENT ME!
      private void print()
      Prints the current graph being displayed to the printer.
      void removeComponentListener()  
      void replaceFunction​(float[] newX, float[] newY)
      Replaces the function used with a line image.
      void replaceFunction​(float[] newX, float[] newY, int[][] newXYCoords, VOI myVoi, int index)
      Replaces the function used with a line image.
      void save()
      Saves this graph as Excel data so that Excel can read in the data and graph it as an Excel file.
      void save​(java.lang.String fileName)
      Saves this graph as Excel data so that Excel can read in the data and graph it as an Excel file.
      void saveNewFunction​(float[][] newX, float[][] newY, int ptIndex)
      Replaces the first three functions (used with RGB images).
      void saveNewFunction​(float[] newX, float[] newY, int index)
      Saves the current function and adds a blank new function.
      void setDefaultDirectory​(java.lang.String dir)
      Accessor that sets the default directory.
      void setLabels​(java.lang.String labelX, java.lang.String labelY)
      Sets the axis labels.
      void setLabelY​(java.lang.String labelY)  
      void setResetEnabled​(boolean enabled)
      Accessor that enables or disables the reset item.
      void setUnitsInLabel​(java.lang.String units)
      Sets the units in the default axis labels.
      void setVisible​(boolean status)
      Makes the dialog visible in center of screen.
      void setVisibleNoLocChange​(boolean status)
      Makes the dialog visible without setting position.
      void setVOI​(VOI v)
      Accessor that sets the VOI ViewJFrameGraph was made from.
      void showXYZLegends()
      DOCUMENT ME!
      void stateChanged​(javax.swing.event.ChangeEvent e)
      ChangeListener************************************************************************* /** Sets values based on knob along slider
      private void tableOutput()  
      private boolean testMaxParameter​(java.lang.String str, float maxValue)
      Tests that the entered parameter is above maxValue.
      private boolean testMinParameter​(java.lang.String str, float minValue)
      Tests that the entered parameter is below minValue.
      private boolean testParameter​(java.lang.String str, int minValue, int maxValue)
      Tests that the entered parameter is in range.
      void update​(float[][] x, float[][] y, int ptIndex)
      Updates the graph by changing the plot to the desired new 3 functions (RGB).
      void update​(float[] x, float[] y, int j)
      Updates the graph by changing the plot to the desired new function / intensity plot.
      void update​(java.awt.Graphics g)
      Calls paint instead of erasing.
      void updateFittedFunctions()
      Deprecated.
      If data were changed, this could be useful to refit data without pressing a new button, but this function is not currently utilized.
      private void updateModifyDialog()
      Updates fields of the Modify Graph Dialog which may have changed due to things such as adding/deleting functions.
      void windowActivated​(java.awt.event.WindowEvent event)
      Unchanged.
      void windowClosed​(java.awt.event.WindowEvent event)
      Unchanged.
      void windowClosing​(java.awt.event.WindowEvent event)
      Disposes of error dialog, then frame.
      void windowDeactivated​(java.awt.event.WindowEvent event)
      Unchanged.
      void windowDeiconified​(java.awt.event.WindowEvent event)
      Unchanged.
      void windowIconified​(java.awt.event.WindowEvent event)
      Unchanged.
      void windowOpened​(java.awt.event.WindowEvent event)
      Unchanged.
      • Methods inherited from class javax.swing.JFrame

        addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler
      • Methods inherited from class java.awt.Frame

        addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, show, toBack, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.MenuContainer

        getFont, postEvent
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • MINIMUM_WIDTH

        private static final int MINIMUM_WIDTH
        Minimum width of the graph panel
        See Also:
        Constant Field Values
      • MINIMUM_HEIGHT

        private static final int MINIMUM_HEIGHT
        Minimum height of the graph panel
        See Also:
        Constant Field Values
      • PANEL_OFFSET

        private static final int PANEL_OFFSET
        Minimum distance between frame and subpanels
        See Also:
        Constant Field Values
      • autoShrinkDomain

        private boolean autoShrinkDomain
      • autoShrinkDomainCheckbox

        private javax.swing.JCheckBox autoShrinkDomainCheckbox
      • autoShrinkRange

        private boolean autoShrinkRange
        DOCUMENT ME!
      • autoShrinkRangeCheckbox

        private javax.swing.JCheckBox autoShrinkRangeCheckbox
        DOCUMENT ME!
      • axisPanel

        private javax.swing.JPanel axisPanel
        DOCUMENT ME!
      • backgroundButton

        private javax.swing.JButton backgroundButton
        DOCUMENT ME!
      • backgroundLabel

        private javax.swing.JLabel backgroundLabel
        DOCUMENT ME!
      • backgroundPanel

        private javax.swing.JPanel backgroundPanel
        DOCUMENT ME!
      • colorDialog

        private javax.swing.JDialog colorDialog
        DOCUMENT ME!
      • copyMenu

        private javax.swing.JMenu copyMenu
        DOCUMENT ME!
      • defaultDirectory

        private java.lang.String defaultDirectory
        DOCUMENT ME!
      • deleteMenu

        private javax.swing.JMenu deleteMenu
        DOCUMENT ME!
      • editMenu

        private javax.swing.JMenu editMenu
        DOCUMENT ME!
      • fileMenu

        private javax.swing.JMenu fileMenu
        DOCUMENT ME!
      • fitFunctPanel

        private javax.swing.JPanel fitFunctPanel
        DOCUMENT ME!
      • fitFunctTypePanel

        private javax.swing.JPanel fitFunctTypePanel
        DOCUMENT ME!
      • fitFunctVisibleCheckbox

        private javax.swing.JCheckBox[] fitFunctVisibleCheckbox
        DOCUMENT ME!
      • fitFunctVisiblePanel

        private javax.swing.JPanel fitFunctVisiblePanel
        DOCUMENT ME!
      • frameGraphVOI

        private VOI frameGraphVOI
        DOCUMENT ME!
      • functionIndex

        private int functionIndex
        DOCUMENT ME!
      • functLineColorButton

        private javax.swing.JButton[] functLineColorButton
        DOCUMENT ME!
      • functVisibleCheckbox

        private javax.swing.JCheckBox[] functVisibleCheckbox
        the slope changes.
      • gridlinesCheckbox

        private javax.swing.JCheckBox gridlinesCheckbox
        DOCUMENT ME!
      • gridPanel

        private javax.swing.JPanel gridPanel
        DOCUMENT ME!
      • itemClose

        private javax.swing.JMenuItem itemClose
        DOCUMENT ME!
      • itemModifyGraph

        private javax.swing.JMenuItem itemModifyGraph
        DOCUMENT ME!
      • itemNormalize

        private javax.swing.JMenuItem itemNormalize
        DOCUMENT ME!
      • itemOpenNewGraph

        private javax.swing.JMenuItem itemOpenNewGraph
      • itemOpenSameGraph

        private javax.swing.JMenuItem itemOpenSameGraph
        DOCUMENT ME!
      • itemPasteFunct

        private javax.swing.JMenuItem itemPasteFunct
        DOCUMENT ME!
      • itemPrintGraph

        private javax.swing.JMenuItem itemPrintGraph
        DOCUMENT ME!
      • itemResetGraph

        private javax.swing.JMenuItem itemResetGraph
        DOCUMENT ME!
      • itemResetDomain

        private javax.swing.JMenuItem itemResetDomain
      • itemResetRange

        private javax.swing.JMenuItem itemResetRange
        DOCUMENT ME!
      • itemSaveGraph

        private javax.swing.JMenuItem itemSaveGraph
        DOCUMENT ME!
      • itemTableOutput

        private javax.swing.JMenuItem itemTableOutput
      • lastUnits

        private java.lang.String lastUnits
        DOCUMENT ME!
      • legendCheckbox

        private javax.swing.JCheckBox legendCheckbox
        DOCUMENT ME!
      • nameField

        private javax.swing.JTextField[] nameField
        DOCUMENT ME!
      • functionLabel

        private javax.swing.JLabel[] functionLabel
        DOCUMENT ME!
      • legendPanel

        private javax.swing.JPanel legendPanel
        DOCUMENT ME!
      • mainPanel

        private javax.swing.JPanel mainPanel
        DOCUMENT ME!
      • maxDomainField

        private javax.swing.JTextField maxDomainField
      • maxDomainLabel

        private javax.swing.JLabel maxDomainLabel
      • minDomainField

        private javax.swing.JTextField minDomainField
      • minDomainLabel

        private javax.swing.JLabel minDomainLabel
      • maxRangeField

        private javax.swing.JTextField maxRangeField
        DOCUMENT ME!
      • maxRangeLabel

        private javax.swing.JLabel maxRangeLabel
        DOCUMENT ME!
      • minorTickMarksCheckbox

        private javax.swing.JCheckBox minorTickMarksCheckbox
        DOCUMENT ME!
      • minRangeField

        private javax.swing.JTextField minRangeField
        DOCUMENT ME!
      • minRangeLabel

        private javax.swing.JLabel minRangeLabel
        DOCUMENT ME!
      • modifyDialog

        private javax.swing.JDialog modifyDialog
        DOCUMENT ME!
      • modifyGraphPanel

        private javax.swing.JPanel modifyGraphPanel
        DOCUMENT ME!
      • functionPropPanel

        private javax.swing.JPanel functionPropPanel
        DOCUMENT ME!
      • openingMenuBar

        private javax.swing.JMenuBar openingMenuBar
        DOCUMENT ME!
      • linesOnlyButton

        private javax.swing.JRadioButton linesOnlyButton
        DOCUMENT ME!
      • pointsAndLinesButton

        private javax.swing.JRadioButton pointsAndLinesButton
      • pointsOnlyButton

        private javax.swing.JRadioButton pointsOnlyButton
      • pointsAndLinesGroup

        private javax.swing.ButtonGroup pointsAndLinesGroup
      • pointsVisiblePanel

        private javax.swing.JPanel pointsVisiblePanel
        DOCUMENT ME!
      • fitType

        private javax.swing.JComboBox fitType
        Combo box for selecting the fitting function type
      • domainPanel

        private javax.swing.JPanel domainPanel
      • resetDomainButton

        private javax.swing.JButton resetDomainButton
      • logScaleCheckboxX

        private javax.swing.JCheckBox logScaleCheckboxX
      • doLogX

        private boolean doLogX
      • rangePanel

        private javax.swing.JPanel rangePanel
        DOCUMENT ME!
      • resetRangeButton

        private javax.swing.JButton resetRangeButton
        DOCUMENT ME!
      • logScaleCheckboxY

        private javax.swing.JCheckBox logScaleCheckboxY
      • doLogY

        private boolean doLogY
      • showPanel

        private javax.swing.JPanel showPanel
        DOCUMENT ME!
      • tabbedPane

        private javax.swing.JTabbedPane tabbedPane
        DOCUMENT ME!
      • titleField

        private javax.swing.JTextField titleField
        DOCUMENT ME!
      • titleLabel

        private javax.swing.JLabel titleLabel
        DOCUMENT ME!
      • units

        private java.lang.String units
        DOCUMENT ME!
      • updateRGBIndex

        private int updateRGBIndex
        DOCUMENT ME!
      • vectorCopyFunct

        private java.util.Vector<javax.swing.JMenuItem> vectorCopyFunct
        DOCUMENT ME!
      • vectorDeleteFunct

        private java.util.Vector<javax.swing.JMenuItem> vectorDeleteFunct
        DOCUMENT ME!
      • viewMenu

        private javax.swing.JMenu viewMenu
        DOCUMENT ME!
      • voi

        private VOI voi
        DOCUMENT ME!
      • xAxisLabel

        private javax.swing.JLabel xAxisLabel
        DOCUMENT ME!
      • xAxisLabelField

        private javax.swing.JTextField xAxisLabelField
        DOCUMENT ME!
      • xGridEvenSpacedButton

        private javax.swing.JRadioButton xGridEvenSpacedButton
      • xGridUserSpacedButton

        private javax.swing.JRadioButton xGridUserSpacedButton
      • xGridButtonGroup

        private javax.swing.ButtonGroup xGridButtonGroup
      • xGridCheckBoxPanel

        private javax.swing.JPanel xGridCheckBoxPanel
      • xGridCheckBoxList

        private javax.swing.JCheckBox[] xGridCheckBoxList
      • xGridScrollPane

        private javax.swing.JScrollPane xGridScrollPane
      • xGridLineField

        private javax.swing.JTextField xGridLineField
        DOCUMENT ME!
      • xGridLineLabel

        private javax.swing.JLabel xGridLineLabel
        DOCUMENT ME!
      • yAxisLabel

        private javax.swing.JLabel yAxisLabel
        DOCUMENT ME!
      • yAxisLabelField

        private javax.swing.JTextField yAxisLabelField
        DOCUMENT ME!
      • yGridEvenSpacedButton

        private javax.swing.JRadioButton yGridEvenSpacedButton
      • yGridUserSpacedButton

        private javax.swing.JRadioButton yGridUserSpacedButton
      • yGridButtonGroup

        private javax.swing.ButtonGroup yGridButtonGroup
      • yGridCheckBoxPanel

        private javax.swing.JPanel yGridCheckBoxPanel
      • yGridCheckBoxList

        private javax.swing.JCheckBox[] yGridCheckBoxList
      • yGridScrollPane

        private javax.swing.JScrollPane yGridScrollPane
      • yGridLineField

        private javax.swing.JTextField yGridLineField
        DOCUMENT ME!
      • yGridLineLabel

        private javax.swing.JLabel yGridLineLabel
        DOCUMENT ME!
      • xyCoords

        private int[][] xyCoords
        this is a list of the x,y coords of the voi's boundary
      • numVariablesLabel

        private javax.swing.JLabel numVariablesLabel
      • numVariablesField

        private javax.swing.JTextField numVariablesField
      • numVariables

        private int numVariables
      • RGBOffset

        private int RGBOffset
      • entireImage

        private boolean entireImage
      • initialSummaryBins

        private int initialSummaryBins
      • summaryBins

        private int summaryBins
      • initialUserMin

        private double initialUserMin
      • userMin

        private double userMin
      • initialUserMax

        private double initialUserMax
      • userMax

        private double userMax
      • minField

        private javax.swing.JTextField minField
      • maxField

        private javax.swing.JTextField maxField
      • binsField

        private javax.swing.JTextField binsField
      • imageMin

        private double imageMin
      • imageMax

        private double imageMax
      • maxBins

        private int maxBins
      • histogramPanel

        private javax.swing.JPanel histogramPanel
    • Constructor Detail

      • ViewJFrameGraph

        public ViewJFrameGraph​(java.lang.String title,
                               boolean openFileGUI)
        Constructor Constructs the frame, with the graph component in one panel and the user options in the other. No function is loaded by default, but the user can open a new function to be displayed
        Parameters:
        title - DOCUMENT ME!
        openFileGUI - DOCUMENT ME!
      • ViewJFrameGraph

        public ViewJFrameGraph​(float[] xInit,
                               float[] yInit,
                               java.lang.String title,
                               int[][] xyCoords)
        Constructor Constructs the frame, with the graph component in one panel and the user options in the other. Draws initial default graph of desired function / intensity plot.
        Parameters:
        xInit - the array of x coordinates to be plotted in the graph
        yInit - the array of y coordinates to be plotted in the graph
        title - the title of the frame
      • ViewJFrameGraph

        public ViewJFrameGraph​(float[][] xInit,
                               float[][] yInit,
                               java.lang.String title)
        Constructor Constructs the frame, with the graph component in one panel and the user options in the other. Draws initial default graph of desired function / intensity plot.
        Parameters:
        xInit - the array of x coordinates to be plotted in the graph
        yInit - the array of y coordinates to be plotted in the graph
        title - the title of the frame
      • ViewJFrameGraph

        public ViewJFrameGraph​(float[] x,
                               float[] y,
                               java.lang.String title,
                               VOI v)
        Constructor Constructs the frame, with the graph component in one panel and the user options in the other. Graph is assumed to be made from a VOIPoint. Draws initial default graph of desired function / intensity plot.
        Parameters:
        x - the array of x coordinates to be plotted in the graph
        y - the array of y coordinates to be plotted in the graph
        title - the title of the frame
        v - the VOI the graph is being made for
      • ViewJFrameGraph

        public ViewJFrameGraph​(float[][] x,
                               float[][] y,
                               java.lang.String title,
                               VOI v)
        Constructor Constructs the frame, with the graph component in one panel and the user options in the other. Graph is assumed to be made from a VOIPoint. Draws initial default graph of desired function / intensity plot.
        Parameters:
        x - the array of x coordinates to be plotted in the graph
        y - the array of y coordinates to be plotted in the graph
        title - the title of the frame
        v - the VOI the graph is being made for
      • ViewJFrameGraph

        public ViewJFrameGraph​(ModelImage image,
                               int RGBOffset,
                               boolean entireImage,
                               int initialSummaryBins,
                               double initialUserMin,
                               double initialUserMax,
                               float[] xInit,
                               float[] yInit,
                               java.lang.String title,
                               java.lang.String labelX,
                               java.lang.String labelY)
        Constructor Constructs the frame, with the graph component in one panel and the user options in the other. Draws initial default graph of desired function / intensity plot.
        Parameters:
        xInit - the array of x coordinates to be plotted in the graph
        yInit - the array of y coordinates to be plotted in the graph
        title - the title of the frame
        labelX - x axis label
        labelY - y aixs label
      • ViewJFrameGraph

        public ViewJFrameGraph​(float[] xInit,
                               float[] yInit,
                               java.lang.String title,
                               java.lang.String labelX,
                               java.lang.String labelY)
        Constructor Constructs the frame, with the graph component in one panel and the user options in the other. Draws initial default graph of desired function / intensity plot.
        Parameters:
        xInit - the array of x coordinates to be plotted in the graph
        yInit - the array of y coordinates to be plotted in the graph
        title - the title of the frame
        labelX - x axis label
        labelY - y aixs label
      • ViewJFrameGraph

        public ViewJFrameGraph​(float[] xInit,
                               float[] yInit,
                               java.lang.String title,
                               java.lang.String labelX,
                               java.lang.String labelY,
                               boolean visible)
        Constructor Constructs the frame, with the graph component in one panel and the user options in the other. Draws initial default graph of desired function / intensity plot.
        Parameters:
        xInit - the array of x coordinates to be plotted in the graph
        yInit - the array of y coordinates to be plotted in the graph
        title - the title of the frame
        labelX - x axis label
        labelY - y aixs label
      • ViewJFrameGraph

        public ViewJFrameGraph​(float[][] xInit,
                               float[][] yInit,
                               java.lang.String title,
                               java.lang.String labelX,
                               java.lang.String labelY)
        Constructor Constructs the frame, with the graph component in one panel and the user options in the other. Draws initial default graph of desired function / intensity plot.
        Parameters:
        xInit - the array of x coordinates to be plotted in the graph
        yInit - the array of y coordinates to be plotted in the graph
        title - the title of the frame
        labelX - x axis label
        labelY - y axis label
      • ViewJFrameGraph

        public ViewJFrameGraph​(float[] xInit,
                               float[] yInit,
                               java.lang.String title,
                               VOI v,
                               java.lang.String units,
                               int[][] xyCoords)
        Constructor Constructs the frame, with the graph component in one panel and the user options in the other. Graph is assumed to be made from a VOIPoint. Draws initial default graph of desired function / intensity plot.
        Parameters:
        xInit - the array of x coordinates to be plotted in the graph
        yInit - the array of y coordinates to be plotted in the graph
        title - the title of the frame
        v - the VOI the graph is being made for
        units - the string representing the units of the curve (x-axis)
        xyCoords - actual x,y coords of the boundary go in here if not null
      • ViewJFrameGraph

        public ViewJFrameGraph​(float[][] xInit,
                               float[][] yInit,
                               java.lang.String title,
                               VOI v,
                               java.lang.String units)
        Constructor Constructs the frame, with the graph component in one panel and the user options in the other. Graph is assumed to be made from a VOIPoint. Draws initial default graph of desired function / intensity plot.
        Parameters:
        xInit - the array of x coordinates to be plotted in the graph
        yInit - the array of y coordinates to be plotted in the graph
        title - the title of the frame
        v - the VOI the graph is being made for
        units - the string representing the units of the curve (x-axis)
      • ViewJFrameGraph

        public ViewJFrameGraph​(float[] xInit,
                               float[] yInit,
                               java.lang.String title,
                               java.lang.String labelX,
                               java.lang.String labelY,
                               java.awt.Color color)
        Constructor Constructs the frame, with the graph component in one panel and the user options in the other. Draws initial default graph of desired function / intensity plot.
        Parameters:
        xInit - the array of x coordinates to be plotted in the graph
        yInit - the array of y coordinates to be plotted in the graph
        title - the title of the frame
        labelX - x axis label
        labelY - y aixs label
        color - DOCUMENT ME!
      • ViewJFrameGraph

        public ViewJFrameGraph​(float[][] xInit,
                               float[][] yInit,
                               java.lang.String title,
                               java.lang.String labelX,
                               java.lang.String labelY,
                               java.awt.Color[] colorArray)
        Constructor Constructs the frame, with the graph component in one panel and the user options in the other. Draws initial default graph of desired function / intensity plot.
        Parameters:
        xInit - the array of x coordinates to be plotted in the graph
        yInit - the array of y coordinates to be plotted in the graph
        title - the title of the frame
        labelX - x axis label
        labelY - y axis label
        colorArray - DOCUMENT ME!
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Takes the action commands and paints if the apply button is pressed, closes if the close button is pressed.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        event - event that triggers this function
      • componentHidden

        public void componentHidden​(java.awt.event.ComponentEvent event)
        DOCUMENT ME!
        Specified by:
        componentHidden in interface java.awt.event.ComponentListener
        Parameters:
        event - DOCUMENT ME!
      • componentMoved

        public void componentMoved​(java.awt.event.ComponentEvent event)
        DOCUMENT ME!
        Specified by:
        componentMoved in interface java.awt.event.ComponentListener
        Parameters:
        event - DOCUMENT ME!
      • componentResized

        public void componentResized​(java.awt.event.ComponentEvent event)
        Resets the bounds of component graph if the window is resized.
        Specified by:
        componentResized in interface java.awt.event.ComponentListener
        Parameters:
        event - event that triggered this function
      • componentShown

        public void componentShown​(java.awt.event.ComponentEvent event)
        DOCUMENT ME!
        Specified by:
        componentShown in interface java.awt.event.ComponentListener
        Parameters:
        event - DOCUMENT ME!
      • deleteFunct

        public void deleteFunct​(int index)
        Deletes the indicated function from the graph.
        Parameters:
        index - the index of the function to be deleted
      • focusGained

        public void focusGained​(java.awt.event.FocusEvent event)
        Unchanged.
        Parameters:
        event - DOCUMENT ME!
      • focusLost

        public void focusLost​(java.awt.event.FocusEvent event)
        Unchanged.
        Parameters:
        event - DOCUMENT ME!
      • getDefaultDirectory

        public java.lang.String getDefaultDirectory()
        Accessor that gets the default directory.
        Returns:
        the default directory
      • itemStateChanged

        public void itemStateChanged​(java.awt.event.ItemEvent event)
        Unchanged.
        Parameters:
        event - DOCUMENT ME!
      • makeRangeSymmetric

        public void makeRangeSymmetric()
        DOCUMENT ME!
      • openNew

        public boolean openNew()
                        throws java.io.IOException
        Opens Excel data (tab-delimited fields) into a new graph. The graphs could also have been saved using MIPAV
        Returns:
        DOCUMENT ME!
        Throws:
        java.io.IOException - DOCUMENT ME!
      • openSame

        public boolean openSame()
                         throws java.io.IOException
        Opens Excel data (tab-delimited fields) into this graph. The graphs could also have been saved using MIPAV
        Returns:
        DOCUMENT ME!
        Throws:
        java.io.IOException - DOCUMENT ME!
      • replaceFunction

        public void replaceFunction​(float[] newX,
                                    float[] newY)
        Replaces the function used with a line image.
        Parameters:
        newX - a 1-d array of which contains the x-coordinates for the function
        newY - a 1-d array of which contains the y-coordinates for the function
      • replaceFunction

        public void replaceFunction​(float[] newX,
                                    float[] newY,
                                    int[][] newXYCoords,
                                    VOI myVoi,
                                    int index)
        Replaces the function used with a line image.
        Parameters:
        newX - a 1-d array of which contains the x-coordinates for the function
        newY - a 1-d array of which contains the y-coordinates for the function
        myVoi - the new VOI for this function
        index - DOCUMENT ME!
      • saveNewFunction

        public void saveNewFunction​(float[] newX,
                                    float[] newY,
                                    int index)
        Saves the current function and adds a blank new function.
        Parameters:
        newX - array of which contains the x-coordinates for the new function
        newY - an array of which contains the y-coordinates for the new functions
        index - the index of the point to be updated
      • saveNewFunction

        public void saveNewFunction​(float[][] newX,
                                    float[][] newY,
                                    int ptIndex)
        Replaces the first three functions (used with RGB images).
        Parameters:
        newX - a 2-d array of which contains the x-coordinates for the three functions (RGB)
        newY - a 2-d array of which contains the y-coordinates for the three functions (RGB)
        ptIndex - the index of the point to be updated
      • setDefaultDirectory

        public void setDefaultDirectory​(java.lang.String dir)
        Accessor that sets the default directory.
        Parameters:
        dir - string to set the default directory to
      • setLabels

        public void setLabels​(java.lang.String labelX,
                              java.lang.String labelY)
        Sets the axis labels.
        Parameters:
        labelX - DOCUMENT ME!
        labelY - DOCUMENT ME!
      • setLabelY

        public void setLabelY​(java.lang.String labelY)
      • setResetEnabled

        public void setResetEnabled​(boolean enabled)
        Accessor that enables or disables the reset item.
        Parameters:
        enabled - boolean that enables if true, disables if false
      • setUnitsInLabel

        public void setUnitsInLabel​(java.lang.String units)
        Sets the units in the default axis labels.
        Parameters:
        units - the String representing the units to be displayed
      • setVisible

        public void setVisible​(boolean status)
        Makes the dialog visible in center of screen.
        Overrides:
        setVisible in class java.awt.Window
        Parameters:
        status - - flag to indicating if the dialog should be visible
      • setVisibleNoLocChange

        public void setVisibleNoLocChange​(boolean status)
        Makes the dialog visible without setting position.
        Parameters:
        status - - flag to indicating if the dialog should be visible
      • setVOI

        public void setVOI​(VOI v)
        Accessor that sets the VOI ViewJFrameGraph was made from.
        Parameters:
        v - DOCUMENT ME!
      • showXYZLegends

        public void showXYZLegends()
        DOCUMENT ME!
      • stateChanged

        public void stateChanged​(javax.swing.event.ChangeEvent e)
        ChangeListener************************************************************************* /** Sets values based on knob along slider
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
        Parameters:
        e - event that triggered this function
      • update

        public void update​(java.awt.Graphics g)
        Calls paint instead of erasing.
        Overrides:
        update in class javax.swing.JFrame
        Parameters:
        g - graphics to paint in
      • update

        public void update​(float[] x,
                           float[] y,
                           int j)
        Updates the graph by changing the plot to the desired new function / intensity plot.
        Parameters:
        x - the array of x coordinates to be plotted in the graph
        y - the array of y coordinates to be plotted in the graph
        j - The function index of which point to be updated
      • update

        public void update​(float[][] x,
                           float[][] y,
                           int ptIndex)
        Updates the graph by changing the plot to the desired new 3 functions (RGB).
        Parameters:
        x - the 2-d array of x coordinates to be plotted in the graph for each function
        y - the 2-d array of y coordinates to be plotted in the graph for each function
        ptIndex - the index of the point to be updated (will not do anything if trying to update of an index different than updateRGBIndex)
      • updateFittedFunctions

        public void updateFittedFunctions()
        Deprecated.
        If data were changed, this could be useful to refit data without pressing a new button, but this function is not currently utilized. Will be removed in future version of MIPAV unless a use can be found Updates Fitted Functions to accurately estimate the functions in the graph (Function data may have chaned due to realtime updating, and therefore the fitted functions must be updated).
      • windowActivated

        public void windowActivated​(java.awt.event.WindowEvent event)
        Unchanged.
        Specified by:
        windowActivated in interface java.awt.event.WindowListener
        Parameters:
        event - DOCUMENT ME!
      • windowClosed

        public void windowClosed​(java.awt.event.WindowEvent event)
        Unchanged.
        Specified by:
        windowClosed in interface java.awt.event.WindowListener
        Parameters:
        event - DOCUMENT ME!
      • windowClosing

        public void windowClosing​(java.awt.event.WindowEvent event)
        Disposes of error dialog, then frame. Nullifies pointer to this in VOIPoint, if this graph was made from a VOIPoint.
        Specified by:
        windowClosing in interface java.awt.event.WindowListener
        Parameters:
        event - DOCUMENT ME!
      • windowDeactivated

        public void windowDeactivated​(java.awt.event.WindowEvent event)
        Unchanged.
        Specified by:
        windowDeactivated in interface java.awt.event.WindowListener
        Parameters:
        event - DOCUMENT ME!
      • windowDeiconified

        public void windowDeiconified​(java.awt.event.WindowEvent event)
        Unchanged.
        Specified by:
        windowDeiconified in interface java.awt.event.WindowListener
        Parameters:
        event - DOCUMENT ME!
      • windowIconified

        public void windowIconified​(java.awt.event.WindowEvent event)
        Unchanged.
        Specified by:
        windowIconified in interface java.awt.event.WindowListener
        Parameters:
        event - DOCUMENT ME!
      • windowOpened

        public void windowOpened​(java.awt.event.WindowEvent event)
        Unchanged.
        Specified by:
        windowOpened in interface java.awt.event.WindowListener
        Parameters:
        event - DOCUMENT ME!
      • buildFitFunctPanel

        private void buildFitFunctPanel()
        Creates a panel to edit various fitted function features. (Panel is to be used in the tabbed pane of the Modify Graph Dialog box
      • buildFunctionPanel

        private void buildFunctionPanel()
        Creates a panel where various features of the functions can be edited, such as showing the legend, and changing function names. This panel is used by the tabbed pane in Modify Graph Dialog Box.
      • buildMenu

        private void buildMenu()
        Function that builds the menu of various tools to be used in conjunction with the graph. ie: opening / saving files, changing gridlines, title / axis labels, etc.
      • buildModifyGraphPanel

        private void buildModifyGraphPanel()
        Creats a panel where various featuers of the graph can be edited, such as visbility of gridlines and minor tick marks, number of gridlines, background color, range, and labels for the title, x and y axiis.
      • createModifyDialog

        private void createModifyDialog()
        Creates a dialog box in which the user can modify various features of the graph.
      • getMedian

        private float getMedian​(float[] toSort)
        DOCUMENT ME!
        Parameters:
        toSort - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • parseString

        private float[] parseString​(java.lang.String s,
                                    int len)
        DOCUMENT ME!
        Parameters:
        s - DOCUMENT ME!
        len - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • print

        private void print()
        Prints the current graph being displayed to the printer.
      • save

        public void save()
                  throws java.io.IOException
        Saves this graph as Excel data so that Excel can read in the data and graph it as an Excel file. The file can also be saved to be viewed at a later time with MIPAV
        Throws:
        java.io.IOException - DOCUMENT ME!
      • save

        public void save​(java.lang.String fileName)
                  throws java.io.IOException
        Saves this graph as Excel data so that Excel can read in the data and graph it as an Excel file. The file can also be saved to be viewed at a later time with MIPAV
        Throws:
        java.io.IOException - DOCUMENT ME!
      • tableOutput

        private void tableOutput()
      • testMaxParameter

        private boolean testMaxParameter​(java.lang.String str,
                                         float maxValue)
        Tests that the entered parameter is above maxValue.
        Parameters:
        str - the value entered by the user
        maxValue - the value that the entered paramater must be more than
        Returns:
        boolean result of test
      • testMinParameter

        private boolean testMinParameter​(java.lang.String str,
                                         float minValue)
        Tests that the entered parameter is below minValue.
        Parameters:
        str - the value entered by the user
        minValue - the value that the variable should be less than
        Returns:
        boolean result of test
      • testParameter

        private boolean testParameter​(java.lang.String str,
                                      int minValue,
                                      int maxValue)
        Tests that the entered parameter is in range.
        Parameters:
        str - the value entered by the user
        minValue - the minimum value this variable may be set to
        maxValue - the maximum value this variable may be set to
        Returns:
        boolean result of test
      • updateModifyDialog

        private void updateModifyDialog()
        Updates fields of the Modify Graph Dialog which may have changed due to things such as adding/deleting functions.
      • getFrameGraphics

        public java.awt.Graphics getFrameGraphics()
      • removeComponentListener

        public void removeComponentListener()