|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.gui.AbstractApplication
diva.gui.MultiWindowApplication
diva.graph.schematic.MultiWindowGraphEditor
public class MultiWindowGraphEditor
A graph editor for non-hierarchical graphs. This is a complete graph-editing application that includes automatic layout, load from and save to XML, editable properties, and so on. It is intended as an example application that you can use to understand the functionality of the diva.gui application framework, as well as a basis for building a customized graph editor for your own application.
This class subclasses diva.gui.MDIApplication. As such, it implements a straight-forward one-to-one mapping from documents to views. (If you need more complex document-view mappings, you will need to subclass AbstractApplication and implement the mappings yourself.) Subclasses of MDIApplication need to call setAppContext() with an instance of MDIFrame (in this case, we use DesktopContext). They also need to implement at least these methods:
Given an implementation of diva.gui.Document, create a suitable widget and return it. The MDIApplication superclass will take care adding it to the MDIFrame.
Return the title of the application -- this is shown in the title bar of the AppContext and other places.
Redisplay the document after it is mapped to the screen. This only needs to be implemented by applications that need to know the size of the component to draw properly (for example, graph layout).
In addition to implementing diva.gui.Application, the only other interface that must be implemented to produce a complete function application is diva.gui.Document. See the CanvasDocument class.
Please also read the method documentation for this class, as well as the source code. Apart from providing implementation of the methods described above, it also initializes menubars, toolbars, and creates the Action objects that are executed in response to toolbar and menu commands.
Constructor Summary | |
---|---|
MultiWindowGraphEditor(DesktopContext context)
Construct a new graph editing application. |
Method Summary | |
---|---|
View |
createView(Document d)
Create a view on the given document. |
String |
getTitle()
Get the title of this application |
void |
initializeMenuBar(JMenuBar mb)
Initialize the given menubar. |
void |
initializePalette()
Initialize the palette in the. |
void |
initializeToolBar(JToolBar tb)
Initialize the given toolbar. |
static void |
main(String[] argv)
Create and run a new graph application |
Methods inherited from class diva.gui.MultiWindowApplication |
---|
addView, getView, removeView |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiWindowGraphEditor(DesktopContext context)
Method Detail |
---|
public View createView(Document d)
createView
in interface Application
createView
in class MultiWindowApplication
public String getTitle()
getTitle
in interface Application
getTitle
in class AbstractApplication
public void initializePalette()
public void initializeMenuBar(JMenuBar mb)
public void initializeToolBar(JToolBar tb)
public static void main(String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |