Java Doc for JGraphEditorSettings.java in  » Graphic-Library » jgraphpad » com » jgraph » editor » 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.editor 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jgraph.editor.JGraphEditorSettings

JGraphEditorSettings
public class JGraphEditorSettings (Code)
Manages configuration files for a JGraph editor, namely XML documents and properties files and holds references to configured objects.

Inner Class :public interface ShutdownHook

Field Summary
final public static  StringATTRIBUTENAME_BEFORE
     XML attribute name for the before attribute.
final public static  StringATTRIBUTENAME_KEY
     XML attribute name for the key attribute.
public static  DocumentBuilderFactorydocumentBuilderFactory
     Document builder factory for parsing XML files.
protected  Mapdocumentspropertiesobjects
     Holds maps of (document, name), (properties, name) and (key, Object) pairs respectively.
protected  ListshutdownHooks
     List of hooks that are to be called on shutdown.

Constructor Summary
public  JGraphEditorSettings()
     Constructs new settings using an empty object map.
public  JGraphEditorSettings(Map objects)
     Constructs new settings using the passed-in object map.

Method Summary
public  voidadd(String name, Document doc)
     Adds the document under the specified name or merges doc into an existing document for name.
public  voidadd(String name, Properties props)
     Registers the specified properties under the specified name.
public  voidadd(String name, InputStream s)
     Adds the properties under a specified name from an input stream.
public  voidaddShutdownHook(ShutdownHook hook)
     Adds a shutdown hook which is called from JGraphEditorSettings.shutdown() normally when the program terminates.
public static  StringgetAttributeValue(Node node, String attributeName)
     Returns the textual representation of the attribute in node whos name is attributeName or null if no such attribute exists.
Parameters:
  node - The node whos attribute should be returned.
Parameters:
  attributeName - The name of the attribute whos value should be returned.
public  DocumentgetDocument(String name)
     Returns the document for the specified name or null if no such document exists.
Parameters:
  name - The name of the document to be returned.
public static  StringgetKeyAttributeValue(Node node)
     Returns the textual representation of the attribute in node whos name is equal to JGraphEditorSettings.ATTRIBUTENAME_KEY or null if no such node exists.
Parameters:
  node - The node whos attribute should be returned.
public static  NodegetNodeByAttribute(NodeList nodeList, String attributeName, String value)
     Returns the node in nodeList whos attribute named attributeName equals value or null if no such node exists.
Parameters:
  nodeList - The nodes to scan for the attribute value.
Parameters:
  attributeName - The name of the attribute to scan for.
Parameters:
  value - The value of the attribute to scan for.
public  NodegetNodeByName(String documentName, String name)
     Returns the first node for name in the document registered under documentName.
Parameters:
  documentName - The string that identifies the document to be used.
Parameters:
  name - The name of the node to be returned.
public static  NodegetNodeByName(NodeList nodeList, String name)
     Returns the first node in nodeList whos name equals name or null if no such node exists.
Parameters:
  nodeList - The list of nodes to scan for the name.
Parameters:
  name - The name of the node to search for.
public  ObjectgetObject(String key)
     Returns the object for the specified key.
Parameters:
  key - The key to return the object for.
public  PropertiesgetProperties(String name)
     Returns the properties registered under the specified name or null if no such properties exist.
Parameters:
  name - The name of the properties to return.
public  RectanglegetRectangleProperty(String name, String key)
     Gets the rectangle made up by 4 entries for the key -property from the properties called name.
Parameters:
  name - The name of the properties to get the rectangle from.
Parameters:
  key - The key to retrieve the rectangle values.
