Java Doc for JGraphpad.java in  » Graphic-Library » jgraphpad » com » jgraph » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Graphic Library » jgraphpad » com.jgraph 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jgraph.JGraphpad

All known Subclasses:   com.jgraph.JGraphpadDemo,
JGraphpad
public class JGraphpad (Code)
Class that constructs a new editor by creating a custom document model, kit and factory. The document model defines the persistence delegates for xml encoding, the kit and factory contain tools, actions and factory methods respectively. The class also constructs all plugins and provides the methods for creating the custom graph, graph cells and user objects to be used in this editor and to exit the application. For this purpose it provides two inner anonymous classes which override the respective methods, namely JGraphEditor.exit(int) and JGraphEditorFactory.createGraph(GraphLayoutCache) editor's exit method and the factory's createGraph method.


Field Summary
public static  StringAPPTITLE
     Holds the application title for dialogs.
public static  StringARG_JGOODIESLOOKANDFEEL
     Defines the look and feel argument name.
public static  StringARG_SYSTEMLOOKANDFEEL
     Defines the look and feel argument name.
public static  StringARG_VERSION
     Defines the look and feel argument name.
public static  booleanINNER_LIBRARIES
     Specifies if libraries should reside inside documents.
public static  StringKEY_EDGEPROTOTYPE
     Defines the key used to identify the edge prototype settings.
public static  StringKEY_GROUPPROTOTYPE
     Defines the key used to identify the group prototype settings.
public static  StringKEY_MAINWINDOW
     Defines the key used to identify the main window settings.
public static  StringKEY_RECENTFILES
     Defines the key used to identify the recent files settings.
public static  StringKEY_VERTEXPROTOTYPE
     Defines the key used to identify the vertex prototype settings.
final public static  StringMETHOD_CREATEGRADIENTCOMBO
     Defines the name of the createGradientCombo factory method.
final public static  StringMETHOD_CREATELINECOLORCOMBO
     Defines the name of the createGradientCombo factory method.
final public static  StringMETHOD_CREATESHAPECOMBO
     Defines the name of the createShapeCombo factory method.
final public static  StringNAME_CIRCLETOOL
     Defines the name for the circleTool.
final public static  StringNAME_CYLINDERTOOL
     Defines the name for the diamondTool.
final public static  StringNAME_DIAMONDTOOL
     Defines the name for the diamondTool.
final public static  StringNAME_EDGETOOL
     Defines the name for the edgeTool.
final public static  StringNAME_HEAVYTOOL
     Defines the name for the imageTool.
final public static  StringNAME_IMAGETOOL
     Defines the name for the imageTool.
final public static  StringNAME_ORTHOGONALEDGETOOL
     Defines the name for the orthogonalEdgeTool.
final public static  StringNAME_ROUNDEDTOOL
     Defines the name for the roundedTool.
final public static  StringNAME_SELECTTOOL
     Defines the name for the selectTool.
public static  StringNAME_SETTINGSFILE
     Defines the filename for the settings file.
final public static  StringNAME_TEXTTOOL
     Defines the name for the textTool.
final public static  StringNAME_TRIANGLETOOL
     Defines the name for the triangleTool.
public static  StringNAME_UICONFIG
     Defines the name for the ui XML document in the editor settings.
public static  StringNAME_USERSETTINGS
     Defines the name for the user properties in the editor settings.
final public static  StringNAME_VERTEXTOOL
     Defines the name for the vertexTool.
public static  StringPATH_DEFAULTLIBRARY
     Defines the path to the UI config file.
public static  StringPATH_DEFAULTSETTINGS
     Defines the path the the user settings file.
public static  StringPATH_SPLASHIMAGE
     Defines the path to the splash image file.
public static  StringPATH_UICONFIG
     Defines the path to the UI config file.
public static  StringPATH_USERSETTINGS
     Defines the path the the user settings file.
final public static  StringUSAGE
     Defines the usage information (use --help), see http://java.sun.com/docs/books/tutorial/uiswing/misc/plaf.html#programmatic on setting the look and feel.
