ix.iview
Class DomainEditor

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--ix.iface.ui.JFrameMT
                                      |
                                      +--ix.iface.ui.JFrameMTP
                                            |
                                            +--ix.iview.DomainEditor
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, javax.swing.event.ChangeListener, DomainListener, java.util.EventListener, FrameSymbols, IDESymbols, java.awt.image.ImageObserver, InternalDomainEditor, java.awt.event.ItemListener, java.awt.MenuContainer, java.beans.PropertyChangeListener, javax.swing.RootPaneContainer, java.io.Serializable, UIDomainListener, javax.swing.WindowConstants

public class DomainEditor
extends JFrameMTP
implements javax.swing.event.ChangeListener, DomainListener, UIDomainListener, java.beans.PropertyChangeListener, InternalDomainEditor, IDESymbols

An editor/viewer frame for domain details. The editor can be created with a mandatory mode (true for simple, false for advanced) and an optional domain or an optional title. Most of the window buidling goes on in the ConstructFramePanels and their ConstructEditorPanels, except for the menubar and the toolbar.

Super-class JFrameMT defines useful menu/toolbar making things. Most of the action processing goes on in the ConstructFramePanels, except for domain specific things (read...) and window things (toggles).

Example for using DomainEditor:


   ...
   File modelDirectory = new File("domain-library");
   boolean isSimple = false;
   DomainEditor frame = new DomainEditor(isSimple);
   frame.setModelDirectory(modelDirectory);
   frame.setVisible(true);
   ...
 

See Also:
Serialized Form

Inner Class Summary
(package private)  class DomainEditor.IXWindow
           
 
Inner classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Inner classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
protected  ActionEditorPanel actionPanel
           
protected  javax.swing.ImageIcon advancedIcon
           
protected  IXToolItem advancedItem
           
protected  IXAgent agent
           
 IXToolItem[] allButtons
           
protected  AROEditorPanel aroPanel
           
protected  javax.swing.ImageIcon checkIcon
           
protected  IXToolItem checkItem
           
protected  IXToolItem clearItem
           
protected  javax.swing.ImageIcon comprehensiveIcon
           
protected  IXToolItem comprehensiveItem
           
protected  GlobalFramePanel domainPanel
           
protected  GrammarEditorPanel grammarPanel
           
protected  javax.swing.ImageIcon graphicalIcon
           
protected  IXToolItem graphicalItem
           
protected  HelpFrame helpFrame
           
 java.util.Properties ideProperties
           
protected  IXToolItem insertItem
           
protected  AConstructFramePanel lexiconPanel
           
protected  javax.swing.ImageIcon minimalIcon
           
protected  IXToolItem minimalItem
           
protected  java.io.File modelDirectory
           
protected  javax.swing.JMenu modeMenu
           
protected  javax.swing.ImageIcon modifyIcon
           
protected  IXToolItem modifyItem
           
protected  IXToolItem newEditItem
           
protected  OrderingEditor orderingEditor
           
protected  IXToolItem parallelItem
           
protected  JPreferencesDialog preferencesDialog
           
protected  IXToolItem preferencesItem
           
protected  Symbol preferredConstraints
           
protected  javax.swing.ImageIcon preferredIcon
           
protected  IXToolItem preferredItem
           
protected  IXToolItem propButtTextItem
           
protected  IXToolItem propEditableItem
           
protected  IXToolItem propListTextItem
           
protected  IXToolItem propModeItem
           
protected  IXToolItem propSaveItem
           
protected  javax.swing.ImageIcon publishIcon
           
protected  IXToolItem publishItem
           
protected  IXToolItem revertDItem
           
 IXToolItem revertItem
           
protected  javax.swing.ImageIcon revertOIcon
           
protected  IXToolItem revertOItem
           
protected  IXToolItem sequenceItem
           
protected  IXToolItem sequenceNewItem
           
protected  javax.swing.ImageIcon simpleIcon
           
protected  IXToolItem simpleItem
           
(package private)  javax.swing.JToolBar.Separator tbs
           
protected  AConstructFramePanel testPanel
           
 UIDomain uiDomain
          The current domain in the editor.
protected  javax.swing.JMenu viewsMenu
           
 
Fields inherited from class ix.iface.ui.JFrameMTP
cardsPanel, isAdjusting, styleMenu, tabbedPane, windowsMenu
 
