Package hec.script

Class AbstractScriptEditor

All Implemented Interfaces:
ConfigChangeListener, ScriptConstants, ClipboardOwner, ComponentListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, Modifiable

public abstract class AbstractScriptEditor extends RmaJFrame implements ScriptConstants, ConfigChangeListener, ClipboardOwner
See Also:
  • Field Details

  • Constructor Details

    • AbstractScriptEditor

      public AbstractScriptEditor(Frame parent, boolean modal)
      constructor
  • Method Details

    • createJTree

      protected JTree createJTree()
    • buildDialog

      protected void buildDialog(Frame parent)
    • redrawLineNumbers

      protected void redrawLineNumbers()
    • getSelectionMarginColor

      protected static Color getSelectionMarginColor()
    • flushScriptManager

      public void flushScriptManager()
    • buildMenus

      protected void buildMenus()
      build the menus for this dialog
    • removeScriptsFromGroup

      protected void removeScriptsFromGroup(ScriptGroup group2Delete)
      remove the group setting from all the scripts
      Parameters:
      group2Delete -
    • showWhiteSpaceAction

      protected void showWhiteSpaceAction()
    • editScript

      protected void editScript(TreePath path)
      edit the currently highlighted script
    • launchExternalEditor

      protected void launchExternalEditor(TreePath path)
    • launchAndWait

      protected boolean launchAndWait(ScriptIdentifier sid)
    • newScript

      protected boolean newScript()
      clear form for new script
    • getLastFolderNode

      protected TreeNode getLastFolderNode()
    • getSelectedScriptIdentifier

      protected ScriptIdentifier getSelectedScriptIdentifier()
      returns the selected ScriptIdentifier
      Returns:
      the selected ScriptIdentifier
    • getSelectedScriptIdentifier

      protected ScriptIdentifier getSelectedScriptIdentifier(TreePath tpath)
      return the ScriptIdentifier to the last folder in the TreePath path
    • getModulePath

      protected String getModulePath()
      return the path to the last folder in the selected path
    • getModulePath

      protected String getModulePath(TreePath tpath)
      return the path to the last folder in the TreePath path
    • getScriptId

      protected String getScriptId(TreePath tpath)
      return the Id that can be used to identify the object that the script belongs to
    • saveScript

      protected void saveScript()
    • saveScriptAs

      protected void saveScriptAs()
    • buildScript

      protected Script buildScript(int[] headLines)
    • deleteScript

      protected void deleteScript(boolean confirm)
    • closeFrame

      protected void closeFrame()
      called when the window closes.
    • fillFolderNodes

      protected abstract void fillFolderNodes()
    • addScriptableObjects

      protected void addScriptableObjects(AbstractScriptEditor.FolderNode parentNode, ScriptableObject so)
      recusively add scriptable objects
    • updateFileName

      protected void updateFileName()
    • getFileName

      protected abstract String getFileName(String name)
    • clearForm

      public void clearForm()
      clear out the right panels
      Overrides:
      clearForm in class RmaJFrame
    • getScriptIds

      protected void getScriptIds(TreePath path)
    • getScriptIds

      protected void getScriptIds(String pathStr, DefaultMutableTreeNode folderNode)
    • fillGroupCombo

      protected void fillGroupCombo()
    • loadScript

      protected void loadScript(TreePath path)
    • setSelectedNode

      public void setSelectedNode(String nodeName, String underNodeName)
      set the tree to display the String node
    • setSelectedNode

      public void setSelectedNode(ScriptIdentifier sid)
      set the tree to display the ScriptIdentifier node
    • setVisible

      public void setVisible(boolean b)
      Overrides:
      setVisible in class RmaJFrame
    • finalize

      public void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • getScriptManager

      protected abstract ScriptManager getScriptManager()
    • isScriptableNode

      protected boolean isScriptableNode(String nodeName)
    • setEditPanelEnabled

      protected void setEditPanelEnabled(boolean b)
    • treePathSelected

      protected void treePathSelected(TreePath path, TreePath oldPath, boolean enable)
    • setEditScript

      protected boolean setEditScript(boolean edit)
    • lockScriptFile

      protected abstract boolean lockScriptFile(boolean lock, String path)
    • expandTree

      protected void expandTree(boolean expand)
    • configFileChanged

      public void configFileChanged(ConfigFileChangeEvent event)
      a config file changed.
      Specified by:
      configFileChanged in interface ConfigChangeListener
    • refreshTree

      public void refreshTree()
    • cutTreeNode

      protected void cutTreeNode()
    • copyTreeNode

      protected boolean copyTreeNode()
    • pasteTreeNode

      protected void pasteTreeNode()
    • msgOut

      protected void msgOut(String msg)
    • getScriptToPaste

      protected ScriptIdentifierData getScriptToPaste()
    • displayFolderPopup

      protected void displayFolderPopup(MouseEvent e, String name)
      display the popup for a folder
    • displayNodePopup

      protected void displayNodePopup(MouseEvent e, String name)
      display the popup menu for script nodes
    • importScript

      public abstract void importScript()
      import a script
    • setMenusState

      protected void setMenusState(boolean isFolder)
    • selectScript

      protected abstract void selectScript(TreePath path)
      allow the user to select a script
    • selectForeground

      protected void selectForeground()
    • selectBackground

      protected void selectBackground()
    • selectFont

      protected void selectFont()
    • setTabSize

      protected void setTabSize()
    • saveForegroundColor

      protected abstract void saveForegroundColor(String color)
    • saveBackgroundColor

      protected abstract void saveBackgroundColor(String color)
    • saveFont

      protected abstract void saveFont(String font)
    • saveTabSize

      protected abstract void saveTabSize(int tabsize)
    • saveSizeAndLocation

      protected abstract void saveSizeAndLocation()
    • printScript

      public void printScript()
    • testScript

      public void testScript()
    • runScript

      public boolean runScript(ScriptIdentifier id)
    • setModified

      public void setModified(boolean modified)
      Specified by:
      setModified in interface Modifiable
      Overrides:
      setModified in class RmaJFrame
    • createImageList

      protected Vector createImageList()
    • fireScriptAdded

      protected void fireScriptAdded(ScriptIdentifier sid)
    • fireScriptDeleted

      protected void fireScriptDeleted(ScriptIdentifier sid)
    • fireScriptChanged

      protected void fireScriptChanged(ScriptIdentifier sid)
    • fireScriptEvent

      protected void fireScriptEvent(ScriptIdentifier sid, int eventType)
    • addScriptEventListener

      public void addScriptEventListener(ScriptEventListener listener)
    • removeScriptEventListener

      public void removeScriptEventListener(ScriptEventListener listener)
    • lostOwnership

      public void lostOwnership(Clipboard clipboard, Transferable contents)
      Specified by:
      lostOwnership in interface ClipboardOwner