final public static  StringVERSION
     Global static product identifier.
final public static  StringVERSION_NUMBER
     Global static product identifier.
public  ColordefaultBorderColor
     Defines the default border color.
public  Rectangle2DdefaultBounds
     Defines the default vertex bounds.
public  FontdefaultEdgeFont
     Defines the default edge font.
public  intdefaultEndDecorationdefaultBeginDecoration
     Defines the default end and begin decorations for edges.
public  String[]defaultPlugins
     The class names for the defaut plugins.
public  Point2D[]defaultPortLocations
     Defines the default port locations.

Constructor Summary
public  JGraphpad()
     Constructs JGraphpad as an applet.

Method Summary
protected  voidaddActions(JGraphEditor editor, JGraphEditorKit kit)
     Adds the action bundles for JGraphpadEditAction , JGraphpadFileAction , JGraphpadViewAction , JGraphpadFormatAction and JGraphpadCellAction .
protected  voidaddPorts(MutableTreeNode parent, Point2D[] offsets)
     Adds ports to parent using offsets as the port relative offsets.
protected  voidaddTools(JGraphEditor editor, JGraphEditorKit kit)
     Adds the following tools to kit: JGraphpad.NAME_SELECTTOOL , JGraphpad.NAME_VERTEXTOOL , JGraphpad.NAME_ROUNDEDTOOL , JGraphpad.NAME_CIRCLETOOL , JGraphpad.NAME_DIAMONDTOOL , JGraphpad.NAME_TRIANGLETOOL , JGraphpad.NAME_IMAGETOOL , JGraphpad.NAME_HEAVYTOOL , JGraphpad.NAME_EDGETOOL and JGraphpad.NAME_ORTHOGONALEDGETOOL .
public static  voidcenter(Window wnd)
     Centers the specified window on the screen, taking into account the current size of the window.
protected  voidconfigureEdge(GraphCell edge)
     Hook for subclassers to configure the specified edge.
protected  voidconfigureEditor(JGraphEditor editor, Map args)
     Hook for subclassers to configure new editors.
protected  voidconfigureFactory(JGraphEditor editor, JGraphEditorFactory factory)
     Hook for subclassers to configure new editor factories.
protected  voidconfigureGraph(JGraphEditor editor, JGraph graph)
     Hook for subclassers to configure a new graph.
protected  voidconfigureKit(JGraphEditor editor, JGraphEditorKit kit)
     Boilerplate method for configuring new editor kits.
protected  voidconfigureModel(JGraphEditorModel model)
     Hook for subclassers to configure new document models.
public  voidconfigurePort(GraphCell port, Point2D offset)
     Hook for subclassers to configure the specified port using the offset as the relative location.
protected  voidconfigureSettings(JGraphEditorSettings settings)
     Hook for subclassers to configure new editor settings.
protected  voidconfigureVertex(GraphCell vertex)
     Hook for subclassers to configure the specified vertex.
public  WindowcreateApplication(List files, Map args)
     Constructs a new editor application and returns its main window.
protected  AttributeMapcreateAttributeMap()
     Hook for subclassers to construct attribute map for cells.
public  DefaultEdgecreateEdge()
     Hook for subclassers to construct edgges with default user objects.
public  DefaultEdgecreateEdge(Object userObj)
     Returns a new DefaultEdge containing the specified user object.
protected  JGraphpadEdgeToolcreateEdgeTool(String name, Object defaultValue, Edge.Routing routing)
     Helper method to create and return a new edge tool.
protected  ObjectcreateEdgeUserObject(Object value)
     Hook for subclassers to create a user object for edges that contains the specified value.
protected  JGraphEditorcreateEditor(Map args)
     Constructs a new JGraphEditor using the specified settings and document model model and calls JGraphpad.configureEditor(JGraphEditor,Map) on the new instance.
protected  JGraphEditorFactorycreateFactory(JGraphEditor editor)
     Constructs a default factory for new editors.