Fields inherited from class ix.iface.ui.JFrameMT
aboutItem, closeItem, copyIcon, copyItem, cutIcon, cutItem, editMenu, exitItem, fileMenu, helpIcon, helpItem, helpMenu, JPanel2, mainJPanel, manualItem, menuBar, newIcon, newItem, openFileDialog, openIcon, openItem, optionsMenu, pasteIcon, pasteItem, revertIcon, saveAsItem, saveFileDialog, saveIcon, saveItem, TB_HEIGHT, TBB_HEIGHT, TBB_WIDTH, TBB_Y, toolBar, toolbarItem, toolsMenu, viewMenu
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, icon, ICONIFIED, mbManagement, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Window
inputContext, OPENED, ownedWindowList, state, warningString, windowListener
 
Fields inherited from class java.awt.Container
component, containerListener, layoutMgr, listeningBoundsChildren, listeningChildren, ncomponents
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface ix.iview.IDESymbols
C_ALL, C_CONDITIONS_ONLY, C_CONDITIONS_OTHER, C_NONE, C_ORDER_CONDITIONS, C_ORDER_ONLY, C_ORDER_OTHER, C_OTHER_ONLY, MODE_ADVANCED, MODE_SIMPLE, VIEW_COMPREHENSIVE, VIEW_GRAPHICAL, VIEW_MINIMAL, VIEWS
 
Fields inherited from interface ix.iface.ui.FrameSymbols
STYLE_CARD, STYLE_SIMPLE, STYLE_TABBED
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DomainEditor()
          Makes the editor with the default (simple) mode.
DomainEditor(boolean standAlone)
          Makes the editor with the given stand alone mode.
DomainEditor(boolean isSimple, boolean standAlone)
          Makes the editor with the given mode and the given stand-alone or not.
DomainEditor(Domain domain)
          Makes the editor with the given domain - simple, stand-alone by default.
DomainEditor(Domain domain, boolean standAlone)
          Makes the editor with the given mode and load the given domain.
DomainEditor(IXAgent theAgent, Domain domain)
          Makes the editor with the given domain in not-stand-alone mode.
 
Method Summary
 void aboutDialog()
           
 void actionPerformed(java.awt.event.ActionEvent event)
          Implements the ActionListener interface.
 void adaptDefaultMenu()
          Dummy method that can be overridden by sub-classes to adapt the default.
protected  void adaptMenusToPanel(javax.swing.JPanel panel)
          Called whenever the current panel is updated
 void constructAdded(RefinementEvent e)
           
 void constructAdded(UIDomainEvent e)
          Called when a UI construct is added.
 void constructEdited(UIDomainEvent e)
          Called when a UI construct is edited.
 void constructRemoved(UIDomainEvent e)
          Called when a UI construct is removed.
protected  boolean currentPanelChanging(javax.swing.JPanel oldPanel, javax.swing.JPanel newPanel)
          Changing current panel from old to new.
 void domainCleared(UIDomainEvent e)
          Called when the domain is cleared.
 void domainEdited(UIDomainEvent se)
          Called when the domain's own fields changed (currently only name).
 void domainSet(UIDomainEvent se)
          Called when the domain is added.
 void ensureHelpFrame()
           
 void exitApplication()
           
 Domain getDomain()
           
 java.io.File getModelDirectory()
           
 java.io.File getPreferencesFile()
           
 UIDomain getUIDomain()
           
 boolean isSimpleMode()
           
 void loadProperties()
           
static void main(java.lang.String[] args)
           
 void makeEditMenu()
          Makes an edit menu Menu items: edit construct Toolbar buttons: none
 void makeFileMenu()
          Makes a the file menu and toolbar buttons.
 void makeFileMenuExits()
          Makes default close/exit menu options and and toolbar buttons.
 void makeHelpMenu()
          Make sure that if this is overwritten, adaptDefaultMenu is called elsewhere.
 void makeModeMenu()
           
 void makeOptionsMenu()
          Overrides the one in JFrameMTP and JFrameMT - goes into View menu, not File.
protected  void makePreferences()
           
protected  void makePreferencesMenu()
           
protected  void makeToolbar()
           
 void makeToolsMenu()
          Makes a tools menu and toolbar buttons.
 void makeViewMenu()
           
 void makeViewsMenu()
           
