Package ca.phon.app.opgraph.wizard
Class NodeWizard
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
ca.phon.ui.CommonModuleFrame
ca.phon.ui.wizard.WizardFrame
ca.phon.ui.wizard.BreadcrumbWizardFrame
ca.phon.app.opgraph.wizard.NodeWizard
- All Implemented Interfaces:
IExtendable
,ImageObserver
,MenuContainer
,Serializable
,Accessible
,RootPaneContainer
,WindowConstants
- Direct Known Subclasses:
AnalysisWizard
,ITRWizard
,QueryAndReportWizard
,ReportWizard
,SessionCheckWizard
The Node wizard servers as the UI layer for opgraph
analysis and reports. It provides the following steps
by default:
- Introduction (if supplied in the
WizardExtension
) - Optional Nodes (if any are defined in the
WizardExtension
) - Settings for Nodes (if any are defined as 'required' in the
WizardExtension
) - Report data generation
- Report
WizardExtension
are displayed
during the last step of the wizard. Reports utilize data generated during the
report data step. Reports are written using Apache velocity syntax. Table data may be
accessed from the $tables
map variable, buffer text data may be
accessed from the $buffers
map varaible. The map keys are the names
of the buffers generated during the report data step.
Other variables available to the velocity context are:
$Class
- static access to java.lang.Class$FormatterUtil
- access to Phon object formatters$project
- the project$graph
- the opgraph used
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Modifier and TypeFieldDescriptionprotected JCheckBox
protected ca.phon.ui.jbreadcrumb.BreadcrumbButton
protected ca.phon.ui.jbreadcrumb.BreadcrumbButton
static final String
protected OverrideParameterPanel
static final String
protected boolean
static final String
static final String
protected WizardStep
protected DropDownButton
protected WizardStep
protected TitledPanel
protected ReportTreeDockingPanel
protected JToolBar
static final String
Fields inherited from class ca.phon.ui.wizard.BreadcrumbWizardFrame
breadcrumbScroller, breadCrumbViewer, nextButton
Fields inherited from class ca.phon.ui.wizard.WizardFrame
btnBack, btnCancel, btnFinish, btnNext, buttonPanel, stepPanel
Fields inherited from class ca.phon.ui.CommonModuleFrame
DEFAULT_MACOS_ENABLE_FULLSCREEN, MACOS_ENABLE_FULLSCREEN, title
Fields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
Constructor Summary
ConstructorDescriptionNodeWizard
(String title) NodeWizard
(String title, ca.phon.opgraph.Processor processor, ca.phon.opgraph.OpGraph graph) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
cancel()
void
close()
protected void
protected WizardStep
createIntroStep
(String title, String message) protected WizardStep
protected NodeWizardReportGenerator
createReportGenerator
(ReportTree reportTree, String reportTemplate, OutputStream fout) protected WizardStep
protected WizardStep
createStep
(WizardExtension ext, ca.phon.opgraph.OpNode node) void
Executes graph.protected void
Called when the processor endsprotected void
Called when the processors beginsprotected void
generateHTML
(ReportTree reportTree, OutputStream out) generateHTMLReport
(ReportTree reportTree) protected File
generateHTMLReport
(ReportTree reportTree, File reportFile) ca.phon.opgraph.OpGraph
getGraph()
getNoun()
Return the noun associated with the type of graph executed in the wizard.ca.phon.opgraph.Processor
protected JComponent
void
void
gotoReportSection
(String htmlId) void
gotoStep
(int step) protected boolean
void
loadGraph
(ca.phon.opgraph.OpGraph graph) void
protected void
loadHTMLReport
(File reportFile) protected void
This method is called during graph execution when a NewReport node is executed and a report tree is available.protected void
next()
void
void
onStop()
void
onZoomIn()
void
void
protected void
void
searchForTables
(ReportTreeNode node, Map<String, DefaultTableDataSource> tableMap) void
setJMenuBar
(JMenuBar menuBar) void
setProcessor
(ca.phon.opgraph.Processor processor) protected void
setupContext
(ca.phon.opgraph.OpContext ctx) void
setupExportTablesMenu
(MenuBuilder builder) protected void
setupGlobalOptions
(ca.phon.opgraph.OpContext ctx) protected void
setupOptionals
(ca.phon.opgraph.OpContext ctx) void
Setup report context variables for velocity graph, buffers, etc.protected JToolBar
protected void
void
void
Button state diagram:Methods inherited from class ca.phon.ui.wizard.BreadcrumbWizardFrame
removeAllSteps, removeWizardStep, setBounds
Methods inherited from class ca.phon.ui.wizard.WizardFrame
addListener, addWizardStep, addWizardStep, addWizardStep, finish, fireWizardEvent, getCurrentStep, getCurrentStepIndex, getStepIndex, getWizardStep, numberOfSteps, prev, removeListener, setupButtons, setVisible, showBusyLabel, showWizard, stopBusyLabel
Methods inherited from class ca.phon.ui.CommonModuleFrame
addNewWindowListener, cascadeWindow, centerWindow, display, getCurrentFrame, getExtension, getExtensions, getOpenWindows, getParentFrame, getProjectWindows, getTitle, getUnsavedChangesMessage, getUnsavedChangesTitle, getWindowName, hasUnsavedChanges, hideStatusComponent, isShowInWindowMenu, placeTopRight, positionRelativeTo, putExtension, removeExtension, resetStatusComponent, saveAndClose, saveData, setModified, setParentFrame, setShowInWindowMenu, setUnsavedChangesMessage, setUnsavedChangesTitle, setWindowName, showErrorMessage, showMessageDialog, showOkCancelDialog, showOkDialog, showStatusMessage, showYesNoCancelDialog, showYesNoDialog
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, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, 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 Details
-
reportTitledPanel
-
reportDataStep
-
reportTreeDockingPanel
-
reportTreeViewToolbar
-
autoGenHTMLBox
-
optionalsStep
-
globalOptionsPanel
-
CASE_SENSITIVE_GLOBAL_OPTION
-
INVENTORY_GROUPING_GLOBAL_OPTION
-
IGNORE_DIACRITICS_GLOBAL_OPTION
-
ONLYOREXCEPT_GLOBAL_OPTION
-
SELECTED_DIACRITICS_GLOBAL_OPTION
-
overridesButton
-
inInit
protected boolean inInit -
btnStop
protected ca.phon.ui.jbreadcrumb.BreadcrumbButton btnStop -
btnRunAgain
protected ca.phon.ui.jbreadcrumb.BreadcrumbButton btnRunAgain
-
-
Constructor Details
-
NodeWizard
-
NodeWizard
-
-
Method Details
-
loadGraph
public void loadGraph(ca.phon.opgraph.OpGraph graph) -
loadGraph
- Throws:
IOException
-
setJMenuBar
- Overrides:
setJMenuBar
in classJFrame
-
onPrintReport
public void onPrintReport() -
onZoomIn
public void onZoomIn() -
onZoomOut
public void onZoomOut() -
onZoomReset
public void onZoomReset() -
gotoReportSection
-
onStop
public void onStop() -
close
public void close()- Overrides:
close
in classCommonModuleFrame
-
getCurrentReportTree
-
setupWizardSteps
protected void setupWizardSteps() -
updateBreadcrumbButtons
public void updateBreadcrumbButtons()Button state diagram:+-----------------+ Yes +-------------+ Yes +----------------------+ | Is report step? +------->+ Is running? +------->+ Button State | +-------+---------+ +------+------+ +----------------------+ | | | | | | | btnStop: visible | | | | btnNext: hidden | | No | No | btnRunAgain: hidden | | | | | | | +----------------------+ v v +-------+--------------+ +------+-------+ Yes +----------------------+ | Button State | | Has report? +------>+ Button State | +----------------------+ +------+-------+ +----------------------+ | | | | | | btnStop: hidden | | | btnStop: visible | | btnNext: visible | | | btnNext: hidden | | btnRunAgain: hidden | | No | btnRunAgain: hidden | | | | | | +----------------------+ | +----------------------+ | v +------+---------------+ | Button State | +----------------------+ | | | btnStop: hidden | | btnNext: hidden | | btnRunAgain: visible | | | +----------------------+
- Overrides:
updateBreadcrumbButtons
in classBreadcrumbWizardFrame
-
getNoun
Return the noun associated with the type of graph executed in the wizard. The first element of theTuple
is the singleton version, while the second element is the plural. String should be returned as all lower case.- Returns:
- Tupleinvalid input: '<'String, String>
-
getBufferPanel
-
getGraph
public ca.phon.opgraph.OpGraph getGraph() -
getProcessor
public ca.phon.opgraph.Processor getProcessor() -
setProcessor
public void setProcessor(ca.phon.opgraph.Processor processor) -
getWizardExtension
-
executionStarted
protected void executionStarted()Called when the processors begins -
executionEnded
protected void executionEnded()Called when the processor ends -
stopExecution
public void stopExecution() -
executeGraph
public void executeGraph() throws ca.phon.opgraph.exceptions.ProcessingExceptionExecutes graph. During execution, data generated may be printed to buffers which are displayed during this stage. If there is a buffer named 'Report Template' at the end of execution, a HTML report is generated using the contents of 'Report Template' which should be a velocity template.- Throws:
ca.phon.opgraph.exceptions.ProcessingException
-
generateHTML
protected void generateHTML(ReportTree reportTree, OutputStream out) throws NodeWizardReportException - Throws:
NodeWizardReportException
-
generateHTMLReport
- Throws:
NodeWizardReportException
IOException
-
generateHTMLReport
protected File generateHTMLReport(ReportTree reportTree, File reportFile) throws NodeWizardReportException, IOException - Throws:
NodeWizardReportException
IOException
-
htmlReportAvailable
protected boolean htmlReportAvailable() -
closeHTMLReport
protected void closeHTMLReport() -
loadHTMLReport
-
createReportGenerator
protected NodeWizardReportGenerator createReportGenerator(ReportTree reportTree, String reportTemplate, OutputStream fout) -
loadDefaultReport
-
setupReportContext
Setup report context variables for velocity graph, buffers, etc.- Parameters:
ctx
-
-
searchForTables
-
getOptionalsTree
-
setupContext
protected void setupContext(ca.phon.opgraph.OpContext ctx) -
setupOptionals
protected void setupOptionals(ca.phon.opgraph.OpContext ctx) -
setupGlobalOptions
protected void setupGlobalOptions(ca.phon.opgraph.OpContext ctx) -
createStep
-
createIntroStep
-
createOptionalsStep
-
createReportStep
-
resetReportStep
protected void resetReportStep() -
loadReportTreeDockingPanel
protected void loadReportTreeDockingPanel()This method is called during graph execution when a NewReport node is executed and a report tree is available. The bufferPanel will be removed from the report panel and replaced with a tab view contaning both the report view and the bufferPanel. -
setupReportTreeViewToolbar
-
getReportTreeContentView
-
gotoStep
public void gotoStep(int step) - Overrides:
gotoStep
in classBreadcrumbWizardFrame
-
gotoReport
public void gotoReport() -
next
protected void next()- Overrides:
next
in classWizardFrame
-
cancel
protected void cancel()- Overrides:
cancel
in classWizardFrame
-