protected  JGraphcreateGraph(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  GraphCellcreateGroup()
     Hook for subclassers to construct groups with default user objects.
public  GraphCellcreateGroup(Object userObj)
     Returns a new DefaultGraphCell containing the specified user object.
protected  JGraphEditorKitcreateKit(JGraphEditor editor)
     Constructs a default kit for new editors.
protected  WindowcreateMainWindow(JGraphEditor editor, String factoryMethod)
     Helper method that invokes the specified factory method and configures the main window by setting its bounds and installing window listeners. This implementation invokes the exit action in the editor kit if the window is closed by the user.
Parameters:
  editor - The editor to create the main window for.
Parameters:
  factoryMethod - The name of the factory method to invoke.
protected  JGraphEditorModelcreateModel()
     Constructs a document model for new editors.
protected  voidcreatePlugins(JGraphEditor editor)
     Hook for subclassers to create plugins for a new editor.
public  GraphCellcreatePort(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  ObjectcreatePortUserObject(Object value)
     Hook for subclassers to create a user object for ports that contains the specified value.
protected  JGraphEditorSettingscreateSettings(Map args)
     Constructs the editor settings.
protected  WindowcreateSplashWindow()
     Constructs a splash window to be displayed during the construction of the application.
public  GraphCellcreateVertex()
     Hook for subclassers to construct vertices with default user objects.
public  GraphCellcreateVertex(Object userObj)
     Returns a new DefaultGraphCell containing the specified user object.
protected  JGraphpadVertexToolcreateVertexTool(String name, Object defaultValue, int shape, ImageIcon icon)
     Invokes JGraphpad.createVertexTool(String,Object,int,ImageIcon,boolean) with post editing set to false.
protected  JGraphpadVertexToolcreateVertexTool(String name, Object defaultValue, int shape, ImageIcon icon, boolean postEdit)
     Helper method to create and return a new vertex tool.
protected  ObjectcreateVertexUserObject(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.
protected  voidexit(int code)
     Hook for subclassers to implement the application exit method.
public static  booleanisImage(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  voidmain(String[] args)
     Constructs and displays a new application window.

Field Detail
APPTITLE
public static String APPTITLE(Code)
Holds the application title for dialogs.



ARG_JGOODIESLOOKANDFEEL
public static String ARG_JGOODIESLOOKANDFEEL(Code)
Defines the look and feel argument name.



ARG_SYSTEMLOOKANDFEEL
public static String ARG_SYSTEMLOOKANDFEEL(Code)
Defines the look and feel argument name.



ARG_VERSION
public static String ARG_VERSION(Code)
Defines the look and feel argument name.



INNER_LIBRARIES
public static boolean INNER_LIBRARIES(Code)
Specifies if libraries should reside inside documents. If this flag is true, then the navigator and libraries are inside the internal frames for documents. The libraries will be treated as part of their enclosing files. Default is false.



KEY_EDGEPROTOTYPE
public static String KEY_EDGEPROTOTYPE(Code)
Defines the key used to identify the edge prototype settings.



KEY_GROUPPROTOTYPE
public static String KEY_GROUPPROTOTYPE(Code)
Defines the key used to identify the group prototype settings.



KEY_MAINWINDOW
public static String KEY_MAINWINDOW(Code)
Defines the key used to identify the main window settings.



KEY_RECENTFILES
public static String KEY_RECENTFILES(Code)
Defines the key used to identify the recent files settings.



KEY_VERTEXPROTOTYPE
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_SETTINGSFILE
public static String NAME_SETTINGSFILE(Code)
Defines the filename for the settings file. Default is .jgraphpad.ini



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
public static String NAME_UICONFIG(Code)
Defines the name for the ui XML document in the editor settings.



NAME_USERSETTINGS
public static String NAME_USERSETTINGS(Code)
Defines the name for the user properties in the editor settings.



NAME_VERTEXTOOL
final public static String NAME_VERTEXTOOL(Code)
Defines the name for the vertexTool.



PATH_DEFAULTLIBRARY
public static String PATH_DEFAULTLIBRARY(Code)
Defines the path to the UI config file.



PATH_DEFAULTSETTINGS
public static String PATH_DEFAULTSETTINGS(Code)
Defines the path the the user settings file. This should also work with URLs (untested).



PATH_SPLASHIMAGE
public static String PATH_SPLASHIMAGE(Code)
Defines the path to the splash image file.



PATH_UICONFIG
public static String PATH_UICONFIG(Code)
Defines the path to the UI config file.



PATH_USERSETTINGS
public static String PATH_USERSETTINGS(Code)
Defines the path the the user settings file. This should also work with URLs (untested).



USAGE
final public static String USAGE(Code)
Defines the usage information (use --help), see http://java.sun.com/docs/books/tutorial/uiswing/misc/plaf.html#programmatic on setting the look and feel.



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.




Constructor Detail
JGraphpad
public JGraphpad()(Code)
Constructs JGraphpad as an applet.




Method Detail
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:   JGraphpad.configureKit(JGraphEditor,JGraphEditorKit)
See Also:   JGraphEditorKit.addBundle(JGraphEditorAction.Bundle)
See Also:   JGraphpad.createVertex()
See Also:   JGraphpad.createEdge()



addPorts
protected void addPorts(MutableTreeNode parent, Point2D[] offsets)(Code)
Adds ports to parent using offsets as the port relative offsets. The method uses JGraphpad.createPortUserObject(Object) , JGraphpad.createPort(MutableTreeNode,Object) and JGraphpad.configurePort(GraphCell,Point2D) to create the ports and their user objects, configure them and add them to the parent.
Parameters:
  parent - The parent to add the ports to.
Parameters:
  offsets - The points defining the port locations.



addTools
protected void addTools(JGraphEditor editor, JGraphEditorKit kit)(Code)
Adds the following tools to kit: JGraphpad.NAME_SELECTTOOL , JGraphpad.NAME_VERTEXTOOL , JGraphpad.NAME_ROUNDEDTOOL , JGraphpad.NAME_CIRCLETOOL , JGraphpad.NAME_DIAMONDTOOL , JGraphpad.NAME_TRIANGLETOOL , JGraphpad.NAME_IMAGETOOL , JGraphpad.NAME_HEAVYTOOL , JGraphpad.NAME_EDGETOOL and JGraphpad.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:   JGraphpad.configureKit(JGraphEditor,JGraphEditorKit)
See Also:   JGraphEditorKit.addTool(JGraphEditorTool)
See Also:   JGraphpad.createVertexTool(String,Object,int,ImageIcon)
See Also:   JGraphpad.createEdgeTool(String,String,Edge.Routing)



center
public static void center(Window wnd)(Code)
Centers the specified window on the screen, taking into account the current size of the window.
Parameters:
  wnd - The window to be centered.



configureEdge
protected void configureEdge(GraphCell edge)(Code)
Hook for subclassers to configure the specified edge. This implementation sets the JGraphpad.defaultEdgeFont , JGraphpad.defaultEndDecoration and JGraphpad.defaultBeginDecoration .
Parameters:
  edge - The edge to be configured.



configureEditor
protected void configureEditor(JGraphEditor editor, Map args) throws ParserConfigurationException, SAXException, IOException(Code)
Hook for subclassers to configure new editors. This implementation configures the editor kit and -factory and invokes JGraphpad.createPlugins(JGraphEditor) for the editor.
Parameters:
  editor - The editor to be configured.
Parameters:
  args - The arguments passed to createApplication.
throws:
  IOException -
throws:
  SAXException -
throws:
  ParserConfigurationException -
See Also:   JGraphpad.createKit(JGraphEditor)
See Also:   JGraphpad.createFactory(JGraphEditor)



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: JGraphpad.createVertex() is used to create the prototype cell for the transfer handler.)
Parameters:
  graph - The graph to be configured



configureKit
protected void configureKit(JGraphEditor editor, JGraphEditorKit kit)(Code)
Boilerplate method for configuring new editor kits. This implementation calls JGraphpad.addActions(JGraphEditor,JGraphEditorKit) , JGraphpad.addTools(JGraphEditor,JGraphEditorKit) and registers the kit with the listeners required to update the state. This method is called from JGraphpad.createKit(JGraphEditor) .
Parameters:
  editor - The editor for which to configure the editor kit.
Parameters:
  kit - The new editor kit 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.



configureSettings
protected void configureSettings(JGraphEditorSettings settings) throws MalformedURLException, FileNotFoundException, ParserConfigurationException, SAXException, IOException(Code)
Hook for subclassers to configure new editor settings. This implementation adds the ui configuration ( JGraphpad.PATH_UICONFIG ) to the JGraphpad.NAME_UICONFIG and user settings ( JGraphpad.PATH_USERSETTINGS ) to the JGraphpad.NAME_USERSETTINGS .
Parameters:
  settings - The editor settings to be configured.
throws:
  IOException -
throws:
  SAXException -
throws:
  ParserConfigurationException -
throws:
  FileNotFoundException -
throws:
  MalformedURLException -
See Also:   JGraphEditorSettings.parse(InputStream)
See Also:   JGraphEditorSettings.add(StringInputStream)



configureVertex
protected void configureVertex(GraphCell vertex)(Code)
Hook for subclassers to configure the specified vertex. This implementation sets the JGraphpad.defaultBorderColor and adds ports if the vertex implements the MutableTreeNode interface.
Parameters:
  vertex - The vertex to be configured.
See Also:   JGraphpad.addPorts(MutableTreeNode,Point2D[])



createApplication
public Window createApplication(List files, Map args) throws ParserConfigurationException, SAXException, IOException(Code)
Constructs a new editor application and returns its main window. Shows a splash window while the application is being constructed and returns the main window in visible state.
The parameters are obtained by parsing the arguments passed to the main method as follows. For all arguments -A B the value B is stored in the arguments under the A, for other arguments, eg. C D E the values C, D and E and passed in as elements of the list.
Parameters:
  files - The list of filenames passed to the Java command.
Parameters:
  args - The arguments to use for constructing the editor settings. Returns a new application main window.



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.



createEdge
public DefaultEdge createEdge()(Code)
Hook for subclassers to construct edgges with default user objects. This implementation invokes JGraphpad.createEdgeUserObject(Object) and passes the return value to JGraphpad.createEdge(Object) . Returns a new edge with a default user object.



createEdge
public DefaultEdge createEdge(Object userObj)(Code)
Returns a new DefaultEdge containing the specified user object. This implementation uses JGraphpad.createAttributeMap() to create the map that holds the attributes for the new edge and JGraphpad.configureEdge(GraphCell) to configure the edge.
Parameters:
  userObj - The user object that the edge should contain. Returns a new edge.



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:   JGraphpad.createEdgeUserObject(Object)
See Also:   JGraphpad.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 JGraphpad.createVertexUserObject(Object) .
Parameters:
  value - The value that the user object should contain. Returns a new user object containing value.



createEditor
protected JGraphEditor createEditor(Map args) throws ParserConfigurationException, SAXException, IOException(Code)
Constructs a new JGraphEditor using the specified settings and document model model and calls JGraphpad.configureEditor(JGraphEditor,Map) on the new instance. The returned instance has an overridden exit hook which disposes the main window and terminates the VM in the proper way for how the application was started.
Parameters:
  args - The arguments passed to createApplication. Returns a new configured editor.
throws:
  IOException -
throws:
  SAXException -
throws:
  ParserConfigurationException -



createFactory
protected JGraphEditorFactory createFactory(JGraphEditor editor)(Code)
Constructs a default factory for new editors. This implementation constructs a new instance of JGraphEditorFactory and overrides JGraphEditorFactory.createGraph(GraphLayoutCache) to call JGraphpad.createGraph(JGraphEditor,GraphLayoutCache) and configures the factory using JGraphpad.configureFactory(JGraphEditor,JGraphEditorFactory) .
Parameters:
  editor - The editor for which to create an editor factory. Returns a configured editor factory for the specified editor.



createGraph
protected JGraph createGraph(JGraphEditor editor, GraphLayoutCache graphLayoutCache)(Code)
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. It invokes JGraphpad.configureGraph(JGraphEditor,JGraph) to configure the new graph instance.
See Also:   JGraphpad.createFactory(JGraphEditor)



createGroup
public GraphCell createGroup()(Code)
Hook for subclassers to construct groups with default user objects. This implementation invokes JGraphpad.createVertexUserObject(Object) and passes the return value to JGraphpad.createGroup(Object) . Returns a new group with a default user object.



createGroup
public GraphCell createGroup(Object userObj)(Code)
Returns a new DefaultGraphCell containing the specified user object. This implementation uses JGraphpad.createAttributeMap() to create the map that holds the attributes for the new vertex, and JGraphpad.configureVertex(GraphCell) to configure the vertex.
Parameters:
  userObj - The user object that the group should contain. Returns a new group.



createKit
protected JGraphEditorKit createKit(JGraphEditor editor)(Code)
Constructs a default kit for new editors. This implementation constructs a new instance of JGraphEditorKit and passes it to JGraphpad.configureKit(JGraphEditor,JGraphEditorKit) .
Parameters:
  editor - The editor for which to create an editor kit. Returns a configured editor kit for the specified editor.



createMainWindow
protected Window createMainWindow(JGraphEditor editor, String factoryMethod)(Code)
Helper method that invokes the specified factory method and configures the main window by setting its bounds and installing window listeners. This implementation invokes the exit action in the editor kit if the window is closed by the user.
Parameters:
  editor - The editor to create the main window for.
Parameters:
  factoryMethod - The name of the factory method to invoke. Returns a new main window for the specified editor.
See Also:   JGraphEditorFactory.executeMethod(StringNode)
See Also:   JGraphEditorKit.getAction(String)
See Also:   JGraphpad.center(Window)



createModel
protected JGraphEditorModel createModel()(Code)
Constructs a document model for new editors. This implementation constructs a new instance of JGraphEditorModel and passes it to the JGraphpad.configureModel(JGraphEditorModel) method. Returns a configured document model for an editor.



createPlugins
protected void createPlugins(JGraphEditor editor)(Code)
Hook for subclassers to create plugins for a new editor. This implementation creates the JGraphpad.defaultPlugins . This method is called from JGraphpad.configureEditor(JGraphEditor,Map) .
Parameters:
  editor - The editor for which to create the plugins.



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 JGraphpad.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) throws ParserConfigurationException, SAXException, IOException(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 JGraphpad.configureSettings(JGraphEditorSettings) method.
Parameters:
  args - The arguments passed to the command line. Returns a configured editor settings object.



createSplashWindow
protected Window createSplashWindow()(Code)
Constructs a splash window to be displayed during the construction of the application. Returns a reference to the displaying splash window.



createVertex
public GraphCell createVertex()(Code)
Hook for subclassers to construct vertices with default user objects. This implementation invokes JGraphpad.createVertexUserObject(Object) and passes the return value to JGraphpad.createVertex(Object) . Returns a new vertex with a default user object.



createVertex
public GraphCell createVertex(Object userObj)(Code)
Returns a new DefaultGraphCell containing the specified user object. This implementation uses JGraphpad.createAttributeMap() to create the map that holds the attributes for the new vertex, and JGraphpad.configureVertex(GraphCell) to configure the vertex.
Parameters:
  userObj - The user object that the vertex should contain. Returns a new vertex.



createVertexTool
protected JGraphpadVertexTool createVertexTool(String name, Object defaultValue, int shape, ImageIcon icon)(Code)
Invokes JGraphpad.createVertexTool(String,Object,int,ImageIcon,boolean) with post editing set to false.



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:   JGraphpad.createVertexUserObject(Object)
See Also:   JGraphpad.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



exit
protected void exit(int code)(Code)
Hook for subclassers to implement the application exit method. This implementation calls System.exit with the specified 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)(Code)
Constructs and displays a new application window.
Parameters:
  args - The command line arguments to pass to the application.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.