| javax.swing.JApplet biz.hammurapi.web.diagrameditor.DiagramEditorApplet
DiagramEditorApplet | public class DiagramEditorApplet extends JApplet (Code) | | Diagram editor applet.
|
Method Summary | |
protected void | addActions(JGraphEditor editor, JGraphEditorKit kit) Adds the action bundles for
JGraphpadEditAction ,
JGraphpadFileAction ,
JGraphpadViewAction ,
JGraphpadFormatAction and
JGraphpadCellAction . | protected void | addPorts(MutableTreeNode parent, Point2D[] offsets) Adds ports to parent using offsets as the
port relative offsets. | protected void | addTools(JGraphEditor editor, JGraphEditorKit kit) Adds the following tools to kit :
DiagramEditorApplet.NAME_SELECTTOOL ,
DiagramEditorApplet.NAME_VERTEXTOOL ,
DiagramEditorApplet.NAME_ROUNDEDTOOL ,
DiagramEditorApplet.NAME_CIRCLETOOL ,
DiagramEditorApplet.NAME_DIAMONDTOOL ,
DiagramEditorApplet.NAME_TRIANGLETOOL ,
DiagramEditorApplet.NAME_IMAGETOOL ,
DiagramEditorApplet.NAME_HEAVYTOOL ,
DiagramEditorApplet.NAME_EDGETOOL and
DiagramEditorApplet.NAME_ORTHOGONALEDGETOOL . | protected void | configureEdge(GraphCell edge) Hook for subclassers to configure the specified edge. | protected void | configureFactory(JGraphEditor editor, JGraphEditorFactory factory) Hook for subclassers to configure new editor factories. | protected void | configureGraph(JGraphEditor editor, JGraph graph) Hook for subclassers to configure a new graph. | protected void | configureKit(JGraphEditor editor, JGraphEditorKit kit) Boilerplate method for configuring new editor kits. | protected void | configureModel(JGraphEditorModel model) Hook for subclassers to configure new document models. | public void | configurePort(GraphCell port, Point2D offset) Hook for subclassers to configure the specified port using the
offset as the relative location. | protected void | configureVertex(GraphCell vertex) Hook for subclassers to configure the specified vertex. | protected AttributeMap | createAttributeMap() Hook for subclassers to construct attribute map for cells. | public DefaultEdge | createEdge() Hook for subclassers to construct edgges with default user objects. | public DefaultEdge | createEdge(Object userObj) Returns a new DefaultEdge containing the specified user object. | protected JGraphpadEdgeTool | createEdgeTool(String name, Object defaultValue, Edge.Routing routing) Helper method to create and return a new edge tool. | protected Object | createEdgeUserObject(Object value) Hook for subclassers to create a user object for edges that contains the
specified value. | protected JGraphEditorFactory | createFactory(JGraphEditor editor) Constructs a default factory for new editors. | protected JGraph | createGraph(JGraphEditor editor, GraphLayoutCache graphLayoutCache) Hook for subclassers to provide a custom graph for the user interface.
This method is invoked by the default custom factory returned by the
createEditorFactory method. | public GraphCell | createGroup() Hook for subclassers to construct groups with default user objects. | public GraphCell | createGroup(Object userObj) Returns a new DefaultGraphCell containing the specified user object. | protected void | createPlugins(JGraphEditor editor) Hook for subclassers to create plugins for a new editor. | public GraphCell | createPort(MutableTreeNode parent, Object userObject) Creates a port containing the specified user object and adds it to
parent .
Parameters: userObject - The user object that the port should contain. | protected Object | createPortUserObject(Object value) Hook for subclassers to create a user object for ports that contains the
specified value. | protected JGraphEditorSettings | createSettings(Map args) Constructs the editor settings. | public GraphCell | createVertex() Hook for subclassers to construct vertices with default user objects. | public GraphCell | createVertex(Object userObj) Returns a new DefaultGraphCell containing the specified user object. | protected JGraphpadVertexTool | createVertexTool(String name, Object defaultValue, int shape, ImageIcon icon) Invokes
DiagramEditorApplet.createVertexTool(String,Object,int,ImageIcon,boolean) with
post editing set to false. | protected JGraphpadVertexTool | createVertexTool(String name, Object defaultValue, int shape, ImageIcon icon, boolean postEdit) Helper method to create and return a new vertex tool. | protected Object | createVertexUserObject(Object value) Returns a new
JGraphpadBusinessObject for the specified value.
This implementation replaces all null values with an empty
JGraphpadRichTextValue .
Parameters: value - The value that the user object should contain. | public void | destroy() | public String | getFileDescription() | public String | getFileName() | public static boolean | isImage(String filename) Returns true if the specified filename has an image extension, namely one
in
javax.imageio.ImageIO.getReaderFormatNames .
Parameters: filename - The filename to be checked. | public static void | main(String[] args) Constructs and displays a new application window. | public void | setFileDescription(String text) | public void | setFileName(String text) | public void | start() | public void | stop() |
APPTITLE | final public static String APPTITLE(Code) | | Holds the application title for dialogs.
|
ARG_JGOODIESLOOKANDFEEL | final public static String ARG_JGOODIESLOOKANDFEEL(Code) | | Defines the look and feel argument name.
|
ARG_SYSTEMLOOKANDFEEL | final public static String ARG_SYSTEMLOOKANDFEEL(Code) | | Defines the look and feel argument name.
|
ARG_VERSION | final public static String ARG_VERSION(Code) | | Defines the look and feel argument name.
|
KEY_EDGEPROTOTYPE | final public static String KEY_EDGEPROTOTYPE(Code) | | Defines the key used to identify the edge prototype settings.
|
KEY_GROUPPROTOTYPE | final public static String KEY_GROUPPROTOTYPE(Code) | | Defines the key used to identify the group prototype settings.
|
KEY_VERTEXPROTOTYPE | final public static String KEY_VERTEXPROTOTYPE(Code) | | Defines the key used to identify the vertex prototype settings.
|
METHOD_CREATEGRADIENTCOMBO | final public static String METHOD_CREATEGRADIENTCOMBO(Code) | | Defines the name of the createGradientCombo factory method.
|
METHOD_CREATELINECOLORCOMBO | final public static String METHOD_CREATELINECOLORCOMBO(Code) | | Defines the name of the createGradientCombo factory method.
|
METHOD_CREATESHAPECOMBO | final public static String METHOD_CREATESHAPECOMBO(Code) | | Defines the name of the createShapeCombo factory method.
|
NAME_CIRCLETOOL | final public static String NAME_CIRCLETOOL(Code) | | Defines the name for the circleTool.
|
NAME_CYLINDERTOOL | final public static String NAME_CYLINDERTOOL(Code) | | Defines the name for the diamondTool.
|
NAME_DIAMONDTOOL | final public static String NAME_DIAMONDTOOL(Code) | | Defines the name for the diamondTool.
|
NAME_EDGETOOL | final public static String NAME_EDGETOOL(Code) | | Defines the name for the edgeTool.
|
NAME_HEAVYTOOL | final public static String NAME_HEAVYTOOL(Code) | | Defines the name for the imageTool.
|
NAME_IMAGETOOL | final public static String NAME_IMAGETOOL(Code) | | Defines the name for the imageTool.
|
NAME_ORTHOGONALEDGETOOL | final public static String NAME_ORTHOGONALEDGETOOL(Code) | | Defines the name for the orthogonalEdgeTool.
|
NAME_ROUNDEDTOOL | final public static String NAME_ROUNDEDTOOL(Code) | | Defines the name for the roundedTool.
|
NAME_SELECTTOOL | final public static String NAME_SELECTTOOL(Code) | | Defines the name for the selectTool.
|
NAME_TEXTTOOL | final public static String NAME_TEXTTOOL(Code) | | Defines the name for the textTool.
|
NAME_TRIANGLETOOL | final public static String NAME_TRIANGLETOOL(Code) | | Defines the name for the triangleTool.
|
NAME_UICONFIG | final public static String NAME_UICONFIG(Code) | | Defines the name for the ui XML document in the editor settings.
|
NAME_VERTEXTOOL | final public static String NAME_VERTEXTOOL(Code) | | Defines the name for the vertexTool.
|
PATH_DEFAULTSETTINGS | final public static String PATH_DEFAULTSETTINGS(Code) | | Defines the path the the user settings file. This should also work with
URLs (untested).
|
PATH_UICONFIG | final public static String PATH_UICONFIG(Code) | | Defines the path to the UI config file.
|
VERSION | final public static String VERSION(Code) | | Global static product identifier.
|
VERSION_NUMBER | final public static String VERSION_NUMBER(Code) | | Global static product identifier.
|
defaultBorderColor | public Color defaultBorderColor(Code) | | Defines the default border color.
|
defaultBounds | public Rectangle2D defaultBounds(Code) | | Defines the default vertex bounds.
|
defaultEdgeFont | public Font defaultEdgeFont(Code) | | Defines the default edge font.
|
defaultEndDecorationdefaultBeginDecoration | public int defaultEndDecorationdefaultBeginDecoration(Code) | | Defines the default end and begin decorations for edges.
|
defaultPlugins | public String[] defaultPlugins(Code) | | The class names for the defaut plugins.
|
defaultPortLocations | public Point2D[] defaultPortLocations(Code) | | Defines the default port locations.
|
DiagramEditorApplet | public DiagramEditorApplet()(Code) | | |
addActions | protected void addActions(JGraphEditor editor, JGraphEditorKit kit)(Code) | | Adds the action bundles for
JGraphpadEditAction ,
JGraphpadFileAction ,
JGraphpadViewAction ,
JGraphpadFormatAction and
JGraphpadCellAction . Uses the
createVertex and createEdge method to construct prototypes for
JGraphpadCellAction.NAME_GROUP and
JGraphpadCellAction.NAME_CONNECT . This method is called from
configureEditorKit.
Parameters: editor - The editor for which to create the actions. Parameters: kit - The editor kit to add the actions to. See Also: DiagramEditorApplet.configureKit(JGraphEditor,JGraphEditorKit) See Also: JGraphEditorKit.addBundle(JGraphEditorAction.Bundle) See Also: DiagramEditorApplet.createVertex() See Also: DiagramEditorApplet.createEdge() |
addTools | protected void addTools(JGraphEditor editor, JGraphEditorKit kit)(Code) | | Adds the following tools to kit :
DiagramEditorApplet.NAME_SELECTTOOL ,
DiagramEditorApplet.NAME_VERTEXTOOL ,
DiagramEditorApplet.NAME_ROUNDEDTOOL ,
DiagramEditorApplet.NAME_CIRCLETOOL ,
DiagramEditorApplet.NAME_DIAMONDTOOL ,
DiagramEditorApplet.NAME_TRIANGLETOOL ,
DiagramEditorApplet.NAME_IMAGETOOL ,
DiagramEditorApplet.NAME_HEAVYTOOL ,
DiagramEditorApplet.NAME_EDGETOOL and
DiagramEditorApplet.NAME_ORTHOGONALEDGETOOL . This method is called from
configureEditorKit.
Parameters: editor - The editor for which to create the tools. Parameters: kit - The editor kit to add the tools to. See Also: DiagramEditorApplet.configureKit(JGraphEditor,JGraphEditorKit) See Also: JGraphEditorKit.addTool(JGraphEditorTool) See Also: DiagramEditorApplet.createVertexTool(String,Object,int,ImageIcon) See Also: DiagramEditorApplet.createEdgeTool(String,String,Edge.Routing) |
configureFactory | protected void configureFactory(JGraphEditor editor, JGraphEditorFactory factory)(Code) | | Hook for subclassers to configure new editor factories. This
implementation adds various following factory methods.
Parameters: editor - The editor to create the factory methods for. Parameters: factory - The factory to be configured. |
configureGraph | protected void configureGraph(JGraphEditor editor, JGraph graph)(Code) | | Hook for subclassers to configure a new graph. This implementation adds a
JGraphpadTransferHandler and
JGraphpadMarqueeHandler to
the instance. (Note:
DiagramEditorApplet.createVertex() is used to create the
prototype cell for the transfer handler.)
Parameters: graph - The graph to be configured |
configureModel | protected void configureModel(JGraphEditorModel model)(Code) | | Hook for subclassers to configure new document models. This
implementation adds persistence delegates for the following classes:
JGraphpadDiagram ,
JGraphpadGraphModel ,
com.jgraph.graph.ConnectionSet,
JGraphpadGraphLayoutCache ,
com.jgraph.graph.DefaultGraphCell, com.jgraph.graph.DefaultEdge,
com.jgraph.graph.DefaultPort,
JGraphpadBusinessObject ,
JGraphpadRichTextValue and
JGraphpadShadowBorder .
JGraphpadDiagram
Constructs a persistence delegate for the diagram class. This uses the
fact that all information is stored in the model, not the layout cache by
ignoring the layout cache and accessing the model stored in the layout
cache directly through the model bean property. Note: To allow this kind
of encoding the diagram class offers a special constructor that takes a
model and constructs a new graph layout cache for it.
JGraphpadGraphModel
To encode graph models we do not want the files to contain redundant
connectivity information in the ports.edges and edges.source and target
fields, so we add a method to the graph model that returns a connection
set which describes the connections without redundancy. (Note: In the
static initializer of this class we make sure that the edges, source and
target of the respective classes or not encoded.)
ConnectionSet
The complete information of a connection set is stored in the actual
connections, thus we only store the connections and use special
constructor to restore the state of the complete object when de- coding.
(Note: For connection sets this will update the edges field.)
JGraphpadGraphLayoutCache
The graph layout cache is encoded by encoding the various member fields,
using a special constructor to restore the state of the layout cache upon
decoding. Note that this is currently not used.
DefaultGraphCell, DefaultEdge, DefaultPort
Makes sure the cells are only encoded along with their user objects, the
attributes, connections and tree-structure is stored in other objects and
does not need to be encoded here.
JGraphpadBusinessObject, JGraphpadRichTextData
Allows to encode custom business objects used in JGraphpad. Since this
object implements the bean interface we do only require a default
persistence delegates with no special constructor calls to decode the
object. Same holds for the rich text data object, which is a special
value that can hold text formatting information.
JGraphShadowBorder
Since the shadow border is a singleton we must tell the decoder which
method to use in order to find the shared instance of the class.
Parameters: model - The document model to be configured. |
configurePort | public void configurePort(GraphCell port, Point2D offset)(Code) | | Hook for subclassers to configure the specified port using the
offset as the relative location.
Parameters: port - The port to be configured. Parameters: offset - The relative offset of the port. |
createAttributeMap | protected AttributeMap createAttributeMap()(Code) | | Hook for subclassers to construct attribute map for cells. This
implementation returns a new instance of
AttributeMap .
Returns a new attribute map. |
createEdgeTool | protected JGraphpadEdgeTool createEdgeTool(String name, Object defaultValue, Edge.Routing routing)(Code) | | Helper method to create and return a new edge tool. This passes the
return value of createEdgeUserObject to createEdge to create the graph
cell. The method sets the routing on the created graph cell if it is not
null , and returns a new JGraphpadEdgeTool with the
specified name.
Parameters: name - The name of the tool to be created. Parameters: defaultValue - The defaultValue for the edges that this tool creates. Parameters: routing - The routing for the edges that this tool creates. Returns a new edge tool. See Also: DiagramEditorApplet.createEdgeUserObject(Object) See Also: DiagramEditorApplet.createEdge(Object) See Also: GraphConstants.setRouting(MapEdge.Routing) See Also: JGraphpadEdgeTool |
createEdgeUserObject | protected Object createEdgeUserObject(Object value)(Code) | | Hook for subclassers to create a user object for edges that contains the
specified value. This implementation calls
DiagramEditorApplet.createVertexUserObject(Object) .
Parameters: value - The value that the user object should contain. Returns a new user object containing value . |
createPort | public GraphCell createPort(MutableTreeNode parent, Object userObject)(Code) | | Creates a port containing the specified user object and adds it to
parent .
Parameters: userObject - The user object that the port should contain. Returns a new port. |
createPortUserObject | protected Object createPortUserObject(Object value)(Code) | | Hook for subclassers to create a user object for ports that contains the
specified value. This implementation calls
DiagramEditorApplet.createVertexUserObject(Object) .
Parameters: value - The value that the user object should contain. Returns a new user object containing value . |
createSettings | protected JGraphEditorSettings createSettings(Map args)(Code) | | Constructs the editor settings. This implementation constructs a new
instance of JGraphEditorSettings using args as the initial object map and
passes it to the
DiagramEditorApplet.configureSettings(JGraphEditorSettings) method.
Parameters: args - The arguments passed to the command line. Returns a configured editor settings object. |
createVertexTool | protected JGraphpadVertexTool createVertexTool(String name, Object defaultValue, int shape, ImageIcon icon, boolean postEdit)(Code) | | Helper method to create and return a new vertex tool. This uses the
createVertexUserObject or creates a new
JGraphpadRichTextValue object based on isRichText as the user object, which it
passes to createVertex to create the graph cell. The method sets the
shape on the created graph cell, and returns a new JGraphpadVertexTool
with the specified name.
Parameters: name - The name of the tool to be created. Parameters: defaultValue - The defaultValue for the vertices that this tool creates. Parameters: shape - The shape for the vertices that this tool creates. Use -1 forno border. Parameters: icon - The icon for the vertices that this tool creates. Parameters: postEdit - If in-place editing should be triggered after inserting thecell. Returns a new vertex tool. See Also: JGraphpadRichTextValue See Also: DiagramEditorApplet.createVertexUserObject(Object) See Also: DiagramEditorApplet.createVertex(Object) See Also: JGraphpadGraphConstants.setVertexShape(Mapint) See Also: JGraphpadVertexTool |
createVertexUserObject | protected Object createVertexUserObject(Object value)(Code) | | Returns a new
JGraphpadBusinessObject for the specified value.
This implementation replaces all null values with an empty
JGraphpadRichTextValue .
Parameters: value - The value that the user object should contain. Returns a new user object containing value . See Also: JGraphpadBusinessObject |
destroy | public void destroy()(Code) | | |
isImage | public static boolean isImage(String filename)(Code) | | Returns true if the specified filename has an image extension, namely one
in
javax.imageio.ImageIO.getReaderFormatNames .
Parameters: filename - The filename to be checked. Returns true if the filename is an image file. |
main | public static void main(String[] args) throws Exception(Code) | | Constructs and displays a new application window.
|
setFileDescription | public void setFileDescription(String text)(Code) | | |
start | public void start()(Code) | | |
|
|