net.sf.sdedit.editor
Class Editor

java.lang.Object
  extended by net.sf.sdedit.editor.Editor
All Implemented Interfaces:
Constants, PanelPaintDeviceListener, UserInterfaceListener

public final class Editor
extends Object
implements Constants, PanelPaintDeviceListener, UserInterfaceListener

The control class of the Quick Sequence Diagram Editor.

Author:
Markus Strauch

Field Summary
 
Fields inherited from interface net.sf.sdedit.Constants
ACTIVE_LIFELINE_COLOR, ANTI_ALIAS, dashed, DEFAULT_CODE_FONT, DEFAULT_CURSOR, DEFAULT_ENCODING_SCHEME, dotted, emptyStroke, GLOBAL_CONF_FILE, HAND_CURSOR, MOVE_CURSOR, SAVE_AS_FILE_PROPERTY, SAVE_AS_TYPE_PROPERTY, solid, TEST_FREEHEP_CLASSNAME, thick, thick_dashed, THREAD_COLORS
 
Method Summary
 void codeChanged(boolean syntaxCheckOnly)
          Starts a new thread that generates a diagram from the source text found in the text area of the currently selected tab.
 void currentTabClosing()
          The current tab shall be closed.
 void error(String msg)
           
static Editor getEditor()
           
 PanelPaintDeviceListener getPanelPaintDeviceListener()
           
 List<String> getRecentFiles()
           
 UserInterface getUI()
          Returns the user interface.
 void hyperlinkClicked(String hyperlink)
          A hyperlink has been clicked.
 boolean isServerRunning()
           
 boolean isSetup()
           
 void loadCode(File file)
           
 void mouseClickedDrawable(Drawable drawable)
          Moves the cursor to the position in the text area where the object or message corresponding to the drawable instance is declared.
 boolean mouseEnteredDrawable(Drawable drawable)
          Returns true if and only if the given drawable instance is associated by the most recently used diagram with a DiagramDataProvider state, id est a position in the text area.
 void mouseExitedDrawable(Drawable drawable)
          This method is called when the mouse exited a rectangle belonging to some drawable component.
 void quit()
           
 boolean saveCode(boolean as)
          Saves the code from the text area to the current file or to a file whose name is given by the user.
 void shutDownServer()
           
 int startRealtimeServer(int port)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEditor

public static Editor getEditor()

currentTabClosing

public void currentTabClosing()
Description copied from interface: UserInterfaceListener
The current tab shall be closed.

Specified by:
currentTabClosing in interface UserInterfaceListener
See Also:
UserInterfaceListener.currentTabClosing()

hyperlinkClicked

public void hyperlinkClicked(String hyperlink)
Description copied from interface: UserInterfaceListener
A hyperlink has been clicked. The argument is a string containing a colon, the part before the colon denotes the type of the hyperlink, the part after the colon denotes its name.

Specified by:
hyperlinkClicked in interface UserInterfaceListener
Parameters:
hyperlink - a string containing a colon, the part before the colon denotes the type of the hyperlink, the part after the colon denotes its name
See Also:
UserInterfaceListener.hyperlinkClicked(java.lang.String)

error

public void error(String msg)

getRecentFiles

public List<String> getRecentFiles()

startRealtimeServer

public int startRealtimeServer(int port)
                        throws IOException
Throws:
IOException

isServerRunning

public boolean isServerRunning()

shutDownServer

public void shutDownServer()

loadCode

public void loadCode(File file)
              throws IOException,
                     DocUtil.XMLException
Throws:
IOException
DocUtil.XMLException

isSetup

public boolean isSetup()

quit

public void quit()

saveCode

public boolean saveCode(boolean as)
                 throws IOException,
                        DocUtil.XMLException
Saves the code from the text area to the current file or to a file whose name is given by the user. If the file has been successfully written, the current file is set to that file.

Parameters:
as - flag denoting whether the user should give the file, if not, the current file (if present) is used
Returns:
flag denoting if the code has actually been saved
Throws:
IOException - if the file cannot be written
DocUtil.XMLException

codeChanged

public void codeChanged(boolean syntaxCheckOnly)
Starts a new thread that generates a diagram from the source text found in the text area of the currently selected tab.

Specified by:
codeChanged in interface UserInterfaceListener
Parameters:
syntaxCheckOnly - flag denoting if only syntax is checked and no diagram is generated yet

getUI

public UserInterface getUI()
Returns the user interface.

Returns:
the user interface

mouseClickedDrawable

public void mouseClickedDrawable(Drawable drawable)
Moves the cursor to the position in the text area where the object or message corresponding to the drawable instance is declared.

Specified by:
mouseClickedDrawable in interface PanelPaintDeviceListener
Parameters:
drawable - a drawable instance to show the corresponding declaration for

mouseEnteredDrawable

public boolean mouseEnteredDrawable(Drawable drawable)
Returns true if and only if the given drawable instance is associated by the most recently used diagram with a DiagramDataProvider state, id est a position in the text area.

Specified by:
mouseEnteredDrawable in interface PanelPaintDeviceListener
Parameters:
drawable - a drawable instance such that the mouse has just entered it
Returns:
true if and only if the given drawable instance is associated by the most recently used diagram with a position in the text area

mouseExitedDrawable

public void mouseExitedDrawable(Drawable drawable)
Description copied from interface: PanelPaintDeviceListener
This method is called when the mouse exited a rectangle belonging to some drawable component.

Specified by:
mouseExitedDrawable in interface PanelPaintDeviceListener
Parameters:
drawable - the drawable component that has been entered by the mouse
See Also:
PanelPaintDeviceListener.mouseExitedDrawable(net.sf.sdedit.drawable.Drawable)

getPanelPaintDeviceListener

public PanelPaintDeviceListener getPanelPaintDeviceListener()
Specified by:
getPanelPaintDeviceListener in interface UserInterfaceListener


Copyright © 2011. All Rights Reserved.