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 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
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JButton
addAeButton
The add ae button.private javax.swing.JButton
addConsumerButton
The add consumer button.private javax.swing.JFileChooser
aeFileChooser
The ae file chooser.private javax.swing.JPanel
aeMainPanel
The ae main panel.private java.util.Vector
aeSpecifiers
The ae specifiers.private JTabbedPaneWithCloseIcons
aeTabbedPane
The ae tabbed pane.private javax.swing.border.TitledBorder
aeTitledBorder
The ae titled border.private CasInitializerDescription
casInitializerDesc
The cas initializer desc.private FileSelector
casInitializerFileSelector
The cas initializer file selector.private long
casInitializerLastFileSyncTimestamp
The cas initializer last file sync timestamp.private CpmPanel.ResetableMetaDataPanel
casInitializerPanel
The cas initializer panel.private javax.swing.border.TitledBorder
casInitializerTitledBorder
The cas initializer titled border.private javax.swing.JMenuItem
clearAllMenuItem
The clear all menu item.private CollectionReaderDescription
collectionReaderDesc
The collection reader desc.private long
collectionReaderLastFileSyncTimestamp
The collection reader last file sync timestamp.private CpmPanel.ResetableMetaDataPanel
collectionReaderPanel
The collection reader panel.private javax.swing.border.TitledBorder
collectionReaderTitledBorder
The collection reader titled border.private javax.swing.JFileChooser
consumerFileChooser
The consumer file chooser.private javax.swing.JPanel
consumersPanel
The consumers panel.private java.util.Vector
consumerSpecifiers
The consumer specifiers.private JTabbedPaneWithCloseIcons
consumerTabbedPane
The consumer tabbed pane.private javax.swing.border.TitledBorder
consumerTitledBorder
The consumer titled border.private CpeDescription
currentCpeDesc
The current cpe desc.private ResourceManager
defaultResourceManager
The default resource manager.private int
elapsedTime
The elapsed time.private java.io.File
fileChooserRootDir
The file chooser root dir.static java.lang.String
HELP_MESSAGE
The Constant HELP_MESSAGE.private boolean
indeterminateProgressPause
The indeterminate progress pause.private long
lastFileSyncUserPromptTime
The last file sync user prompt time.private javax.swing.JSplitPane
mainSplitPane
The main split pane.private CollectionProcessingEngine
mCPE
The m CPE.private javax.swing.JButton
moveAeLeftButton
The move ae left button.private javax.swing.JButton
moveAeRightButton
The move ae right button.private javax.swing.JButton
moveConsumerLeftButton
The move consumer left button.private javax.swing.JButton
moveConsumerRightButton
The move consumer right button.private boolean
mPaused
The m paused.private boolean
mShuttingDown
The m shutting down.private javax.swing.JMenuItem
openCpeDescMenuItem
The open cpe desc menu item.private javax.swing.JFileChooser
openSaveFileChooser
The open save file chooser.private javax.swing.Timer
performanceQueryTimer
The performance query timer.private java.util.prefs.Preferences
prefs
Stores user preferences.private static java.lang.String
PREFS_CPE_DESCRIPTOR_FILE
The Constant PREFS_CPE_DESCRIPTOR_FILE.private static java.lang.String
PREFS_SAVE_USING_IMPORTS
The Constant PREFS_SAVE_USING_IMPORTS.private javax.swing.JProgressBar
progressBar
The progress bar.private javax.swing.Timer
progressTimer
The progress timer.private FileSelector
readerFileSelector
The reader file selector.private javax.swing.JSplitPane
readerInitializerSplitPane
The reader initializer split pane.private javax.swing.JMenuItem
refreshMenuItem
The refresh menu item.private javax.swing.JMenuItem
saveCpeDescMenuItem
The save cpe desc menu item.private javax.swing.JCheckBoxMenuItem
saveUsingImportMenuItem
The save using import menu item.private boolean
saveUsingImports
The save using imports.private boolean
selectedComponentsChanged
The selected components changed.private static long
serialVersionUID
The Constant serialVersionUID.private javax.swing.AbstractButton
startButton
The start button.private javax.swing.JLabel
statusLabel
The status label.private javax.swing.AbstractButton
stopButton
The stop button.private TransportControlPanel
transportControlPanel
The transport control panel.private javax.swing.JMenuItem
viewCasInitializerPanelMenuItem
The 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 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
-
-
-
-
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.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 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:
actionPerformed
in 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.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 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.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.
-
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, ResourceConfigurationException
Adds 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, ResourceConfigurationException
Adds 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:FileSelectorListener
File selected.- Specified by:
fileSelected
in interfaceFileSelectorListener
- Parameters:
source
- the sourcefileString
- the file string- Returns:
- true, if successful
-
tabClosed
public void tabClosed(JTabbedPaneWithCloseIcons source, int tabPos)
Description copied from interface:TabClosedListener
Tab closed.- Specified by:
tabClosed
in interfaceTabClosedListener
- Parameters:
source
- the JTabbedPaneWithCloseIcons control sending this eventtabPos
- position of the tab that was closed
-
controlStarted
public void controlStarted()
Description copied from interface:TransportControlListener
Control started.- Specified by:
controlStarted
in interfaceTransportControlListener
-
controlPaused
public void controlPaused()
Description copied from interface:TransportControlListener
Control paused.- Specified by:
controlPaused
in interfaceTransportControlListener
-
controlResumed
public void controlResumed()
Description copied from interface:TransportControlListener
Control resumed.- Specified by:
controlResumed
in interfaceTransportControlListener
-
controlStopped
public void controlStopped()
Description copied from interface:TransportControlListener
Control stopped.- Specified by:
controlStopped
in 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, ResourceConfigurationException
Open 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
-
-