Class NodeWizard

All Implemented Interfaces:
IExtendable, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
AnalysisWizard, ITRWizard, QueryAndReportWizard, ReportWizard, SessionCheckWizard

public class NodeWizard extends BreadcrumbWizardFrame
The Node wizard servers as the UI layer for opgraph analysis and reports. It provides the following steps by default: The wizard also provides a panel for buffer storage - used during opgraph execution for report data. Finally, any reports defined in the 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:
  • Field Details

    • reportTitledPanel

      protected TitledPanel reportTitledPanel
    • reportDataStep

      protected WizardStep reportDataStep
    • reportTreeDockingPanel

      protected ReportTreeDockingPanel reportTreeDockingPanel
    • reportTreeViewToolbar

      protected JToolBar reportTreeViewToolbar
    • autoGenHTMLBox

      protected JCheckBox autoGenHTMLBox
    • optionalsStep

      protected WizardStep optionalsStep
    • globalOptionsPanel

      protected OverrideParameterPanel globalOptionsPanel
    • CASE_SENSITIVE_GLOBAL_OPTION

      public static final String CASE_SENSITIVE_GLOBAL_OPTION
    • INVENTORY_GROUPING_GLOBAL_OPTION

      public static final String INVENTORY_GROUPING_GLOBAL_OPTION
    • IGNORE_DIACRITICS_GLOBAL_OPTION

      public static final String IGNORE_DIACRITICS_GLOBAL_OPTION
    • ONLYOREXCEPT_GLOBAL_OPTION

      public static final String ONLYOREXCEPT_GLOBAL_OPTION
    • SELECTED_DIACRITICS_GLOBAL_OPTION

      public static final String SELECTED_DIACRITICS_GLOBAL_OPTION
    • overridesButton

      protected DropDownButton overridesButton
    • inInit

      protected boolean inInit
    • btnStop

      protected ca.phon.ui.jbreadcrumb.BreadcrumbButton btnStop
    • btnRunAgain

      protected ca.phon.ui.jbreadcrumb.BreadcrumbButton btnRunAgain
  • Constructor Details

    • NodeWizard

      public NodeWizard(String title)
    • NodeWizard

      public NodeWizard(String title, ca.phon.opgraph.Processor processor, ca.phon.opgraph.OpGraph graph)
  • Method Details

    • loadGraph

      public void loadGraph(ca.phon.opgraph.OpGraph graph)
    • loadGraph

      public void loadGraph(URL graphURL) throws IOException
      Throws:
      IOException
    • setJMenuBar

      public void setJMenuBar(JMenuBar menuBar)
      Overrides:
      setJMenuBar in class JFrame
    • onPrintReport

      public void onPrintReport()
    • onZoomIn

      public void onZoomIn()
    • onZoomOut

      public void onZoomOut()
    • onZoomReset

      public void onZoomReset()
    • gotoReportSection

      public void gotoReportSection(String htmlId)
    • onStop

      public void onStop()
    • close

      public void close()
      Overrides:
      close in class CommonModuleFrame
    • getCurrentReportTree

      public Optional<ReportTree> 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 class BreadcrumbWizardFrame
    • getNoun

      public Tuple<String,String> getNoun()
      Return the noun associated with the type of graph executed in the wizard. The first element of the Tuple 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

      public MultiBufferPanel 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

      public WizardExtension 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.ProcessingException
      Executes 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

      public File generateHTMLReport(ReportTree reportTree) throws NodeWizardReportException, IOException
      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

      protected void loadHTMLReport(File reportFile)
    • createReportGenerator

      protected NodeWizardReportGenerator createReportGenerator(ReportTree reportTree, String reportTemplate, OutputStream fout)
    • loadDefaultReport

      public String loadDefaultReport()
    • setupReportContext

      public void setupReportContext(NodeWizardReportContext ctx)
      Setup report context variables for velocity graph, buffers, etc.
      Parameters:
      ctx -
    • searchForTables

      public void searchForTables(ReportTreeNode node, Map<String,DefaultTableDataSource> tableMap)
    • getOptionalsTree

      public WizardOptionalsCheckboxTree 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

      protected WizardStep createStep(WizardExtension ext, ca.phon.opgraph.OpNode node)
    • createIntroStep

      protected WizardStep createIntroStep(String title, String message)
    • createOptionalsStep

      protected WizardStep createOptionalsStep()
    • createReportStep

      protected WizardStep 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

      protected JToolBar setupReportTreeViewToolbar()
    • setupExportTablesMenu

      public void setupExportTablesMenu(MenuBuilder builder)
    • getReportTreeContentView

      protected JComponent getReportTreeContentView(ReportTreeNode node)
    • gotoStep

      public void gotoStep(int step)
      Overrides:
      gotoStep in class BreadcrumbWizardFrame
    • gotoReport

      public void gotoReport()
    • next

      protected void next()
      Overrides:
      next in class WizardFrame
    • cancel

      protected void cancel()
      Overrides:
      cancel in class WizardFrame