Derive from this class to implement the Controller for your mode. Overload the methods
you need for your data model, or use the defaults. There are some default Actions you may want
to use for easy editing of your model. Take MindMapController as a sample.
NEW_CHILD
public final int NEW_CHILD
NEW_CHILD_WITHOUT_FOCUS
public final int NEW_CHILD_WITHOUT_FOCUS
NEW_SIBLING_BEFORE
public final int NEW_SIBLING_BEFORE
NEW_SIBLING_BEHIND
public final int NEW_SIBLING_BEHIND
copySingle
public Action copySingle
popupListenerSingleton
protected final freemind.modes.ControllerAdapter.ControllerPopupMenuListener popupListenerSingleton
Take care! This listener is also used for modelpopups (as for graphical links).
add
protected void add(JMenu menu,
Action action)
add
protected JMenuItem add(JMenu menu,
Action action,
String keystroke)
- returns the new JMenuItem.
binOptionIsTrue
protected boolean binOptionIsTrue(String option)
close
public boolean close()
Return false if user has canceled.
- close in interface ModeController
edit
public void edit(KeyEvent e,
boolean addNew,
boolean editLong)
- edit in interface ModeController
extendSelection
public boolean extendSelection(MouseEvent e)
This extends the currently selected nodes.
- extendSelection in interface ModeController
- true, if the method changed the selection.
getFileFilter
protected FileFilter getFileFilter()
You may want to implement this...
It returns the FileFilter that is used by the open() and save()
JFileChoosers.
getLinkByFileChooser
protected String getLinkByFileChooser(FileFilter fileFilter)
getMapModule
protected MapModule getMapModule()
getMode
protected Mode getMode()
getPopupForModel
public JPopupMenu getPopupForModel(java.lang.Object obj)
Default implementation: no context menu.
- getPopupForModel in interface ModeController
getResource
public URL getResource(String name)
getSelecteds
protected LinkedList getSelecteds()
fc, 24.1.2004: having two methods getSelecteds with different return values (linkedlists of models resp. views) is asking for trouble. @see MapView
getText
protected String getText(String textId)
Get text identification of the map
handleLoadingException
public void handleLoadingException(Exception ex)
load
public void load(File file)
throws FileNotFoundException,
IOException,
XMLParseException
You may decide to overload this or take the default
and implement the functionality in your MapModel (implements MindMap)
- load in interface ModeController
loadURL
public void loadURL()
loadURL
public void loadURL(String relative)
mapOpened
public void mapOpened(boolean open)
Call this method if you have opened a map for this mode with true,
and if you have closed a map of this mode with false. It updates the Actions
that are dependent on whether there is a map or not.
--> What to do if either newMap or load or close are overwritten by a concrete
implementation? uups.
newMap
protected void newMap(MindMap map)
newModel
public MapAdapter newModel()
You _must_ implement this if you use one of the following actions:
OpenAction, NewMapAction.
save
public boolean save(File file)
Return false is the action was cancelled, e.g. when
it has to lead to saving as.
- save in interface ModeController
saveAs
public boolean saveAs()
Save as; return false is the action was cancelled
- saveAs in interface ModeController
setAllActions
protected void setAllActions(boolean enabled)
Overwrite this to set all of your actions which are
dependent on whether there is a map or not.
setImageByFileChooser
protected void setImageByFileChooser()
setLinkByFileChooser
protected void setLinkByFileChooser()
setLinkByTextField
protected void setLinkByTextField()
setMode
protected void setMode(Mode mode)
toggleChildrenFolded
protected void toggleChildrenFolded()
If any children are folded, unfold all folded children.
Otherwise, fold all children.
updateMapModuleName
protected void updateMapModuleName()