public class MultiWindowGraphEditor extends MultiWindowApplication
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 and Description |
---|
MultiWindowGraphEditor(DesktopContext context)
Construct a new graph editing application.
|
Modifier and Type | Method and Description |
---|---|
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
|
addView, getView, removeView
actions, addAction, addDocument, addDocumentListener, addMenuItem, addMenuItem, addPropertyChangeListener, addToolBarButton, addToolBarButton, addViewListener, closeDocument, closeView, documentList, getAction, getAppContext, getClipboard, getCurrentView, getDocumentFactory, getResources, getStoragePolicy, isVisible, removeDocument, removeDocumentListener, removePropertyChangeListener, removeViewListener, setAppContext, setClipboard, setCurrentView, setDocumentFactory, setStoragePolicy, setVisible, showError, viewList, viewList
public MultiWindowGraphEditor(DesktopContext context)
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)
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.