protected  void populateEditMenu()
          Fill the edit menu with constructs from the domain.
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void refinementAdded(RefinementEvent e)
           
 void saveExpansion(Refinement data)
          The name of this is a hangover from something Jeff did.
 void saveProperties()
           
 void setActivityView(Symbol view)
          If the state of the menu item does not correspond to the new setting, it is changed.
 void setConstraintsView(Symbol constrView)
           
 void setConstruct(IXObject construct)
          Sets the given construct as the current one and displays it for editing.
 void setCurrentProperties(java.util.Properties properties)
           
 void setDefaultProperties(java.util.Properties defaults)
           
 void setDefaultSequence(boolean on)
          Sets the toggle for default sub-activity sequencing behaviour.
 void setDomain(Domain domain)
          Sets the given domain as current both in this frame and the domain editor panel.
 void setDomain(java.io.File domainFile)
          Reads the descriptions in the given domain file.
 void setGraphical()
          If the state of the menu item does not correspond to the new setting, it is changed.
 void setModelDirectory(java.io.File directory)
          Sets the directory used to load/save models.
 boolean setPanelStyle(java.lang.String style)
           
 void setSimpleMode(boolean newSimple)
          Sets the editor to simple (true) or advanced (false) mode.
 void setUIConstruct(UIObject construct)
          Sets the given UIObject as the current one and displays it for editing.
 void setUIDomain(UIDomain uiDomain)
          Sets the given UIDomain as current both in this frame and the domain editor panel.
protected  void setVisuals()
           
 void showButtonTexts(boolean show)
           
 void updateCurrentPanel(AConstructFramePanel panel)
          Sets the current panel and sets the domain in the panel
 void updateIDEFromProperties()
           
 void updatePropertiesFromIDE()
           
 void updateViewMenu(Symbol view)
          Call this to keep the Activity Views menu in line with the view that is shown.
protected  void userClearDomain()
          Clears the current domain.
 boolean userClose()
          Close the editor or exit it if it is running stand-alone.
protected  void userInsertDomain()
          Gets a domain file name and reads it.
protected  void userOpenDomain()
          Gets a domain file name, reads it, and replaces the contents of the current domain with the read ones.
protected  void userPublishDomain()
           
protected  void userRevertDomain()
          Reverts the whole draft domain to the last published (or original) one.
protected  java.io.File userSaveDomain()
           
protected  java.io.File userSaveDomainAs()
           
 
Methods inherited from class ix.iface.ui.JFrameMTP
addPanel, changePanelStyle, fillWindowsMenu, getACurrentPanel, getCurrentPanel, getNamedPanel, getPanels, getPanelStyle, getPanelStyles, itemStateChanged, makeDefaultMenuToolbar, makeStyleMenu, makeWindowsMenu, makeWindowsMenu, removeAllPanels, setCurrentPanel, setPanelStyles, setStyleInMenu, setWindowsMenuSelection, stateChanged, updateCurrentPanel, updateCurrentPanel
 
Methods inherited from class ix.iface.ui.JFrameMT
adaptDefaultMenuToolbar, adaptDefaultToolbar, ensureOpenDialog, ensureSaveDialog, exit, makeDefaultMenu, MakeDefaultToolbar, makeEditMenuTool, makeFileMenuTool, makeFileMenuToolExits, makeFileMenuToolFiles, makeFrame, makeHelpMenuTool, makeMenu, makeMenuToolBars, makeOptionsMenuTool, makeRadioMenuItem, makeToolbarItem, makeToolsMenuTool, makeViewMenuTool, openFile, placeToolbarButton, saveFile, saveFileAs, toggleToolbar
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, postProcessKeyEvent, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paint, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, removeAll, removeContainerListener, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, 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, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.event.ChangeListener
stateChanged
 
Methods inherited from interface ix.iview.InternalDomainEditor
setVisible
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

agent

protected IXAgent agent

ideProperties

public java.util.Properties ideProperties

preferencesDialog

protected JPreferencesDialog preferencesDialog

domainPanel

protected GlobalFramePanel domainPanel

actionPanel

protected ActionEditorPanel actionPanel

aroPanel

protected AROEditorPanel aroPanel

grammarPanel

protected GrammarEditorPanel grammarPanel

lexiconPanel

protected AConstructFramePanel lexiconPanel

testPanel

protected AConstructFramePanel testPanel

orderingEditor

protected OrderingEditor orderingEditor

checkIcon

protected javax.swing.ImageIcon checkIcon

revertOIcon

protected javax.swing.ImageIcon revertOIcon

modifyIcon

protected javax.swing.ImageIcon modifyIcon

publishIcon

