|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfreemind.modes.ControllerAdapter
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.
| Field Summary | |
javax.swing.Action |
copy
|
javax.swing.Action |
copySingle
|
javax.swing.Action |
cut
|
int |
NEW_CHILD
|
int |
NEW_CHILD_WITHOUT_FOCUS
|
int |
NEW_SIBLING_BEFORE
|
int |
NEW_SIBLING_BEHIND
|
javax.swing.Action |
paste
|
| Constructor Summary | |
ControllerAdapter()
|
|
ControllerAdapter(Mode mode)
|
|
| Method Summary | |
protected void |
add(javax.swing.JMenu menu,
javax.swing.Action action)
|
protected void |
add(javax.swing.JMenu menu,
javax.swing.Action action,
java.lang.String keystroke)
|
void |
addNew(NodeView target,
int newNodeMode,
java.awt.event.KeyEvent e)
|
void |
anotherNodeSelected(MindMapNode n)
|
protected boolean |
binOptionIsTrue(java.lang.String option)
|
boolean |
close()
Return false if user has canceled. |
void |
doubleClick(java.awt.event.MouseEvent e)
|
void |
edit(java.awt.event.KeyEvent e,
boolean addNew,
boolean editLong)
|
Controller |
getController()
|
protected javax.swing.filechooser.FileFilter |
getFileFilter()
You may want to implement this... |
FreeMindMain |
getFrame()
|
protected java.lang.String |
getLinkByFileChooser(javax.swing.filechooser.FileFilter fileFilter)
|
MapAdapter |
getMap()
|
protected MapModule |
getMapModule()
|
protected Mode |
getMode()
|
java.net.URL |
getResource(java.lang.String name)
|
protected java.util.LinkedList |
getSelecteds()
|
protected java.lang.String |
getText(java.lang.String textId)
Get text identification of the map |
MapView |
getView()
|
void |
handleLoadingException(java.lang.Exception ex)
|
boolean |
isBlocked()
|
void |
load(java.io.File file)
You may decide to overload this or take the default and implement the functionality in your MapModel (implements MindMap) |
void |
loadURL()
|
void |
loadURL(java.lang.String relative)
|
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. |
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
|
void |
newMap()
|
protected void |
newMap(MindMap map)
|
MapAdapter |
newModel()
You _must_ implement this if you use one of the following actions: OpenAction, NewMapAction. |
protected abstract MindMapNode |
newNode()
|
void |
nodeChanged(MindMapNode n)
|
void |
open()
|
void |
plainClick(java.awt.event.MouseEvent e)
|
boolean |
save()
|
boolean |
save(java.io.File file)
Return false is the action was cancelled, e.g. when it has to lead to saving as. |
boolean |
saveAs()
Save as; return false is the action was cancelled |
void |
select(java.awt.event.MouseEvent e)
|
protected void |
setAllActions(boolean enabled)
Overwrite this to set all of your actions which are dependent on whether there is a map or not. |
protected void |
setImageByFileChooser()
|
protected void |
setLinkByFileChooser()
|
protected void |
setLinkByTextField()
|
protected void |
setMode(Mode mode)
|
void |
showPopupMenu(java.awt.event.MouseEvent e)
|
protected void |
toggleChildrenFolded()
If any children are folded, unfold all folded children. |
void |
toggleFolded()
|
protected void |
updateMapModuleName()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface freemind.modes.ModeController |
getPopupMenu |
| Field Detail |
public javax.swing.Action copy
public javax.swing.Action copySingle
public javax.swing.Action cut
public javax.swing.Action paste
public final int NEW_CHILD_WITHOUT_FOCUS
public final int NEW_CHILD
public final int NEW_SIBLING_BEHIND
public final int NEW_SIBLING_BEFORE
| Constructor Detail |
public ControllerAdapter()
public ControllerAdapter(Mode mode)
| Method Detail |
protected abstract MindMapNode newNode()
public MapAdapter newModel()
protected javax.swing.filechooser.FileFilter getFileFilter()
public void nodeChanged(MindMapNode n)
nodeChanged in interface ModeControllerpublic void anotherNodeSelected(MindMapNode n)
anotherNodeSelected in interface ModeControllerpublic void doubleClick(java.awt.event.MouseEvent e)
doubleClick in interface ModeControllerpublic void plainClick(java.awt.event.MouseEvent e)
plainClick in interface ModeControllerprotected java.lang.String getText(java.lang.String textId)
protected boolean binOptionIsTrue(java.lang.String option)
public void newMap()
newMap in interface ModeControllerprotected void newMap(MindMap map)
public void load(java.io.File file)
throws java.io.FileNotFoundException,
java.io.IOException,
XMLParseException
load in interface ModeControllerjava.io.FileNotFoundException
java.io.IOException
XMLParseExceptionpublic boolean save()
save in interface ModeControllerprotected java.util.LinkedList getSelecteds()
public boolean save(java.io.File file)
save in interface ModeController
protected void add(javax.swing.JMenu menu,
javax.swing.Action action,
java.lang.String keystroke)
protected void add(javax.swing.JMenu menu,
javax.swing.Action action)
public void open()
open in interface ModeControllerpublic void handleLoadingException(java.lang.Exception ex)
public boolean saveAs()
saveAs in interface ModeControllerpublic boolean close()
close in interface ModeControllerpublic void mapOpened(boolean open)
protected void setAllActions(boolean enabled)
public void showPopupMenu(java.awt.event.MouseEvent e)
showPopupMenu in interface ModeControllerpublic void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved in interface ModeController
public void edit(java.awt.event.KeyEvent e,
boolean addNew,
boolean editLong)
edit in interface ModeControllerpublic boolean isBlocked()
isBlocked in interface ModeController
public void addNew(NodeView target,
int newNodeMode,
java.awt.event.KeyEvent e)
addNew in interface ModeControllerpublic void toggleFolded()
toggleFolded in interface ModeControllerprotected void toggleChildrenFolded()
protected void setLinkByTextField()
protected void setLinkByFileChooser()
protected void setImageByFileChooser()
protected java.lang.String getLinkByFileChooser(javax.swing.filechooser.FileFilter fileFilter)
public void loadURL(java.lang.String relative)
public void loadURL()
protected Mode getMode()
protected void setMode(Mode mode)
protected MapModule getMapModule()
public MapAdapter getMap()
public java.net.URL getResource(java.lang.String name)
public Controller getController()
public FreeMindMain getFrame()
public MapView getView()
protected void updateMapModuleName()
public void select(java.awt.event.MouseEvent e)
select in interface ModeController
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||