Package hec.script

Class AbstractScriptEditor

All Implemented Interfaces:
hec.event.ConfigChangeListener, ScriptConstants, ClipboardOwner, ComponentListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, rma.lang.Modifiable

public abstract class AbstractScriptEditor extends rma.swing.RmaJFrame implements ScriptConstants, hec.event.ConfigChangeListener, ClipboardOwner
See Also:
  • Field Details

    • _iconList

      protected static Vector _iconList
    • NO_ICON

      protected static final String NO_ICON
      See Also:
    • FONT_PROP

      protected static final String FONT_PROP
      See Also:
    • BACKGROUND_PROP

      protected static final String BACKGROUND_PROP
      See Also:
    • FOREGROUND_PROP

      protected static final String FOREGROUND_PROP
      See Also:
    • SIZE_PROP

      protected static final String SIZE_PROP
      See Also:
    • LOCATION_PROP

      protected static final String LOCATION_PROP
      See Also:
    • TABSIZE_PROP

      protected static final String TABSIZE_PROP
      See Also:
    • _lnPanel

      protected LineNumberPanel _lnPanel
    • tree

      protected JTree tree
    • _scriptNameText

      protected rma.swing.RmaJTextField _scriptNameText
    • _fileNameText

      protected rma.swing.RmaJTextField _fileNameText
    • _argumentText

      protected rma.swing.RmaJTextField _argumentText
    • _descriptionText

      protected rma.swing.RmaJTextArea _descriptionText
    • _scriptText

      protected AbstractScriptEditor.ScriptTextArea _scriptText
    • _hSplitter

      protected JSplitPane _hSplitter
    • _displayScript

      protected rma.swing.RmaJCheckBox _displayScript
    • _displayScriptInMenu

      protected rma.swing.RmaJCheckBox _displayScriptInMenu
    • _displayScriptInSelector

      protected rma.swing.RmaJCheckBox _displayScriptInSelector
    • _labelDisplayText

      protected rma.swing.RmaJTextField _labelDisplayText
    • _browseButton

      protected JButton _browseButton
    • _nodePopup

      protected JPopupMenu _nodePopup
    • _folderPopup

      protected JPopupMenu _folderPopup
    • _fileMenu

      protected JMenu _fileMenu
    • _newMenuItem

      protected JMenuItem _newMenuItem
    • _editMenuItem

      protected JMenuItem _editMenuItem
    • _importMenuItem

      protected JMenuItem _importMenuItem
    • _saveMenuItem

      protected JMenuItem _saveMenuItem
    • _saveAsMenuItem

      protected JMenuItem _saveAsMenuItem
    • _deleteMenuItem

      protected JMenuItem _deleteMenuItem
    • _testMenuItem

      protected JMenuItem _testMenuItem
    • _cutScriptMenuItem

      protected JMenuItem _cutScriptMenuItem
    • _copyScriptMenuItem

      protected JMenuItem _copyScriptMenuItem
    • _pasteScriptMenuItem

      protected JMenuItem _pasteScriptMenuItem
    • _findMenuItem

      protected JMenuItem _findMenuItem
    • _findNextMenuItem

      protected JMenuItem _findNextMenuItem
    • _treeSelectListener

      protected TreeSelectionListener _treeSelectListener
    • _statusLine

      protected rma.swing.RmaJTextField _statusLine
    • _modifiedField

      protected rma.swing.RmaJTextField _modifiedField
    • _lockedField

      protected rma.swing.RmaJTextField _lockedField
    • _insertField

      protected rma.swing.RmaJTextField _insertField
    • _positionField

      protected rma.swing.RmaJTextField _positionField
    • _iconCombo

      protected rma.swing.RmaJComboBox _iconCombo
    • _buttonPanel

      protected JPanel _buttonPanel
    • _testPanel

      protected rma.swing.ButtonCmdPanel _testPanel
    • _okPanel

      protected rma.swing.ButtonCmdPanel _okPanel
    • _editButton

      protected JButton _editButton
    • _editExternalButton

      protected JButton _editExternalButton
    • _saveButton

      protected JButton _saveButton
    • _testButton

      protected JButton _testButton
    • _findDlg

      protected rma.swing.FindDialog _findDlg
    • _editingExistingScript

      protected boolean _editingExistingScript
    • _editScript

      protected boolean _editScript
    • _resetingPath

      protected boolean _resetingPath
    • _lockedPath

      protected String _lockedPath
    • _scriptModified

      protected boolean _scriptModified
    • _splitterLocation

      protected int _splitterLocation
    • _overrodeScriptFile

      protected boolean _overrodeScriptFile
    • _listenerList

      protected EventListenerList _listenerList
    • _namePanel

      protected JPanel _namePanel
    • _bgColorBtn

      protected rma.swing.RmaJColorButton _bgColorBtn
    • _groupCombo

      protected rma.swing.RmaJComboBox _groupCombo
    • _groupLabel

      protected JLabel _groupLabel
  • 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 rma.swing.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 rma.swing.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(hec.event.ConfigFileChangeEvent event)
      a config file changed.
      Specified by:
      configFileChanged in interface hec.event.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 rma.lang.Modifiable
      Overrides:
      setModified in class rma.swing.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(hec.event.ScriptEventListener listener)
    • removeScriptEventListener

      public void removeScriptEventListener(hec.event.ScriptEventListener listener)
    • lostOwnership

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