Package org.apache.uima.tools.cpm
Class CpmPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- org.apache.uima.tools.cpm.CpmPanel
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,java.util.EventListener,javax.accessibility.Accessible,TabClosedListener,FileSelectorListener,TransportControlListener
public class CpmPanel extends javax.swing.JPanel implements java.awt.event.ActionListener, FileSelectorListener, TabClosedListener, TransportControlListener
The Class CpmPanel.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classCpmPanel.ResetableMetaDataPanelMetaDataPanel used for Collection Reader & AE selection and configuration.(package private) classCpmPanel.StatusCallbackListenerImplThe 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
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JButtonaddAeButtonThe add ae button.private javax.swing.JButtonaddConsumerButtonThe add consumer button.private javax.swing.JFileChooseraeFileChooserThe ae file chooser.private javax.swing.JPanelaeMainPanelThe ae main panel.private java.util.VectoraeSpecifiersThe ae specifiers.private JTabbedPaneWithCloseIconsaeTabbedPaneThe ae tabbed pane.private javax.swing.border.TitledBorderaeTitledBorderThe ae titled border.private CasInitializerDescriptioncasInitializerDescThe cas initializer desc.private FileSelectorcasInitializerFileSelectorThe cas initializer file selector.private longcasInitializerLastFileSyncTimestampThe cas initializer last file sync timestamp.private CpmPanel.ResetableMetaDataPanelcasInitializerPanelThe cas initializer panel.private javax.swing.border.TitledBordercasInitializerTitledBorderThe cas initializer titled border.private javax.swing.JMenuItemclearAllMenuItemThe clear all menu item.private CollectionReaderDescriptioncollectionReaderDescThe collection reader desc.private longcollectionReaderLastFileSyncTimestampThe collection reader last file sync timestamp.private CpmPanel.ResetableMetaDataPanelcollectionReaderPanelThe collection reader panel.private javax.swing.border.TitledBordercollectionReaderTitledBorderThe collection reader titled border.private javax.swing.JFileChooserconsumerFileChooserThe consumer file chooser.private javax.swing.JPanelconsumersPanelThe consumers panel.private java.util.VectorconsumerSpecifiersThe consumer specifiers.private JTabbedPaneWithCloseIconsconsumerTabbedPaneThe consumer tabbed pane.private javax.swing.border.TitledBorderconsumerTitledBorderThe consumer titled border.private CpeDescriptioncurrentCpeDescThe current cpe desc.private ResourceManagerdefaultResourceManagerThe default resource manager.private intelapsedTimeThe elapsed time.private java.io.FilefileChooserRootDirThe file chooser root dir.static java.lang.StringHELP_MESSAGEThe Constant HELP_MESSAGE.private booleanindeterminateProgressPauseThe indeterminate progress pause.private longlastFileSyncUserPromptTimeThe last file sync user prompt time.private javax.swing.JSplitPanemainSplitPaneThe main split pane.private CollectionProcessingEnginemCPEThe m CPE.private javax.swing.JButtonmoveAeLeftButtonThe move ae left button.private javax.swing.JButtonmoveAeRightButtonThe move ae right button.private javax.swing.JButtonmoveConsumerLeftButtonThe move consumer left button.private javax.swing.JButtonmoveConsumerRightButtonThe move consumer right button.private booleanmPausedThe m paused.private booleanmShuttingDownThe m shutting down.private javax.swing.JMenuItemopenCpeDescMenuItemThe open cpe desc menu item.private javax.swing.JFileChooseropenSaveFileChooserThe open save file chooser.private javax.swing.TimerperformanceQueryTimerThe performance query timer.private java.util.prefs.PreferencesprefsStores user preferences.private static java.lang.StringPREFS_CPE_DESCRIPTOR_FILEThe Constant PREFS_CPE_DESCRIPTOR_FILE.private static java.lang.StringPREFS_SAVE_USING_IMPORTSThe Constant PREFS_SAVE_USING_IMPORTS.private javax.swing.JProgressBarprogressBarThe progress bar.private javax.swing.TimerprogressTimerThe progress timer.private FileSelectorreaderFileSelectorThe reader file selector.private javax.swing.JSplitPanereaderInitializerSplitPaneThe reader initializer split pane.private javax.swing.JMenuItemrefreshMenuItemThe refresh menu item.private javax.swing.JMenuItemsaveCpeDescMenuItemThe save cpe desc menu item.private javax.swing.JCheckBoxMenuItemsaveUsingImportMenuItemThe save using import menu item.private booleansaveUsingImportsThe save using imports.private booleanselectedComponentsChangedThe selected components changed.private static longserialVersionUIDThe Constant serialVersionUID.private javax.swing.AbstractButtonstartButtonThe start button.private javax.swing.JLabelstatusLabelThe status label.private javax.swing.AbstractButtonstopButtonThe stop button.private TransportControlPaneltransportControlPanelThe transport control panel.private javax.swing.JMenuItemviewCasInitializerPanelMenuItemThe view cas initializer panel menu item.-
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
-
-
Constructor Summary
Constructors Constructor Description CpmPanel()Instantiates a new cpm panel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent ev)private voidaddAE(java.lang.String aeSpecifierFile)Adds the AE.private booleanaddAE(CpeCasProcessor cpeCasProc)Adds the AE.private voidaddConsumer(java.lang.String consumerSpecifierFile)Adds the consumer.private booleanaddConsumer(CpeCasProcessor cpeCasProc)Adds the consumer.voidcheckForOutOfSyncFiles()Check for out of sync files.private voidclearAll()Resets the GUI to an empty state.private voidclearDirty()Marks all fields as not dirty.booleanconfirmExit()Ask user to confirm exist.voidcontrolPaused()Control paused.voidcontrolResumed()Control resumed.voidcontrolStarted()Control started.voidcontrolStopped()Control stopped.private CpeDescriptioncreateEmptyCpeDescription()Creates the empty cpe description.java.util.ListcreateFileMenuItems()Creates JMenuItems that should be added to the File menu.private voidcreateParameterOverrides(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.ListcreateViewMenuItems()Creates JMenuItems that should be added to the View menu.voiddisplayError(java.lang.String aErrorString)Displays an error message to the user.voiddisplayError(java.lang.Throwable aThrowable)Displays an error message to the user.private voiddisplayProgress()Display progress.private voiddoSaveCpeDescriptor(java.io.File aFile)Do save cpe descriptor.booleanfileSelected(javax.swing.JComponent source, java.lang.String fileString)File selected.private java.awt.FramegetParentFrame()Gets the parent frame.private voidinitFileChoosers()Initialize the file choosers.private booleanisCasConsumerSpecifier(ResourceSpecifier specifier)Checks if is cas consumer specifier.private booleanisDirty()Returns whether the GUI is dirty; that is, whether configuration settings have been modified since the last save.private java.lang.StringmakeUniqueCasProcessorName(java.lang.String baseName)Make unique cas processor name.voidonCompletion()On completion.private voidopenCpeDescriptor(java.io.File aFile)Open cpe descriptor.private booleanpopulateCasInitializerPanel(CpeCollectionReaderCasInitializer cpeCasIni)Populate cas initializer panel.private booleanpopulateCollectionReaderPanel(CpeCollectionReaderIterator cpeColRdr)Populate collection reader panel.voidprintStats()Prints the stats.private voidreadPreferences()Read preferences.voidrefreshOutOfSyncFiles()Refresh out of sync files.private voidremoveAllAEsAndConsumers()Removes the all A es and consumers.private voidresetScreen()Reset screen.private voidsaveCpeDescriptor()Prompt user for file to save CPE Descriptor to, and do the save.private voidsetCasInitializerPanelVisible(boolean visible)Sets the cas initializer panel visible.private voidsetFrameEnabled(boolean onOff)Called to lock the GUI while processing is occurring.private voidsetSaveUsingImports(boolean b)Sets the save using imports.private voidstartProcessing()Start processing.voidtabClosed(JTabbedPaneWithCloseIcons source, int tabPos)Tab closed.private voidupdateCpeDescriptionParameterOverrides()Updates the configuration parameter settings in this.currentCpeDesc to match the current state of the GUI.private voidupdateImport(CpeComponentDescriptor descriptor, java.io.File cpeDescSaveFile)Update import.private voidupdateImports(java.io.File cpeDescSaveFile)Update imports.private java.io.FileurlToFile(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
-
-
-
-
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.
-
collectionReaderPanel
private CpmPanel.ResetableMetaDataPanel collectionReaderPanel
The collection reader panel.
-
collectionReaderTitledBorder
private javax.swing.border.TitledBorder collectionReaderTitledBorder
The collection reader titled border.
-
casInitializerPanel
private CpmPanel.ResetableMetaDataPanel casInitializerPanel
The cas initializer panel.
-
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.
-
aeTabbedPane
private JTabbedPaneWithCloseIcons aeTabbedPane
The ae tabbed pane.
-
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.
-
consumerTabbedPane
private JTabbedPaneWithCloseIcons consumerTabbedPane
The consumer tabbed pane.
-
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.
-
collectionReaderDesc
private CollectionReaderDescription collectionReaderDesc
The collection reader desc.
-
casInitializerDesc
private CasInitializerDescription casInitializerDesc
The cas initializer desc.
-
mCPE
private CollectionProcessingEngine mCPE
The m CPE.
-
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.
-
-
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.ExceptionUpdates 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 modifiedaPanel- 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:
actionPerformedin interfacejava.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.ExceptionDo 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.ExceptionUpdate 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 descriptorcpeDescSaveFile- the cpe desc save file- Throws:
java.lang.Exception- the exception
-
urlToFile
private java.io.File urlToFile(java.net.URL url) throws java.net.URISyntaxExceptionUtility 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.
-
populateCollectionReaderPanel
private boolean populateCollectionReaderPanel(CpeCollectionReaderIterator cpeColRdr) throws InvalidXMLException, java.io.IOException, ResourceConfigurationException
Populate collection reader panel.- Parameters:
cpeColRdr- the cpe col rdr- Returns:
- true, if successful
- Throws:
InvalidXMLException- the invalid XML exceptionjava.io.IOException- Signals that an I/O exception has occurred.ResourceConfigurationException- the resource configuration exception
-
populateCasInitializerPanel
private boolean populateCasInitializerPanel(CpeCollectionReaderCasInitializer cpeCasIni) throws InvalidXMLException, java.io.IOException, ResourceConfigurationException
Populate cas initializer panel.- Parameters:
cpeCasIni- the cpe cas ini- Returns:
- true, if successful
- Throws:
InvalidXMLException- the invalid XML exceptionjava.io.IOException- Signals that an I/O exception has occurred.ResourceConfigurationException- the resource configuration exception
-
addAE
private void addAE(java.lang.String aeSpecifierFile) throws CpeDescriptorException, InvalidXMLException, java.io.IOException, ResourceConfigurationExceptionAdds the AE.- Parameters:
aeSpecifierFile- the ae specifier file- Throws:
CpeDescriptorException- the cpe descriptor exceptionInvalidXMLException- the invalid XML exceptionjava.io.IOException- Signals that an I/O exception has occurred.ResourceConfigurationException- the resource configuration exception
-
addAE
private boolean addAE(CpeCasProcessor cpeCasProc) throws CpeDescriptorException, InvalidXMLException, java.io.IOException, ResourceConfigurationException
Adds the AE.- Parameters:
cpeCasProc- the cpe cas proc- Returns:
- true, if successful
- Throws:
CpeDescriptorException- the cpe descriptor exceptionInvalidXMLException- the invalid XML exceptionjava.io.IOException- Signals that an I/O exception has occurred.ResourceConfigurationException- the resource configuration exception
-
addConsumer
private void addConsumer(java.lang.String consumerSpecifierFile) throws CpeDescriptorException, InvalidXMLException, java.io.IOException, ResourceConfigurationExceptionAdds the consumer.- Parameters:
consumerSpecifierFile- the consumer specifier file- Throws:
CpeDescriptorException- the cpe descriptor exceptionInvalidXMLException- the invalid XML exceptionjava.io.IOException- Signals that an I/O exception has occurred.ResourceConfigurationException- the resource configuration exception
-
addConsumer
private boolean addConsumer(CpeCasProcessor cpeCasProc) throws CpeDescriptorException, InvalidXMLException, java.io.IOException, ResourceConfigurationException
Adds the consumer.- Parameters:
cpeCasProc- the cpe cas proc- Returns:
- true, if successful
- Throws:
CpeDescriptorException- the cpe descriptor exceptionInvalidXMLException- the invalid XML exceptionjava.io.IOException- Signals that an I/O exception has occurred.ResourceConfigurationException- the resource configuration exception
-
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:FileSelectorListenerFile selected.- Specified by:
fileSelectedin interfaceFileSelectorListener- Parameters:
source- the sourcefileString- the file string- Returns:
- true, if successful
-
tabClosed
public void tabClosed(JTabbedPaneWithCloseIcons source, int tabPos)
Description copied from interface:TabClosedListenerTab closed.- Specified by:
tabClosedin interfaceTabClosedListener- Parameters:
source- the JTabbedPaneWithCloseIcons control sending this eventtabPos- position of the tab that was closed
-
controlStarted
public void controlStarted()
Description copied from interface:TransportControlListenerControl started.- Specified by:
controlStartedin interfaceTransportControlListener
-
controlPaused
public void controlPaused()
Description copied from interface:TransportControlListenerControl paused.- Specified by:
controlPausedin interfaceTransportControlListener
-
controlResumed
public void controlResumed()
Description copied from interface:TransportControlListenerControl resumed.- Specified by:
controlResumedin interfaceTransportControlListener
-
controlStopped
public void controlStopped()
Description copied from interface:TransportControlListenerControl stopped.- Specified by:
controlStoppedin interfaceTransportControlListener
-
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
-
openCpeDescriptor
private void openCpeDescriptor(java.io.File aFile) throws InvalidXMLException, java.io.IOException, CpeDescriptorException, ResourceConfigurationExceptionOpen cpe descriptor.- Parameters:
aFile- the a file- Throws:
InvalidXMLException- the invalid XML exceptionjava.io.IOException- Signals that an I/O exception has occurred.CpeDescriptorException- the cpe descriptor exceptionResourceConfigurationException- the resource configuration exception
-
isCasConsumerSpecifier
private boolean isCasConsumerSpecifier(ResourceSpecifier specifier)
Checks if is cas consumer specifier.- Parameters:
specifier- the specifier- Returns:
- true, if is cas consumer specifier
-
-