@Deprecated public class IlvDiagrammerApplication extends JApplet
IlvDiagrammerApplication
is a ready-to-use Swing application
based on the diagram component, IlvDiagrammer
, and
built using the other components of this package.
The Diagrammer application can be used to view Diagrammer data files. It also has an editing mode for modifying diagrams.
The Diagrammer application contains:
JDesktopPane
is used to manage several
diagram components contained in internal frames.
IlvDiagrammerMenuBar
IlvDiagrammerEditBar
above the working area.
IlvDiagrammerViewBar
on the leading side.
IlvDiagrammerPaletteBar
, if the application is
in editing mode.
IlvDiagrammerTree
displaying the data model as a tree.
IlvDiagrammerPropertySheet
to view and edit the properties of the
selected object.
IlvDiagrammerOverview
to see the whole diagram in
a separate small panel.
JSplitPane
s
and JTabbedPane
s on the leading side of the working area.
The application accepts the following command-line arguments:
-title <title>
A title for the application frame. By default, a localized
title is read from the resource bundle.
-mdi [true|on|yes]
Start in multidocument mode. By default, the application
starts in single-document mode.
-edit [true|on|yes]
Start in editing mode. By default, the application
starts in viewing mode (editing is not allowed). You can
switch between editing and viewing mode with the application running using
a menu item in the Options menu.
-simple [true|on|yes]
Start in "simple" mode. In this mode, the toolbars and menus
contain only a minimal set of actions to view a diagram.
This mode can be used for demos that need a simpler GUI
and where the user does not need to load other diagrams.
-psheet
Show the property sheet at startup. Default is false
-tree
Show the tree at startup. Default is false
-overview
Show the overview at startup. Default is false
-systemlf
Use the system look-and-feel. By default, the Metal look-and-feel
is used.
-data <url>
Load the specified data file at startup. No default.
-style <url>
Use the specified style sheet instead of the default style sheet.
-palette <url>
Use the specified palette file instead of the default palette.
Example::
java ilog.views.diagrammer.application.IlvDiagrammerApplication -mdi -edit -data file:/c/examples/mydata.xml -style file:/c/examples/mystyle.css
The Diagrammer application can be used as an applet. In this case, the arguments are
passed as applet parameters, without the initial '-'
character, and the value
is "true"
(or "on"
, or "yes"
) for Boolean arguments.
Example::
<applet archive="jviews-diagrammer.jar,..." code="ilog.views.diagrammer.application.IlvDiagrammerApplication" width="600" height="500"> <param name="mdi" value="true"/> <param name="edit" value="true"/> <param name="data" value="file:/c/examples/mydata.xml"/> <param style="data" value="file:/c/examples/mystyle.xml"/> </applet>
For an applet, an additional Boolean argument frame
can be used to
create the GUI for the Diagrammer application in an independent JFrame
.
Deprecated: IlvDiagrammerApplication is deprecated due to its direct extension of JApplet, as JViews is moving out of applet technology
along with the JDK, use IlvDiagrammerFrame instead.
JApplet.AccessibleJApplet
Applet.AccessibleApplet
Panel.AccessibleAWTPanel
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
accessibleContext, rootPane, rootPaneCheckingEnabled
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlvDiagrammerApplication()
Deprecated.
Creates the application with the default resource bundle
"ilog.views.diagrammer.application.application"
and with no default command-line arguments. |
IlvDiagrammerApplication(ResourceBundle bundle,
String[] defaultArgs)
Deprecated.
Creates the application with the specified resource bundle.
|
IlvDiagrammerApplication(String[] defaultArgs)
Deprecated.
Creates the application with the default resource bundle
"ilog.views.diagrammer.application.application" . |
Modifier and Type | Method and Description |
---|---|
protected IlvDiagrammer |
createDiagrammer()
Deprecated.
Creates a new diagram component.
|
JFrame |
createFrame()
Deprecated.
Creates the frame of this application.
|
protected JToolBar[] |
createPaletteToolBars()
Deprecated.
Creates the palette toolbar(s) for this application.
|
protected IlvDiagrammerStatusBar |
createStatusBar()
Deprecated.
Creates the status bar for this application.
|
void |
destroy()
Deprecated.
Called when this class is run as an applet, when the applet is destroyed.
|
void |
error(ResourceBundle bundle,
String messageKey,
Object[] args,
Throwable t)
Deprecated.
Displays an error message.
|
protected void |
exit()
Deprecated.
Exits this application.
|
Container |
getApplicationContentPane()
Deprecated.
Returns the container of the application or applet, that is,
the container that was passed as the
contentPane
argument to the init(java.awt.Container) method. |
URL |
getBaseURL()
Deprecated.
Returns a URL that can be used to resolve relative URLs for loading
data files.
|
ResourceBundle |
getBundle()
Deprecated.
Returns the resource bundle used to get localized messages for
this application.
|
IlvDiagrammer |
getCurrentDiagrammer()
Deprecated.
Returns the currently active diagram component.
|
JDesktopPane |
getDesktopPane()
Deprecated.
Returns the desktop pane of this application if it is in multidocument (MDI) mode,
or
null if it is in single-document (SDI) mode. |
IlvDiagrammer[] |
getDiagrammers()
Deprecated.
Returns all the diagram components displayed by the application.
|
IlvDiagrammerToolBar |
getEditToolBar()
Deprecated.
Returns the edit toolbar.
|
IlvDiagrammerMenuBar |
getMenuBar()
Deprecated.
Returns the menu bar.
|
IlvDiagrammerOverview |
getOverview()
Deprecated.
Returns the overview component.
|
JToolBar[] |
getPaletteToolBars()
Deprecated.
Returns the palette toolbars.
|
IlvDiagrammerPropertySheet |
getPropertySheet()
Deprecated.
Returns the property sheet.
|
JPanel |
getSdiContainer()
Deprecated.
Returns the container of the (single) diagram component when this
application is in single-document (SDI) mode.
|
IlvDiagrammer |
getSdiDiagrammer()
Deprecated.
Returns the (single) diagram component when this
application is in single-document (SDI) mode.
|
IlvDiagrammerStatusBar |
getStatusBar()
Deprecated.
Returns the status bar.
|
URL |
getStyleSheetURL()
Deprecated.
Returns the default style sheet used by this application.
|
IlvDiagrammerTable |
getTable()
Deprecated.
Returns the table component.
|
IlvDiagrammerTree |
getTree()
Deprecated.
Returns the tree component.
|
IlvDiagrammerToolBar |
getViewToolBar()
Deprecated.
Returns the view toolbar.
|
void |
init()
Deprecated.
Called when this class is run as an applet.
|
void |
init(Container contentPane)
Deprecated.
This method is called both when the class is run as an application and when
it is run as an applet.
|
void |
init(String[] args)
Deprecated.
This method initializes a new instance of this class when it is run as
an application.
|
boolean |
isApplet()
Deprecated.
Returns
true if this class is run as an applet. |
boolean |
isEditMode()
Deprecated.
Returns
true if the application is in editing mode. |
boolean |
isFloatable()
Deprecated.
Decides if the tool bars are floatable or not.
|
boolean |
isJnlp()
Deprecated.
Returns
true if this class is run with JNLP. |
boolean |
isMdi()
Deprecated.
Returns
true if the application is in multidocument (MDI) mode. |
boolean |
isOverviewVisible()
Deprecated.
Returns
true if the overview is visible. |
boolean |
isPropertySheetVisible()
Deprecated.
Returns
true if the property sheet is visible. |
boolean |
isTableVisible()
Deprecated.
Returns
true if the table is visible. |
boolean |
isTreeVisible()
Deprecated.
Returns
true if the tree is visible. |
boolean |
isUseAutomaticWaitCursor()
Deprecated.
Tests if the wait cursor is shown automatically.
|
static void |
main(String[] args)
Deprecated.
The main method of the application.
|
protected IlvDiagrammer |
newDiagram()
Deprecated.
Creates a new diagram component in the application.
|
void |
parseArgs(String[] args)
Deprecated.
Parses the command-line arguments.
|
protected void |
ready()
Deprecated.
This method is called when the GUI is set up, after the application is
made displayable.
|
void |
setDefaultArgs(String[] defaultArgs)
Deprecated.
Sets the default command-line arguments.
|
void |
setOverviewVisible(boolean visible)
Deprecated.
Shows or hides the overview.
|
void |
setPropertySheetVisible(boolean visible)
Deprecated.
Shows or hides the property sheet.
|
void |
setStyleSheetURL(URL styleSheetURL)
Deprecated.
Changes the default style sheet used by this application.
|
void |
setTableVisible(boolean visible)
Deprecated.
Shows or hides the table.
|
void |
setTreeVisible(boolean visible)
Deprecated.
Shows or hides the tree.
|
void |
setUseAutomaticWaitCursor(boolean flag)
Deprecated.
Sets whether the wait cursor is displayed as soon as a mouse click
causes any action that needs a runtime of more than 100 ms.
|
void |
start()
Deprecated.
Called when this class is run as an applet, when the applet is started.
|
void |
stop()
Deprecated.
Called when this class is run as an applet, when the applet is stopped.
|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public IlvDiagrammerApplication(ResourceBundle bundle, String[] defaultArgs)
bundle
- The resource bundle to use instead of the default
resource bundle.defaultArgs
- You can pass default command-line arguments that will be used
if they are not overridden on the command line or in the HTML element for the applet.
For example, you can pass "-tree -psheet -edit" to start in editing mode with the
tree and the property sheet visible.public IlvDiagrammerApplication(String[] defaultArgs)
"ilog.views.diagrammer.application.application"
.defaultArgs
- You can pass default command-line arguments that will be used
if they are not overridden on the command line or in the HTML element for the applet.
For example, you can pass "-tree -psheet -edit" to start in editing mode with the
tree and the property sheet visible.public IlvDiagrammerApplication()
"ilog.views.diagrammer.application.application"
and with no default command-line arguments. Note that you can
set the default arguments later using the setDefaultArgs(java.lang.String[])
method.public static void main(String[] args)
args
- The command-line arguments.public ResourceBundle getBundle()
public JDesktopPane getDesktopPane()
null
if it is in single-document (SDI) mode.public boolean isEditMode()
true
if the application is in editing mode.public boolean isMdi()
true
if the application is in multidocument (MDI) mode.public IlvDiagrammerMenuBar getMenuBar()
public JToolBar[] getPaletteToolBars()
public IlvDiagrammerToolBar getEditToolBar()
public IlvDiagrammerToolBar getViewToolBar()
public IlvDiagrammerStatusBar getStatusBar()
public JPanel getSdiContainer()
public IlvDiagrammer getSdiDiagrammer()
public URL getStyleSheetURL()
public void setStyleSheetURL(URL styleSheetURL)
styleSheetURL
- the new style sheetpublic IlvDiagrammerTable getTable()
public IlvDiagrammerTree getTree()
public IlvDiagrammerOverview getOverview()
public IlvDiagrammerPropertySheet getPropertySheet()
public void setTreeVisible(boolean visible)
visible
- new valuepublic boolean isTreeVisible()
true
if the tree is visible.public void setPropertySheetVisible(boolean visible)
visible
- new valuepublic boolean isPropertySheetVisible()
true
if the property sheet is visible.public void setOverviewVisible(boolean visible)
visible
- new valuepublic boolean isOverviewVisible()
true
if the overview is visible.public void setTableVisible(boolean visible)
visible
- new valuepublic boolean isTableVisible()
true
if the table is visible.public IlvDiagrammer getCurrentDiagrammer()
null
.public IlvDiagrammer[] getDiagrammers()
public void setDefaultArgs(String[] defaultArgs)
Note that this method can be called only before the application is initialized,
that is, before its init(java.awt.Container)
method is called.
Typically, you will write a subclass and set the default arguments in the
constructor. If this method is called after init(java.awt.Container)
has been called, an exception is thrown.
defaultArgs
- The default command-line arguments.public void init(String[] args)
init(java.awt.Container)
method.
This method is typically called from the main
method when
this class is derived:
public class MyDiagrammerApplication extends IlvDiagrammerApplication { public static void main(String[] args) { new MyDiagrammerApplication().init(args); } }
args
- The command-line arguments passed to the main
method.public void init()
public boolean isApplet()
true
if this class is run as an applet.public boolean isJnlp()
true
if this class is run with JNLP.public void start()
public void stop()
public void destroy()
public void parseArgs(String[] args)
args
- The command-line arguments. If null
,
the class is assumed to be run as an applet, and the arguments will be read
by calling the getParameter
method of the applet.public URL getBaseURL() throws MalformedURLException
MalformedURLException
public JFrame createFrame()
public void init(Container contentPane)
For an applet, this method is called from init()
.
For an application,
it is called from init(java.lang.String[])
, which is itself
called from main(java.lang.String[])
.
contentPane
- The panel in which the GUI will be created.public boolean isUseAutomaticWaitCursor()
true
is returned.public void setUseAutomaticWaitCursor(boolean flag)
This method activates the wait cursor mechanism via the event dispatch loop, hence the automatic wait cursor becomes effective with some delay. If modal dialogs are still open while this method is called, the effect will only be visible after all model dialogs are closed.
flag
- Set to true
so the wait cursor is displayed
automatically. The default value is true
.public boolean isFloatable()
public Container getApplicationContentPane()
contentPane
argument to the init(java.awt.Container)
method.protected void ready()
protected JToolBar[] createPaletteToolBars() throws Exception
The default implementation creates one IlvDiagrammerPaletteBar
whose contents are specified by the paletteURL
command-line
(or applet) parameter.
Subclasses can override this method to create more palette toolbars if necessary.
Exception
- If an error occurred while loading a toolbar.protected IlvDiagrammerStatusBar createStatusBar()
protected IlvDiagrammer newDiagram()
This method can be overridden if you need to perform custom operations
when a new diagram is created. If you need to create an instance of a
subclass of IlvDiagrammer
, you should
override createDiagrammer()
instead.
null
if the new diagram component
was not created (this can happen in single-document mode if the diagram
has been modified but the user clicked "No" in the confirmation box).protected IlvDiagrammer createDiagrammer()
newDiagram()
.
It can be overridden if you need to use a subclass of
IlvDiagrammer
.
The default implementation returns new IlvDiagrammer()
.IlvDiagrammer
.protected void exit()
frame
parameter set to true
), the frame is closed
and the applet is stopped. If the class is running as an application, this method calls
System.exit(0)
.public void error(ResourceBundle bundle, String messageKey, Object[] args, Throwable t)
bundle
- The set of resources used for localized messages.messageKey
- The message key, retrieved from the application's resource bundle.args
- The message arguments, if the message needs formatting.t
- The Throwable instance that caused the error, or null
.ComponentAction.error(java.awt.Component, java.util.ResourceBundle, java.lang.String, java.lang.Object[], java.lang.Throwable)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.