protected javax.swing.ImageIcon publishIcon

minimalIcon

protected javax.swing.ImageIcon minimalIcon

comprehensiveIcon

protected javax.swing.ImageIcon comprehensiveIcon

graphicalIcon

protected javax.swing.ImageIcon graphicalIcon

preferredIcon

protected javax.swing.ImageIcon preferredIcon

simpleIcon

protected javax.swing.ImageIcon simpleIcon

advancedIcon

protected javax.swing.ImageIcon advancedIcon

helpFrame

protected HelpFrame helpFrame

revertItem

public IXToolItem revertItem

publishItem

protected IXToolItem publishItem

insertItem

protected IXToolItem insertItem

clearItem

protected IXToolItem clearItem

revertDItem

protected IXToolItem revertDItem

newEditItem

protected IXToolItem newEditItem

revertOItem

protected IXToolItem revertOItem

modifyItem

protected IXToolItem modifyItem

modeMenu

protected javax.swing.JMenu modeMenu

simpleItem

protected IXToolItem simpleItem

advancedItem

protected IXToolItem advancedItem

viewsMenu

protected javax.swing.JMenu viewsMenu

minimalItem

protected IXToolItem minimalItem

comprehensiveItem

protected IXToolItem comprehensiveItem

graphicalItem

protected IXToolItem graphicalItem

checkItem

protected IXToolItem checkItem

preferencesItem

protected IXToolItem preferencesItem

preferredItem

protected IXToolItem preferredItem

sequenceNewItem

protected IXToolItem sequenceNewItem

sequenceItem

protected IXToolItem sequenceItem

parallelItem

protected IXToolItem parallelItem

propModeItem

protected IXToolItem propModeItem

propButtTextItem

protected IXToolItem propButtTextItem

propEditableItem

protected IXToolItem propEditableItem

propListTextItem

protected IXToolItem propListTextItem

propSaveItem

protected IXToolItem propSaveItem

allButtons

public IXToolItem[] allButtons

preferredConstraints

protected Symbol preferredConstraints

modelDirectory

protected java.io.File modelDirectory

uiDomain

public UIDomain uiDomain
The current domain in the editor. May be null

tbs

javax.swing.JToolBar.Separator tbs
Constructor Detail

DomainEditor

public DomainEditor()
Makes the editor with the default (simple) mode. Subsequently, the domain can be set with the setDomain method or it can be loaded via the menu. The default window title is "IX - Domain Editor".

DomainEditor

public DomainEditor(boolean isSimple,
                    boolean standAlone)
Makes the editor with the given mode and the given stand-alone or not. The given mode will override any defaults or preferences loaded from file.
Parameters:
isSimple - mode: true for simple, false for advanced
standAlone - mode: true for standAlone, false for part of other application

DomainEditor

public DomainEditor(boolean standAlone)
Makes the editor with the given stand alone mode. Subsequently, the domain can be set with the setDomain method or it can be loaded via the menu. The default window title is "IX - Domain Editor".
Parameters:
standAlone - mode: true for standAlone, false for part of other application

DomainEditor

public DomainEditor(Domain domain)
Makes the editor with the given domain - simple, stand-alone by default. The default window title is "IX - Domain Editor".
Parameters:
domain - the domain to use in the editor

DomainEditor

public DomainEditor(Domain domain,
                    boolean standAlone)
Makes the editor with the given mode and load the given domain. The default window title is "IX - Domain Editor".
Parameters:
domain - the domain to use in the editor
standAlone - mode: true for standAlone, false for part of other application

DomainEditor

public DomainEditor(IXAgent theAgent,
                    Domain domain)
Makes the editor with the given domain in not-stand-alone mode.
Parameters:
theAgent - the IXAgent that wants the editor to start
domain - the domain to use in the editor
Method Detail

getPreferencesFile

public java.io.File getPreferencesFile()

loadProperties

public void loadProperties()

setDefaultProperties

public void setDefaultProperties(java.util.Properties defaults)

setCurrentProperties

public void setCurrentProperties(java.util.Properties properties)

saveProperties

public void saveProperties()

updateIDEFromProperties

public void updateIDEFromProperties()

updatePropertiesFromIDE

public void updatePropertiesFromIDE()

currentPanelChanging

protected boolean currentPanelChanging(javax.swing.JPanel oldPanel,
                                       javax.swing.JPanel newPanel)
