adalogo.gui.editor

Class Editor

Implemented Interfaces:
EventListener, FileHandler.FileHandlerListener, VisitorMaster.VisitorListener

public class Editor
extends JPanel
implements FileHandler.FileHandlerListener, VisitorMaster.VisitorListener

This class hold the editor

Nested Class Summary

Field Summary

Action[]
exampleActions

Constructor Summary

Editor(Engine en)

Method Summary

void
addCaretListener(CaretListener listener)
delegate method for external components to add caret listener.
void
addFileHandlerListener(FileHandler.FileHandlerListener listener)
delegate for external components to add file listener.
void
documentChanged(FileHandler.FileHandlerEvent e)
update title of window frame with currently loaded file name.
void
documentLoadFailed(FileHandler.FileHandlerEvent e)
void
documentLoaded(FileHandler.FileHandlerEvent e)
void
documentSaveFailed(FileHandler.FileHandlerEvent e)
void
documentSaved(FileHandler.FileHandlerEvent e)
Action
getCommentAction()
Action
getCopyAction()
Action
getCutAction()
Action[]
getExampleActions()
Action[]
getFontSizeActions()
Dimension
getMinimumSize()
Action
getNewAction()
Action
getOpenAction()
Action
getPasteAction()
Dimension
getPreferredSize()
Action
getRedoAction()
Action
getRevertAction()
Action
getSaveAction()
Action
getSaveAsAction()
String
getText()
get text from editor.
Action
getUncommentAction()
Action
getUndoAction()
void
init()
init.
boolean
okToClose()
return true if it is ok to close.
void
visitorRunning(VisitorMaster.VisitorEvent e)
void
visitorStarted(VisitorMaster.VisitorEvent e)
void
visitorStopped(VisitorMaster.VisitorEvent e)
void
visitorWaiting(VisitorMaster.VisitorEvent e)

Field Details

exampleActions

public Action[] exampleActions

Constructor Details

Editor

public Editor(Engine en)

Method Details

addCaretListener

public void addCaretListener(CaretListener listener)
delegate method for external components to add caret listener. currently used by status bar.


addFileHandlerListener

public void addFileHandlerListener(FileHandler.FileHandlerListener listener)
delegate for external components to add file listener. currently used by visitor master to reset break points.


documentChanged

public void documentChanged(FileHandler.FileHandlerEvent e)
update title of window frame with currently loaded file name. will be called from document listener and from save load operations. see this like some sort of event listener.
Specified by:
documentChanged in interface FileHandler.FileHandlerListener


documentLoadFailed

public void documentLoadFailed(FileHandler.FileHandlerEvent e)
Specified by:
documentLoadFailed in interface FileHandler.FileHandlerListener


documentLoaded

public void documentLoaded(FileHandler.FileHandlerEvent e)
Specified by:
documentLoaded in interface FileHandler.FileHandlerListener


documentSaveFailed

public void documentSaveFailed(FileHandler.FileHandlerEvent e)
Specified by:
documentSaveFailed in interface FileHandler.FileHandlerListener


documentSaved

public void documentSaved(FileHandler.FileHandlerEvent e)
Specified by:
documentSaved in interface FileHandler.FileHandlerListener


getCommentAction

public Action getCommentAction()


getCopyAction

public Action getCopyAction()


getCutAction

public Action getCutAction()


getExampleActions

public Action[] getExampleActions()


getFontSizeActions

public Action[] getFontSizeActions()


getMinimumSize

public Dimension getMinimumSize()


getNewAction

public Action getNewAction()


getOpenAction

public Action getOpenAction()


getPasteAction

public Action getPasteAction()


getPreferredSize

public Dimension getPreferredSize()


getRedoAction

public Action getRedoAction()


getRevertAction

public Action getRevertAction()


getSaveAction

public Action getSaveAction()


getSaveAsAction

public Action getSaveAsAction()


getText

public String getText()
get text from editor. this is called when starting interpreter.


getUncommentAction

public Action getUncommentAction()


getUndoAction

public Action getUndoAction()


init

public void init()
init. extended constructor. called by engine.


okToClose

public boolean okToClose()
return true if it is ok to close. engine will ask this when it is about to close the window. this will delegate to save load handler.


visitorRunning

public void visitorRunning(VisitorMaster.VisitorEvent e)
Specified by:
visitorRunning in interface VisitorMaster.VisitorListener


visitorStarted

public void visitorStarted(VisitorMaster.VisitorEvent e)
Specified by:
visitorStarted in interface VisitorMaster.VisitorListener


visitorStopped

public void visitorStopped(VisitorMaster.VisitorEvent e)
Specified by:
visitorStopped in interface VisitorMaster.VisitorListener


visitorWaiting

public void visitorWaiting(VisitorMaster.VisitorEvent e)
Specified by:
visitorWaiting in interface VisitorMaster.VisitorListener