Class SimpleEditorPanel

All Implemented Interfaces:
IExtendable, ImageObserver, MenuContainer, Serializable, Accessible

public class SimpleEditorPanel extends JPanel implements IExtendable
See Also:
  • Constructor Details

    • SimpleEditorPanel

      public SimpleEditorPanel(Project project, OpGraphLibrary library, EditorModelInstantiator modelInstantiator, ca.phon.opgraph.library.instantiators.Instantiator<ca.phon.opgraph.nodes.general.MacroNode> nodeInstantiator, BiFunction<QueryScript,ca.phon.opgraph.OpGraph,ca.phon.opgraph.nodes.general.MacroNode> queryNodeInstantiator, BiFunction<ca.phon.opgraph.OpGraph,Project,Runnable> runFactory)
      Constructor
      Parameters:
      project - if null project graphs will not be displayed
      library - library display in add item dialog
      modelInstantiator - the editor model instantiator
      nodeInstantiator - instantiator for nodes created by adding documents from the library
      queryNodeInstantiator - instantiator for nodes created by adding queries to the doucment
      runFactory - factory for runnables used to execute graphs
    • SimpleEditorPanel

      public SimpleEditorPanel(Project project, OpGraphLibrary library, ca.phon.opgraph.OpGraph graph, EditorModelInstantiator modelInstantiator, ca.phon.opgraph.library.instantiators.Instantiator<ca.phon.opgraph.nodes.general.MacroNode> nodeInstantiator, BiFunction<QueryScript,ca.phon.opgraph.OpGraph,ca.phon.opgraph.nodes.general.MacroNode> queryNodeInstantiator, BiFunction<ca.phon.opgraph.OpGraph,Project,Runnable> runFactory)
      Constructor
      Parameters:
      project - if null project graphs will not be displayed
      library - library display in add item dialog
      graph -
      modelInstantiator - the editor model instantiator
      nodeInstantiator - instantiator for nodes created by adding documents from the library
      queryNodeInstantiator - instantiator for nodes created by adding queries to the doucment
      runFactory - factory for runnables used to execute graphs
  • Method Details

    • getModel

      public OpgraphEditorModel getModel()
    • getMacroNodes

      public List<ca.phon.opgraph.nodes.general.MacroNode> getMacroNodes()
    • getGraph

      public ca.phon.opgraph.OpGraph getGraph()
    • getProject

      public Project getProject()
    • getRunButton

      public JButton getRunButton()
    • getToolbar

      public JToolBar getToolbar()
    • getDocumentsPanel

      public TitledPanel getDocumentsPanel()
    • getListPanel

      public TitledPanel getListPanel()
    • getListTopPanel

      public JPanel getListTopPanel()
    • getSettingsPanel

      public TitledPanel getSettingsPanel()
    • addSelectedDocuments

      public void addSelectedDocuments(JTree tree)
    • addSelectedDocuments

      public void addSelectedDocuments(JTree tree, int idx)
    • addGraph

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

      public void addGraph(ca.phon.opgraph.OpGraph graph, int idx)
    • addNode

      public void addNode(ca.phon.opgraph.nodes.general.MacroNode node, int idx)
    • addQuery

      public ca.phon.opgraph.nodes.general.MacroNode addQuery(QueryScript queryScript)
    • addQuery

      public ca.phon.opgraph.nodes.general.MacroNode addQuery(QueryScript queryScript, ca.phon.opgraph.OpGraph reportGraph)
    • addQuery

      public ca.phon.opgraph.nodes.general.MacroNode addQuery(QueryScript queryScript, ca.phon.opgraph.OpGraph reportGraph, int idx)
    • addDocument

      public void addDocument(File file) throws IOException
      Throws:
      IOException
    • addDocument

      public void addDocument(File file, int idx) throws IOException
      Throws:
      IOException
    • addDocument

      public void addDocument(URL documentURL)
    • addDocument

      public void addDocument(URL documentURL, int idx)
    • onRemove

      public void onRemove()
    • onRename

      public void onRename()
    • onMoveUp

      public void onMoveUp()
    • onMoveDown

      public void onMoveDown()
    • onDuplicate

      public void onDuplicate()
    • onShowSettings

      public void onShowSettings()
    • onRun

      public void onRun()
    • onOpenInComposer

      public void onOpenInComposer()
    • onAppend

      public void onAppend()
    • onBrowse

      public void onBrowse()
    • isIncludeQueries

      public boolean isIncludeQueries()
    • setIncludeQueries

      public void setIncludeQueries(boolean includeQueries)
    • onShowList

      public void onShowList()
    • showDocumentSettings

      public void showDocumentSettings(ca.phon.opgraph.nodes.general.MacroNode documentNode)
    • onCloseSettings

      public void onCloseSettings(JDialog dialog)
    • getCurrentFile

      public File getCurrentFile()
    • isModified

      public boolean isModified()
    • setModified

      public void setModified(boolean modified)
    • setCurrentFile

      public void setCurrentFile(File source)
    • chooseFile

      public boolean chooseFile(String initialFolder)
    • saveInFolder

      public void saveInFolder(PhonActionEvent<String> pae)
    • setupSaveMenu

      protected void setupSaveMenu(JPopupMenu menu)
    • saveData

      public boolean saveData() throws IOException
      Throws:
      IOException
    • updateTreeModel

      public void updateTreeModel()
    • addDocumentErrorListener

      public void addDocumentErrorListener(Consumer<SimpleEditorPanel.DocumentError> listener)
    • removeDocumentErrorListener

      public void removeDocumentErrorListener(Consumer<SimpleEditorPanel.DocumentError> listener)
    • getDocumentErrorListeners

      public List<Consumer<SimpleEditorPanel.DocumentError>> getDocumentErrorListeners()
    • fireDocumentError

      public void fireDocumentError(Object document, IOException exception)
    • getExtensions

      public Set<Class<?>> getExtensions()
      Description copied from interface: IExtendable
      Return all extension types supported
      Specified by:
      getExtensions in interface IExtendable
    • getExtension

      public <T> T getExtension(Class<T> cap)
      Description copied from interface: IExtendable
      Get the requested extension if available.
      Specified by:
      getExtension in interface IExtendable
      Returns:
      the capability object or null if the cability is not available
    • putExtension

      public <T> T putExtension(Class<T> cap, T impl)
      Description copied from interface: IExtendable
      Add a new extension.
      Specified by:
      putExtension in interface IExtendable
      Parameters:
      cap - the extension to add
      Returns:
      the added extension implementation
    • removeExtension

      public <T> T removeExtension(Class<T> cap)
      Description copied from interface: IExtendable
      Remove a capability.
      Specified by:
      removeExtension in interface IExtendable
      Parameters:
      cap - the capability to remove