Class CpmPanel

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  CpmPanel.ResetableMetaDataPanel
      MetaDataPanel used for Collection Reader & AE selection and configuration.
      (package private) class  CpmPanel.StatusCallbackListenerImpl
      The Class StatusCallbackListenerImpl.
      • Nested classes/interfaces inherited from class javax.swing.JPanel

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

        javax.swing.JComponent.AccessibleJComponent
      • 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
      CpmPanel()
      Instantiates a new cpm panel.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent ev)  
      private void addAE​(java.lang.String aeSpecifierFile)
      Adds the AE.
      private boolean addAE​(CpeCasProcessor cpeCasProc)
      Adds the AE.
      private void addConsumer​(java.lang.String consumerSpecifierFile)
      Adds the consumer.
      private boolean addConsumer​(CpeCasProcessor cpeCasProc)
      Adds the consumer.
      void checkForOutOfSyncFiles()
      Check for out of sync files.
      private void clearAll()
      Resets the GUI to an empty state.
      private void clearDirty()
      Marks all fields as not dirty.
      boolean confirmExit()
      Ask user to confirm exist.
      void controlPaused()
      Control paused.
      void controlResumed()
      Control resumed.
      void controlStarted()
      Control started.
      void controlStopped()
      Control stopped.
      private CpeDescription createEmptyCpeDescription()
      Creates the empty cpe description.
      java.util.List createFileMenuItems()
      Creates JMenuItems that should be added to the File menu.
      private void createParameterOverrides​(CasProcessorConfigurationParameterSettings aSettings, MetaDataPanel aPanel)
      Called by createCpeDescription to add configuration parameter overrides to the CpeDescription being constructed, based on the user's changes in the GUI.
      java.util.List createViewMenuItems()
      Creates JMenuItems that should be added to the View menu.
      void displayError​(java.lang.String aErrorString)
      Displays an error message to the user.
      void displayError​(java.lang.Throwable aThrowable)
      Displays an error message to the user.
      private void displayProgress()
      Display progress.
      private void doSaveCpeDescriptor​(java.io.File aFile)
      Do save cpe descriptor.
      boolean fileSelected​(javax.swing.JComponent source, java.lang.String fileString)
      File selected.
      private java.awt.Frame getParentFrame()
      Gets the parent frame.
      private void initFileChoosers()
      Initialize the file choosers.
      private boolean isCasConsumerSpecifier​(ResourceSpecifier specifier)
      Checks if is cas consumer specifier.
      private boolean isDirty()
      Returns whether the GUI is dirty; that is, whether configuration settings have been modified since the last save.
      private java.lang.String makeUniqueCasProcessorName​(java.lang.String baseName)
      Make unique cas processor name.
      void onCompletion()
      On completion.
      private void openCpeDescriptor​(java.io.File aFile)
      Open cpe descriptor.
      private boolean populateCasInitializerPanel​(CpeCollectionReaderCasInitializer cpeCasIni)
      Populate cas initializer panel.
      private boolean populateCollectionReaderPanel​(CpeCollectionReaderIterator cpeColRdr)
      Populate collection reader panel.
      void printStats()
      Prints the stats.
      private void readPreferences()
      Read preferences.
      void refreshOutOfSyncFiles()
      Refresh out of sync files.
      private void removeAllAEsAndConsumers()
      Removes the all A es and consumers.
      private void resetScreen()
      Reset screen.
      private void saveCpeDescriptor()
      Prompt user for file to save CPE Descriptor to, and do the save.
      private void setCasInitializerPanelVisible​(boolean visible)
      Sets the cas initializer panel visible.
      private void setFrameEnabled​(boolean onOff)
      Called to lock the GUI while processing is occurring.
      private void setSaveUsingImports​(boolean b)
      Sets the save using imports.
      private void startProcessing()
      Start processing.
      void tabClosed​(JTabbedPaneWithCloseIcons source, int tabPos)
      Tab closed.
      private void updateCpeDescriptionParameterOverrides()
      Updates the configuration parameter settings in this.currentCpeDesc to match the current state of the GUI.
      private void updateImport​(CpeComponentDescriptor descriptor, java.io.File cpeDescSaveFile)
      Update import.
      private void updateImports​(java.io.File cpeDescSaveFile)
      Update imports.
      private java.io.File urlToFile​(java.net.URL url)
      Utility method for convertion a URL to a File name, taking care of proper escaping.
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
      • 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, paintComponent, 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 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 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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

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

      • serialVersionUID

        private static final long serialVersionUID
        The Constant serialVersionUID.
        See Also:
        Constant Field Values
      • HELP_MESSAGE

        public static final java.lang.String HELP_MESSAGE
        The Constant HELP_MESSAGE.
        See Also:
        Constant Field Values
      • PREFS_CPE_DESCRIPTOR_FILE

        private static final java.lang.String PREFS_CPE_DESCRIPTOR_FILE
        The Constant PREFS_CPE_DESCRIPTOR_FILE.
        See Also:
        Constant Field Values
      • PREFS_SAVE_USING_IMPORTS

        private static final java.lang.String PREFS_SAVE_USING_IMPORTS
        The Constant PREFS_SAVE_USING_IMPORTS.
        See Also:
        Constant Field Values
      • openCpeDescMenuItem

        private javax.swing.JMenuItem openCpeDescMenuItem
        The open cpe desc menu item.
      • saveCpeDescMenuItem

        private javax.swing.JMenuItem saveCpeDescMenuItem
        The save cpe desc menu item.
      • refreshMenuItem

        private javax.swing.JMenuItem refreshMenuItem
        The refresh menu item.
      • clearAllMenuItem

        private javax.swing.JMenuItem clearAllMenuItem
        The clear all menu item.
      • mainSplitPane

        private javax.swing.JSplitPane mainSplitPane
        The main split pane.
      • readerInitializerSplitPane

        private javax.swing.JSplitPane readerInitializerSplitPane
        The reader initializer split pane.
      • collectionReaderTitledBorder

        private javax.swing.border.TitledBorder collectionReaderTitledBorder
        The collection reader titled border.
      • casInitializerTitledBorder

        private javax.swing.border.TitledBorder casInitializerTitledBorder
        The cas initializer titled border.
      • readerFileSelector

        private FileSelector readerFileSelector
        The reader file selector.
      • casInitializerFileSelector

        private FileSelector casInitializerFileSelector
        The cas initializer file selector.
      • aeMainPanel

        private javax.swing.JPanel aeMainPanel
        The ae main panel.
      • moveAeRightButton

        private javax.swing.JButton moveAeRightButton
        The move ae right button.
      • moveAeLeftButton

        private javax.swing.JButton moveAeLeftButton
        The move ae left button.
      • addAeButton

        private javax.swing.JButton addAeButton
        The add ae button.
      • aeTitledBorder

        private javax.swing.border.TitledBorder aeTitledBorder
        The ae titled border.
      • consumersPanel

        private javax.swing.JPanel consumersPanel
        The consumers panel.
      • consumerTitledBorder

        private javax.swing.border.TitledBorder consumerTitledBorder
        The consumer titled border.
      • addConsumerButton

        private javax.swing.JButton addConsumerButton
        The add consumer button.
      • moveConsumerRightButton

        private javax.swing.JButton moveConsumerRightButton
        The move consumer right button.
      • moveConsumerLeftButton

        private javax.swing.JButton moveConsumerLeftButton
        The move consumer left button.
      • aeSpecifiers

        private java.util.Vector aeSpecifiers
        The ae specifiers.
      • consumerSpecifiers

        private java.util.Vector consumerSpecifiers
        The consumer specifiers.
      • progressBar

        private javax.swing.JProgressBar progressBar
        The progress bar.
      • transportControlPanel

        private TransportControlPanel transportControlPanel
        The transport control panel.
      • startButton

        private javax.swing.AbstractButton startButton
        The start button.
      • stopButton

        private javax.swing.AbstractButton stopButton
        The stop button.
      • statusLabel

        private javax.swing.JLabel statusLabel
        The status label.
      • progressTimer

        private javax.swing.Timer progressTimer
        The progress timer.
      • elapsedTime

        private int elapsedTime
        The elapsed time.
      • performanceQueryTimer

        private javax.swing.Timer performanceQueryTimer
        The performance query timer.
      • indeterminateProgressPause

        private boolean indeterminateProgressPause
        The indeterminate progress pause.
      • aeFileChooser

        private javax.swing.JFileChooser aeFileChooser
        The ae file chooser.
      • consumerFileChooser

        private javax.swing.JFileChooser consumerFileChooser
        The consumer file chooser.
      • openSaveFileChooser

        private javax.swing.JFileChooser openSaveFileChooser
        The open save file chooser.
      • fileChooserRootDir

        private java.io.File fileChooserRootDir
        The file chooser root dir.
      • collectionReaderLastFileSyncTimestamp

        private long collectionReaderLastFileSyncTimestamp
        The collection reader last file sync timestamp.
      • casInitializerLastFileSyncTimestamp

        private long casInitializerLastFileSyncTimestamp
        The cas initializer last file sync timestamp.
      • lastFileSyncUserPromptTime

        private long lastFileSyncUserPromptTime
        The last file sync user prompt time.
      • prefs

        private java.util.prefs.Preferences prefs
        Stores user preferences.
      • mShuttingDown

        private boolean mShuttingDown
        The m shutting down.
      • mPaused

        private boolean mPaused
        The m paused.
      • selectedComponentsChanged

        private boolean selectedComponentsChanged
        The selected components changed.
      • viewCasInitializerPanelMenuItem

        private javax.swing.JMenuItem viewCasInitializerPanelMenuItem
        The view cas initializer panel menu item.
      • currentCpeDesc

        private CpeDescription currentCpeDesc
        The current cpe desc.
      • defaultResourceManager

        private final ResourceManager defaultResourceManager
        The default resource manager.
      • saveUsingImports

        private boolean saveUsingImports
        The save using imports.
      • saveUsingImportMenuItem

        private javax.swing.JCheckBoxMenuItem saveUsingImportMenuItem
        The save using import menu item.
    • Constructor Detail

      • CpmPanel

        public CpmPanel()
        Instantiates a new cpm panel.
    • Method Detail

      • initFileChoosers

        private void initFileChoosers()
        Initialize the file choosers. This is called initially from the constructor but can be called again to reset the file choosers to their default state.
      • getParentFrame

        private java.awt.Frame getParentFrame()
        Gets the parent frame.
        Returns:
        the parent frame
      • createFileMenuItems

        public java.util.List createFileMenuItems()
        Creates JMenuItems that should be added to the File menu.
        Returns:
        a List of JMenuItems
      • createViewMenuItems

        public java.util.List createViewMenuItems()
        Creates JMenuItems that should be added to the View menu.
        Returns:
        a List of JMenuItems
      • setCasInitializerPanelVisible

        private void setCasInitializerPanelVisible​(boolean visible)
        Sets the cas initializer panel visible.
        Parameters:
        visible - the new cas initializer panel visible
      • readPreferences

        private void readPreferences()
        Read preferences.
      • setSaveUsingImports

        private void setSaveUsingImports​(boolean b)
        Sets the save using imports.
        Parameters:
        b - the new save using imports
      • startProcessing

        private void startProcessing()
        Start processing.
      • updateCpeDescriptionParameterOverrides

        private void updateCpeDescriptionParameterOverrides()
                                                     throws java.lang.Exception
        Updates the configuration parameter settings in this.currentCpeDesc to match the current state of the GUI.
        Throws:
        java.lang.Exception - the exception
      • createParameterOverrides

        private void createParameterOverrides​(CasProcessorConfigurationParameterSettings aSettings,
                                              MetaDataPanel aPanel)
                                       throws CpeDescriptorException
        Called by createCpeDescription to add configuration parameter overrides to the CpeDescription being constructed, based on the user's changes in the GUI.
        Parameters:
        aSettings - the CasProcessorConfigurationParameterSettings element that will be modified
        aPanel - the GUI panel representing settings for the CAS Processor
        Throws:
        CpeDescriptorException - the cpe descriptor exception
      • clearDirty

        private void clearDirty()
        Marks all fields as not dirty. To be called when CPE descriptor is opened or saved.
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent ev)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
      • clearAll

        private void clearAll()
        Resets the GUI to an empty state.
      • createEmptyCpeDescription

        private CpeDescription createEmptyCpeDescription()
        Creates the empty cpe description.
        Returns:
        the cpe description
      • saveCpeDescriptor

        private void saveCpeDescriptor()
        Prompt user for file to save CPE Descriptor to, and do the save.
      • doSaveCpeDescriptor

        private void doSaveCpeDescriptor​(java.io.File aFile)
                                  throws java.lang.Exception
        Do save cpe descriptor.
        Parameters:
        aFile - the a file
        Throws:
        java.lang.Exception - the exception
      • updateImports

        private void updateImports​(java.io.File cpeDescSaveFile)
                            throws java.lang.Exception
        Update imports.
        Parameters:
        cpeDescSaveFile - the cpe desc save file
        Throws:
        java.lang.Exception - the exception
      • updateImport

        private void updateImport​(CpeComponentDescriptor descriptor,
                                  java.io.File cpeDescSaveFile)
                           throws java.lang.Exception
        Update import.
        Parameters:
        descriptor - the descriptor
        cpeDescSaveFile - the cpe desc save file
        Throws:
        java.lang.Exception - the exception
      • urlToFile

        private java.io.File urlToFile​(java.net.URL url)
                                throws java.net.URISyntaxException
        Utility method for convertion a URL to a File name, taking care of proper escaping.
        Parameters:
        url - a URL
        Returns:
        File corresponding to that URL
        Throws:
        java.net.URISyntaxException - the URI syntax exception
      • displayProgress

        private void displayProgress()
        Display progress.
      • confirmExit

        public boolean confirmExit()
        Ask user to confirm exist. Return true if they confirm, false if not.
        Returns:
        true, if successful
      • checkForOutOfSyncFiles

        public void checkForOutOfSyncFiles()
        Check for out of sync files.
      • refreshOutOfSyncFiles

        public void refreshOutOfSyncFiles()
        Refresh out of sync files.
      • displayError

        public void displayError​(java.lang.String aErrorString)
        Displays an error message to the user.
        Parameters:
        aErrorString - error message to display
      • displayError

        public void displayError​(java.lang.Throwable aThrowable)
        Displays an error message to the user.
        Parameters:
        aThrowable - Throwable whose message is to be displayed.
      • makeUniqueCasProcessorName

        private java.lang.String makeUniqueCasProcessorName​(java.lang.String baseName)
        Make unique cas processor name.
        Parameters:
        baseName - the base name
        Returns:
        the string
      • removeAllAEsAndConsumers

        private void removeAllAEsAndConsumers()
        Removes the all A es and consumers.
      • fileSelected

        public boolean fileSelected​(javax.swing.JComponent source,
                                    java.lang.String fileString)
        Description copied from interface: FileSelectorListener
        File selected.
        Specified by:
        fileSelected in interface FileSelectorListener
        Parameters:
        source - the source
        fileString - the file string
        Returns:
        true, if successful
      • resetScreen

        private void resetScreen()
        Reset screen.
      • setFrameEnabled

        private void setFrameEnabled​(boolean onOff)
        Called to lock the GUI while processing is occurring. We don't actually disable the JFrame, because we don't want to disable the stop/pause buttons. Instead we disable all of the controls that the user shouldn't mess with while processing is occurring.
        Parameters:
        onOff - true to enable, false to disable
      • onCompletion

        public void onCompletion()
        On completion.
      • printStats

        public void printStats()
        Prints the stats.
      • isDirty

        private boolean isDirty()
        Returns whether the GUI is dirty; that is, whether configuration settings have been modified since the last save.
        Returns:
        whether the GUI is dirty
      • isCasConsumerSpecifier

        private boolean isCasConsumerSpecifier​(ResourceSpecifier specifier)
        Checks if is cas consumer specifier.
        Parameters:
        specifier - the specifier
        Returns:
        true, if is cas consumer specifier