Changing current panel from old to new.
Overrides:
currentPanelChanging in class JFrameMTP
Following copied from class: ix.iface.ui.JFrameMTP
Returns:
true if the panels should really change, false if the old panel should remain.

setVisuals

protected void setVisuals()

ensureHelpFrame

public void ensureHelpFrame()

isSimpleMode

public boolean isSimpleMode()
Returns:
the current setting of the simpleMode flag

setActivityView

public void setActivityView(Symbol view)
If the state of the menu item does not correspond to the new setting, it is changed. If the editor is already in the given mode, nothing is done, except ensuring that the menu item is set to the corresponding state. Currently, nothing else changes in the frame, so the command is passed on to the ActionEditorPanel.

setPanelStyle

public boolean setPanelStyle(java.lang.String style)
Overrides:
setPanelStyle in class JFrameMTP

setConstraintsView

public void setConstraintsView(Symbol constrView)

updateViewMenu

public void updateViewMenu(Symbol view)
Call this to keep the Activity Views menu in line with the view that is shown.

setSimpleMode

public void setSimpleMode(boolean newSimple)
Sets the editor to simple (true) or advanced (false) mode. If the state of the menu item does not correspond to the new setting, it is changed. If the editor is already in the given mode, nothing is done, except ensuring that the menu item is set to the corresponding state. Currently, nothing else changes in the frame, so the command is passed on to the ActionEditorPanel.

setGraphical

public void setGraphical()
If the state of the menu item does not correspond to the new setting, it is changed.

setModelDirectory

public void setModelDirectory(java.io.File directory)
Sets the directory used to load/save models. This method just notes the given value which is used when needed for the file selectors for loading and saving models

getModelDirectory

public java.io.File getModelDirectory()
Returns:
the directory used to load/save models.

adaptDefaultMenu

public void adaptDefaultMenu()
Description copied from class: JFrameMT
Dummy method that can be overridden by sub-classes to adapt the default.
Overrides:
adaptDefaultMenu in class JFrameMT

makeFileMenu

public void makeFileMenu()
Makes a the file menu and toolbar buttons. Replaces that of the superclass Menu items: new, open, save, save as, S, Options, S, close, exit Toolbar buttons: new, open, save
Overrides:
makeFileMenu in class JFrameMT

makeFileMenuExits

public void makeFileMenuExits()
Makes default close/exit menu options and and toolbar buttons. Menu items: S, close, exit Toolbar buttons: none
Overrides:
makeFileMenuExits in class JFrameMT

makeOptionsMenu

public void makeOptionsMenu()
Overrides the one in JFrameMTP and JFrameMT - goes into View menu, not File.
Overrides:
makeOptionsMenu in class JFrameMTP

makeEditMenu

public void makeEditMenu()
Makes an edit menu Menu items: edit construct Toolbar buttons: none
Overrides:
makeEditMenu in class JFrameMT

makeViewMenu

public void makeViewMenu()
Overrides:
makeViewMenu in class JFrameMTP

makeModeMenu

public void makeModeMenu()

makeViewsMenu

public void makeViewsMenu()

makeToolsMenu

public void makeToolsMenu()
Makes a tools menu and toolbar buttons. Menu items: none Toolbar buttons: none
Overrides:
makeToolsMenu in class JFrameMT

makeHelpMenu

public void makeHelpMenu()
Description copied from class: JFrameMT
Make sure that if this is overwritten, adaptDefaultMenu is called elsewhere.
Overrides:
makeHelpMenu in class JFrameMT

makeToolbar

protected void makeToolbar()

showButtonTexts

public void showButtonTexts(boolean show)

adaptMenusToPanel

protected void adaptMenusToPanel(javax.swing.JPanel panel)
Called whenever the current panel is updated
Overrides:
adaptMenusToPanel in class JFrameMTP

populateEditMenu

protected void populateEditMenu()
Fill the edit menu with constructs from the domain.

makePreferences

protected void makePreferences()

makePreferencesMenu

protected void makePreferencesMenu()

saveExpansion

public void saveExpansion(Refinement data)
The name of this is a hangover from something Jeff did. This is meant to set the given refinement into the editor ready to be changed.
Specified by:
saveExpansion in interface InternalDomainEditor

setConstruct

public void setConstruct(IXObject construct)
Sets the given construct as the current one and displays it for editing. All work is done in the current panel.
Parameters:
construct - the original domain object to be viewed/edited

setUIConstruct