protected  voidmerge(Document document, Node parent, NodeList children, boolean useNames)
     Recursively replaces or appends children in parent for equal keys ( JGraphEditorSettings.ATTRIBUTENAME_KEY or node names, depending on useNames.
public static  Documentparse(InputStream in)
     Constructs a document object for an XML input stream using the JGraphEditorSettings.documentBuilderFactory .
Parameters:
  in - The input stream that represents the XML data.
public  voidpushListEntryProperty(String name, String key, String value, int maxCount)
     Pushes a new entry into the list for key in the properties called name with value, making sure the list has no more than maxCount entries.
public  voidputObject(String key, Object obj)
     Adds the specified object under key.
public  voidputRectangleProperty(String name, String key, Rectangle rect)
     Puts the rectangle as 4 entries for the key -property plus a suffix of .x, .y, .width and .height into the properties called name.
public  voidrestoreSplitPane(String name, String key)
     Restores the divider location for the split pane found in objects under key from the integer stored in the properties registered under name for the key property.
public  voidrestoreWindow(String name, String key)
     Restores the window bounds for the window found in objects under key from the rectangle stored in the properties registered under name for the key property.
public  voidshutdown()
     Invokes all hooks that have previously been added using addShutdownHook in reverse order (last added first).
public  voidstoreSplitPane(String name, String key)
     Stores the dividerlocation of the splitpane found in objects under key in the properties called name as a int property under key.
public  voidstoreWindow(String name, String key)
     Stores the bounds of the window found in objects under key in the properties called name as a rectangle property under key.

Field Detail
ATTRIBUTENAME_BEFORE
final public static String ATTRIBUTENAME_BEFORE(Code)
XML attribute name for the before attribute.



ATTRIBUTENAME_KEY
final public static String ATTRIBUTENAME_KEY(Code)
XML attribute name for the key attribute.



documentBuilderFactory
public static DocumentBuilderFactory documentBuilderFactory(Code)
Document builder factory for parsing XML files.
See Also:   javax.xml.parsers.DocumentBuilderFactory.newInstance



documentspropertiesobjects
protected Map documentspropertiesobjects(Code)
Holds maps of (document, name), (properties, name) and (key, Object) pairs respectively.



shutdownHooks
protected List shutdownHooks(Code)
List of hooks that are to be called on shutdown.




Constructor Detail
JGraphEditorSettings
public JGraphEditorSettings()(Code)
Constructs new settings using an empty object map.



JGraphEditorSettings
public JGraphEditorSettings(Map objects)(Code)
Constructs new settings using the passed-in object map.
Parameters:
  objects - The map to use as the initial objects map.




Method Detail
add
public void add(String name, Document doc)(Code)
Adds the document under the specified name or merges doc into an existing document for name.
Parameters:
  name - The name under which the document should be added.
Parameters:
  doc - The document to add.



add
public void add(String name, Properties props)(Code)
Registers the specified properties under the specified name.
Parameters:
  name - The name to register the properties under.
Parameters:
  props - The properties to register.



add
public void add(String name, InputStream s) throws IOException(Code)
Adds the properties under a specified name from an input stream. This method creates the properties using Properties.load(java.io.InputStream) and adds the properties using JGraphEditorSettings.add(String,Properties) .
Parameters:
  name - The name to register the properties under.
Parameters:
  s - The input stream to read the properties from.
throws:
  IOException - If the input stream cannot be read.



addShutdownHook
public void addShutdownHook(ShutdownHook hook)(Code)
Adds a shutdown hook which is called from JGraphEditorSettings.shutdown() normally when the program terminates.
Parameters:
  hook - The shutdown hook to be added.



getAttributeValue
public static String getAttributeValue(Node node, String attributeName)(Code)
Returns the textual representation of the attribute in node whos name is attributeName or null if no such attribute exists.
Parameters:
  node - The node whos attribute should be returned.
Parameters:
  attributeName - The name of the attribute whos value should be returned. Returns the value of attributeName innode.
See Also:   Node.getAttributes
See Also:   NamedNodeMap.getNamedItem(java.lang.String)
See Also:   Node.getNodeValue



getDocument
public Document getDocument(String name)(Code)
Returns the document for the specified name or null if no such document exists.
Parameters:
  name - The name of the document to be returned. Returns the backing document.



getKeyAttributeValue
public static String getKeyAttributeValue(Node node)(Code)
Returns the textual representation of the attribute in node whos name is equal to JGraphEditorSettings.ATTRIBUTENAME_KEY or null if no such node exists.
Parameters:
  node - The node whos attribute should be returned. Returns the value of JGraphEditorSettings.ATTRIBUTENAME_KEYinnode.
See Also:   JGraphEditorSettings.getAttributeValue(Node,String)



getNodeByAttribute
public static Node getNodeByAttribute(NodeList nodeList, String attributeName, String value)(Code)
Returns the node in nodeList whos attribute named attributeName equals value or null if no such node exists.
Parameters:
  nodeList - The nodes to scan for the attribute value.
Parameters:
  attributeName - The name of the attribute to scan for.
Parameters:
  value - The value of the attribute to scan for. Returns the first node that matches the search criteria.
See Also:   JGraphEditorSettings.getAttributeValue(Node,String)



getNodeByName
public Node getNodeByName(String documentName, String name)(Code)
Returns the first node for name in the document registered under documentName.
Parameters:
  documentName - The string that identifies the document to be used.
Parameters:
  name - The name of the node to be returned. Returns the first node for name indocumentName.



getNodeByName
public static Node getNodeByName(NodeList nodeList, String name)(Code)
Returns the first node in nodeList whos name equals name or null if no such node exists.
Parameters:
  nodeList - The list of nodes to scan for the name.
Parameters:
  name - The name of the node to search for. Returns the first node for name in nodeList.
See Also:   Node.getNodeName



getObject
public Object getObject(String key)(Code)
Returns the object for the specified key.
Parameters:
  key - The key to return the object for. Returns the object for key.



getProperties
public Properties getProperties(String name)(Code)
Returns the properties registered under the specified name or null if no such properties exist.
Parameters:
  name - The name of the properties to return. Returns the properties for name.



getRectangleProperty
public Rectangle getRectangleProperty(String name, String key)(Code)
Gets the rectangle made up by 4 entries for the key -property from the properties called name.
Parameters:
  name - The name of the properties to get the rectangle from.
Parameters:
  key - The key to retrieve the rectangle values. Returns the rectangle for key in name.
See Also:   JGraphEditorSettings.putRectangleProperty(String,String,Rectangle)



merge
protected void merge(Document document, Node parent, NodeList children, boolean useNames)(Code)
Recursively replaces or appends children in parent for equal keys ( JGraphEditorSettings.ATTRIBUTENAME_KEY or node names, depending on useNames. If the node to be added provides a before attribute and the node for the specified key exists in the parent's node list then the new node is inserted before the referenced node.
Parameters:
  document - The document to import the nodes into.
Parameters:
  parent - The parent node to replace or add ports.
Parameters:
  children - The children to add or replace.
Parameters:
  useNames - If names or keys should be used to check for node equality.



parse
public static Document parse(InputStream in) throws ParserConfigurationException, SAXException, IOException(Code)
Constructs a document object for an XML input stream using the JGraphEditorSettings.documentBuilderFactory .
Parameters:
  in - The input stream that represents the XML data. Return the parsed input stream as an XML document.



pushListEntryProperty
public void pushListEntryProperty(String name, String key, String value, int maxCount)(Code)
Pushes a new entry into the list for key in the properties called name with value, making sure the list has no more than maxCount entries. If the list is longer than maxCount, then the oldest entry will be removed.
Parameters:
  name - The name of the properties to store the list.
Parameters:
  key - The name of the key to store the list entries.
Parameters:
  value - The value of the new list entry.
Parameters:
  maxCount - The maximum number of elemnts in the list.



putObject
public void putObject(String key, Object obj)(Code)
Adds the specified object under key.
Parameters:
  key - The key to register the object under.
Parameters:
  obj - The object to register.



putRectangleProperty
public void putRectangleProperty(String name, String key, Rectangle rect)(Code)
Puts the rectangle as 4 entries for the key -property plus a suffix of .x, .y, .width and .height into the properties called name.
Parameters:
  name - The name of the properties to store the rectangle.
Parameters:
  key - The name of the key to store the rectangle size and location.
Parameters:
  rect - The rectangle to put into the properties.



restoreSplitPane
public void restoreSplitPane(String name, String key)(Code)
Restores the divider location for the split pane found in objects under key from the integer stored in the properties registered under name for the key property.
Parameters:
  name - The name of the properties to use.
Parameters:
  key - The key of the object and integer property.
See Also:   JGraphEditorSettings.getRectangleProperty(String,String)



restoreWindow
public void restoreWindow(String name, String key)(Code)
Restores the window bounds for the window found in objects under key from the rectangle stored in the properties registered under name for the key property. This implementation assumes that the key property is a rectangle, ie. consists of 4 entries in the file.
Parameters:
  name - The name of the properties to use.
Parameters:
  key - The key of the object and rectangle property.
See Also:   JGraphEditorSettings.getRectangleProperty(String,String)



shutdown
public void shutdown()(Code)
Invokes all hooks that have previously been added using addShutdownHook in reverse order (last added first).



storeSplitPane
public void storeSplitPane(String name, String key)(Code)
Stores the dividerlocation of the splitpane found in objects under key in the properties called name as a int property under key.
Parameters:
  name - The name of the properties to store the divider location.
Parameters:
  key - The name of the key to store the divider location.



storeWindow
public void storeWindow(String name, String key)(Code)
Stores the bounds of the window found in objects under key in the properties called name as a rectangle property under key.
Parameters:
  name - The name of the properties to store the bounds.
Parameters:
  key - The name of the key to store the rectangle property.



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.