public void setUIConstruct(UIObject construct)
Sets the given UIObject as the current one and displays it for editing. All work is done in the current panel.
Parameters:
construct - the UI object to be viewed/edited

setDomain

public void setDomain(java.io.File domainFile)
Reads the descriptions in the given domain file. Displays a message if the file cannot be found. Sets the domain as current in this.
Parameters:
domainFile - the file from which to read the domain

setDomain

public void setDomain(Domain domain)
Sets the given domain as current both in this frame and the domain editor panel.
Parameters:
domain - the domain to use

setUIDomain

public void setUIDomain(UIDomain uiDomain)
Sets the given UIDomain as current both in this frame and the domain editor panel.
Parameters:
uiDomain - the UIDomain to use

getUIDomain

public UIDomain getUIDomain()

getDomain

public Domain getDomain()

updateCurrentPanel

public void updateCurrentPanel(AConstructFramePanel panel)
Sets the current panel and sets the domain in the panel
Parameters:
domain - the domain to use

setDefaultSequence

public void setDefaultSequence(boolean on)
Sets the toggle for default sub-activity sequencing behaviour.
Parameters:
on - true: put new sub-activities in sequence, false: put them in parallel.

userClearDomain

protected void userClearDomain()
Clears the current domain. Gets confirmation from the user if the domain is not empty.

userRevertDomain

protected void userRevertDomain()
Reverts the whole draft domain to the last published (or original) one. Gets confirmation from the user if the domain has changed.

userOpenDomain

protected void userOpenDomain()
Gets a domain file name, reads it, and replaces the contents of the current domain with the read ones.

userInsertDomain

protected void userInsertDomain()
Gets a domain file name and reads it.

userSaveDomain

protected java.io.File userSaveDomain()

userSaveDomainAs

protected java.io.File userSaveDomainAs()

userPublishDomain

protected void userPublishDomain()

refinementAdded

public void refinementAdded(RefinementEvent e)
Specified by:
refinementAdded in interface DomainListener

constructAdded

public void constructAdded(RefinementEvent e)
Specified by:
constructAdded in interface UIDomainListener

constructAdded

public void constructAdded(UIDomainEvent e)
Description copied from interface: UIDomainListener
Called when a UI construct is added. Use getSource() to get at the domain (UI/IX) in which the event occurred. Use getObject() to get at the object (UI/IX) that has been added.
Specified by:
constructAdded in interface UIDomainListener

constructEdited

public void constructEdited(UIDomainEvent e)
Description copied from interface: UIDomainListener
Called when a UI construct is edited. Use getSource() to get at the UIDomain in which the event occurred. Use getObject() to get at the UIObject that has been edited.
Specified by:
constructEdited in interface UIDomainListener

constructRemoved

public void constructRemoved(UIDomainEvent e)
Description copied from interface: UIDomainListener
Called when a UI construct is removed. Use getSource() to get at the UIDomain in which the event occurred. Use getObject() to get at the UIObject that has been removed.
Specified by:
constructRemoved in interface UIDomainListener

domainCleared

public void domainCleared(UIDomainEvent e)
Description copied from interface: UIDomainListener
Called when the domain is cleared.
Specified by:
domainCleared in interface UIDomainListener

domainEdited

public void domainEdited(UIDomainEvent se)
Description copied from interface: UIDomainListener
Called when the domain's own fields changed (currently only name).
Specified by:
domainEdited in interface UIDomainListener

domainSet

public void domainSet(UIDomainEvent se)
Description copied from interface: UIDomainListener
Called when the domain is added.
Specified by:
domainSet in interface UIDomainListener

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Implements the ActionListener interface. If this cannot recognise the event, it passes it to the current AConstructFramePanel. If the panel does not recognise the event either, this passes it to its superclass (JFrameMTP, which will pass the event to the current panel first).

Catch specific menu/toolbar events here. Let the panels process their own events, let the superclass process panel-swapping events (inc. style) and, via its superclass, general window events (close, exit, ...)

Overrides:
actionPerformed in class JFrameMTP

exitApplication

public void exitApplication()
Overrides:
exitApplication in class JFrameMT

userClose

public boolean userClose()
Close the editor or exit it if it is running stand-alone. Will check if edits have been noted (and put up dialogues) and will check whether changes have been saved (and published if not running stand-alone).
Returns:
true if the editor is closed, false if the user canceled.

aboutDialog

public void aboutDialog()
Overrides:
aboutDialog in class JFrameMT

main

public static void main(java.lang.String[] args)