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


com.jgraph.editor.JGraphEditorAction
   com.jgraph.pad.action.JGraphpadFileAction

All known Subclasses:   com.jgraph.codecplugin.JGraphpadCodecAction,  com.jgraph.jgxplugin.JGraphpadJGXAction,  com.jgraph.pdfplugin.JGraphpadPDFAction,  com.jgraph.svgplugin.JGraphpadSVGAction,  com.jgraph.epsplugin.JGraphpadEPSAction,
JGraphpadFileAction
public class JGraphpadFileAction extends JGraphEditorAction (Code)
Implements all actions of the file menu. The openRecent menu is implemented using the JGraphpadOpenRecentMenu class, and the import/export actions are added to the file menu by plugins, so look for their implementations there.

Inner Class :public static class AllActions implements Bundle

Field Summary
final public static  StringKEY_EDGEPROTOTYPE
     Import actions require the action values for this key to be assigned.
final public static  StringKEY_MAINWINDOW
     Defines the key for the main windows object.
final public static  StringKEY_RECENTFILES
     Defines the key for the recent files user settings.
final public static  StringKEY_VERTEXPROTOTYPE
     Import actions require the action value for this key to be assigned.
public static  intMAX_RECENTFILES
     Defines the maximum number of recent files to store under the JGraphpadFileAction.KEY_RECENTFILES in the user settings file.
final public static  StringMIME_PLAINTEXTMIME_HTML
     Defines the text/plain mime-type.
final public static  StringNAME_CLOSE
     Specifies the name for the close action.
final public static  StringNAME_CLOSEALL
     Specifies the name for the closeAll action.
final public static  StringNAME_DOWNLOAD
     Specifies the name for the download action.
final public static  StringNAME_EXIT
     Specifies the name for the exit action.
final public static  StringNAME_IMPORTCSV
     Specifies the name for the importCSV action.
final public static  StringNAME_NEWDIAGRAM
     Specifies the name for the newDiagram action.
final public static  StringNAME_NEWDOCUMENT
     Specifies the name for the newDocument action.
final public static  StringNAME_NEWLIBRARY
     Specifies the name for the newLibrary action.
final public static  StringNAME_OPEN
     Specifies the name for the open action.
final public static  StringNAME_PAGESETUP
     Specifies the name for the pageSetup action.
final public static  StringNAME_PRINT
     Specifies the name for the print action.
final public static  StringNAME_REMOVEDIAGRAM
     Specifies the name for the removeDiagram action.
final public static  StringNAME_RENAMEDIAGRAM
     Specifies the name for the renameDiagram action.
final public static  StringNAME_SAVE
     Specifies the name for the save action.
final public static  StringNAME_SAVEALL
     Specifies the name for the saveAll action.
final public static  StringNAME_SAVEAS
     Specifies the name for the saveAs action.
final public static  StringNAME_SAVEIMAGE
     Specifies the name for the saveImage action.
final public static  StringNAME_UPLOADAS
     Specifies the name for the uploadAs action.
static  StringNLNLNL
     Defines the (double) newline character as used in mime responses.
protected static  JGraphpadDialogsdlgs
     Shortcut to the shared JGraphpad dialogs.
protected  JGraphEditoreditor
     References the enclosing editor.
protected  FilelastDirectory
     Holds the last directory for file operations.

Constructor Summary
public  JGraphpadFileAction(String name, JGraphEditor editor)
     Constructs a new file action for the specified name and editor.

Method Summary
public  voidactionPerformed(ActionEvent event)
     Executes the action based on the action name.
public static  Stringconvert(OutputStream data, String mime)
     Converts the specified data stream into a string assuming the data stream is of the specified mime type.
protected  voiddoCloseAll()
     Closes all open files using JGraphpadFileAction.doCloseFile(JGraphEditorFile,boolean) giving the user a chance to save unsaved changes before closing each file.
protected  voiddoCloseFile(JGraphEditorFile file, boolean remove)
     Closes the specified file by removing it from the parent.
protected  voiddoExit()
     Closes all open files using JGraphpadFileAction.doCloseAll() , saves the user settings and terminates the program using System.exit(int) .
protected  voiddoImportCSV(GraphLayoutCache cache, String filename)
     Displays a file- or URL-dialog and loads the selected file or URL into the specified diagram as a comma separated value file (CSV) using JGraphpadFileAction.importCSVFile(GraphLayoutCache,InputStream,String,Object,Object,String) .
protected  voiddoNewDiagram(JGraphEditorFile file)
     Inserts a new empty diagram into the specified file.
protected  voiddoNewDocument()
     Inserts a new empty document into the document model.
protected  voiddoNewLibrary()
     Inserts a new library into the given file.
protected  voiddoOpenFile(String filename)
     Opens the specified filename using JGraphEditorModel.addFile(String) if a file for the specified name is not already open.
protected  voiddoPageSetup(JGraphEditorDiagramPane diagramPane)
     Displays the system page format dialog and updates the pageformat on the specified diagram pane.
protected  voiddoPrintDiagramPane(JGraphEditorDiagramPane diagramPane)
     Displays a system print dialog and prints the specified diagram pane.
protected  voiddoRemoveDiagram(JGraphEditorDiagram diagram)
     Removes the specified diagram from the parent file if the parent file contains at least one diagram after the removal.
protected  voiddoRenameDiagram(JGraphEditorDiagram diagram)
     Displays a dialog to enter the new name for the specified diagram and updates the name of the diagram using JGraphEditorModel.setName(JGraphEditorDiagramString) .
public  voiddoSave(String filename, byte[] data)
     Saves the specified byte array to the specified file.
protected  voiddoSaveAll()
     Saves all open files using JGraphpadFileAction.doSaveFile(JGraphEditorFile,boolean,boolean) showing file dialogs for files whose filename has not been assigned.
protected  voiddoSaveFile(JGraphEditorFile file, boolean forceFilenameDialog, boolean urlDialog)
     Saves the specified file displaying a filename dialog if the filename is not set or if forceFilenameDialog is true.
protected  voiddoSaveImage(JGraphEditorDiagramPane diagramPane, int inset, String filename)
     Saves the specified graph as an image using inset as the size of the empty border around the image.
public static  ObjectgetCellForKey(GraphModel model, Object prototype, Hashtable map, String key, int cols, int w, int h, int offset, boolean image)
     Utility method to return the cell stored under key in the specified map or create the cell using the specified prototype and model and put it into the map under key.
protected  intgetFileCount(boolean countLibraries)
     Uses JGraphpadFileAction.isLibrary(JGraphEditorFile) to find the number of roots that are instances of JGraphEditorFile .
protected  intgetFileCount(Object root, boolean countLibraries)
     Uses JGraphpadFileAction.isLibrary(JGraphEditorFile) to find the number of roots that are instances of JGraphEditorFile .
public static  JGraphEditorFilegetPermanentFocusOwnerFile()
     Returns the diagram for the permanent focus owner diagram pane.
public static  JGraphpadLibraryPanegetPermanentFocusOwnerLibraryPane()
     Returns the permanent focus owner library pane.
public static  voidimportCSVFile(GraphLayoutCache cache, InputStream fstream, String delim, Object vertexPrototype, Object edgePrototype, String defaultEdgeLabel)
     Reads the specified input stream as a comma-delimeted file, using the following format: a,b[,c] where a and b are vertices and c is the label of the edge to be inserted between a and b.
protected  booleanisLibrary(JGraphEditorFile file)
     Returns true if the specified file is a library.
public static  StringmakeMimeForm(String fileName, String type, String path, String content, String comment, String sep)
     Returns a mime form using the specified parameters.
public static  booleanpost(URL url, String path, String mime, OutputStream data)
     Posts the data to the specified url using path to specify the filename in the mime response for the specified mime type.
Parameters:
  url - The url to post the mime response to.
Parameters:
  path - The filename to use in the mime response.
Parameters:
  mime - The mime type to use for the response.
Parameters:
  data - The binary data to send with the mime response.
public static  booleanpost(URL url, String path, String mime, String data)
     Posts the data to the specified url using path to specify the filename in the mime response for the specified mime type.
Parameters:
  url - The url to post the mime response to.
Parameters:
  path - The filename to use in the mime response.
Parameters:
  mime - The mime type to use for the response.
Parameters:
  data - The binary data to send with the mime response.
public static  booleanpostPlain(URL url, String path, OutputStream data)
     Posts the data to the specified url using path to specify the filename in the mime response using for type JGraphpadFileAction.MIME_PLAINTEXT .
Parameters:
  url - The url to post the mime response to.
Parameters:
  path - The filename to use in the mime response.
Parameters:
  data - The binary data to send with the mime response.

Field Detail
KEY_EDGEPROTOTYPE
final public static String KEY_EDGEPROTOTYPE(Code)
Import actions require the action values for this key to be assigned. The object under this key will be used to create the edges for imports.
See Also:   Action.putValue(java.lang.Stringjava.lang.Object)



KEY_MAINWINDOW
final public static String KEY_MAINWINDOW(Code)
Defines the key for the main windows object. This key is used to store a reference in the editor settings for the bounds of the application window. This class is in charge of storing the bounds in JGraphpad.PATH_USERSETTINGS on program termination.



KEY_RECENTFILES
final public static String KEY_RECENTFILES(Code)
Defines the key for the recent files user settings. This class is in charge of updating the list and storing it in JGraphpad.PATH_USERSETTINGS on program termination.



KEY_VERTEXPROTOTYPE
final public static String KEY_VERTEXPROTOTYPE(Code)
Import actions require the action value for this key to be assigned. The object under this key will be used to create new vertices for imports.
See Also:   Action.putValue(java.lang.Stringjava.lang.Object)



MAX_RECENTFILES
public static int MAX_RECENTFILES(Code)
Defines the maximum number of recent files to store under the JGraphpadFileAction.KEY_RECENTFILES in the user settings file. Default is 6.



MIME_PLAINTEXTMIME_HTML
final public static String MIME_PLAINTEXTMIME_HTML(Code)
Defines the text/plain mime-type.



NAME_CLOSE
final public static String NAME_CLOSE(Code)
Specifies the name for the close action.



NAME_CLOSEALL
final public static String NAME_CLOSEALL(Code)
Specifies the name for the closeAll action.



NAME_DOWNLOAD
final public static String NAME_DOWNLOAD(Code)
Specifies the name for the download action.



NAME_EXIT
final public static String NAME_EXIT(Code)
Specifies the name for the exit action.



NAME_IMPORTCSV
final public static String NAME_IMPORTCSV(Code)
Specifies the name for the importCSV action.



NAME_NEWDIAGRAM
final public static String NAME_NEWDIAGRAM(Code)
Specifies the name for the newDiagram action.



NAME_NEWDOCUMENT
final public static String NAME_NEWDOCUMENT(Code)
Specifies the name for the newDocument action.



NAME_NEWLIBRARY
final public static String NAME_NEWLIBRARY(Code)
Specifies the name for the newLibrary action.



NAME_OPEN
final public static String NAME_OPEN(Code)
Specifies the name for the open action.



NAME_PAGESETUP
final public static String NAME_PAGESETUP(Code)
Specifies the name for the pageSetup action.



NAME_PRINT
final public static String NAME_PRINT(Code)
Specifies the name for the print action.



NAME_REMOVEDIAGRAM
final public static String NAME_REMOVEDIAGRAM(Code)
Specifies the name for the removeDiagram action.



NAME_RENAMEDIAGRAM
final public static String NAME_RENAMEDIAGRAM(Code)
Specifies the name for the renameDiagram action.



NAME_SAVE
final public static String NAME_SAVE(Code)
Specifies the name for the save action.



NAME_SAVEALL
final public static String NAME_SAVEALL(Code)
Specifies the name for the saveAll action.



NAME_SAVEAS
final public static String NAME_SAVEAS(Code)
Specifies the name for the saveAs action.



NAME_SAVEIMAGE
final public static String NAME_SAVEIMAGE(Code)
Specifies the name for the saveImage action.



NAME_UPLOADAS
final public static String NAME_UPLOADAS(Code)
Specifies the name for the uploadAs action.



NLNLNL
static String NLNLNL(Code)
Defines the (double) newline character as used in mime responses.



dlgs
protected static JGraphpadDialogs dlgs(Code)
Shortcut to the shared JGraphpad dialogs.



editor
protected JGraphEditor editor(Code)
References the enclosing editor.



lastDirectory
protected File lastDirectory(Code)
Holds the last directory for file operations.




Constructor Detail
JGraphpadFileAction
public JGraphpadFileAction(String name, JGraphEditor editor)(Code)
Constructs a new file action for the specified name and editor.
Parameters:
  name - The name of the action to be created.
Parameters:
  editor - The enclosing editor for the action.




Method Detail
actionPerformed
public void actionPerformed(ActionEvent event)(Code)
Executes the action based on the action name.
Parameters:
  event - The object that describes the event.



convert
public static String convert(OutputStream data, String mime)(Code)
Converts the specified data stream into a string assuming the data stream is of the specified mime type. This performs a byte to char conversion on all mime types other than JGraphpadFileAction.MIME_PLAINTEXT .
Parameters:
  data - The data to be converted.
Parameters:
  mime - The mime type to assume for the data. Returns a string representation of the data in the stream.



doCloseAll
protected void doCloseAll() throws IOException(Code)
Closes all open files using JGraphpadFileAction.doCloseFile(JGraphEditorFile,boolean) giving the user a chance to save unsaved changes before closing each file.
throws:
  IOException - If there was an error saving unsaved changes.



doCloseFile
protected void doCloseFile(JGraphEditorFile file, boolean remove) throws IOException(Code)
Closes the specified file by removing it from the parent. This implementation displays a dialog if there are unsaved changes and calls JGraphpadFileAction.doSaveFile(JGraphEditorFile,boolean,boolean) if the user chooses to save the changes.
Parameters:
  file - The file to be closed.
Parameters:
  remove - Whether the file should be removed from the model.
throws:
  IOException - If the unsaved changes can not be saved.



doExit
protected void doExit() throws IOException(Code)
Closes all open files using JGraphpadFileAction.doCloseAll() , saves the user settings and terminates the program using System.exit(int) . This implementation allows the JGraphpad.PATH_USERSETTINGS to be a URL.
throws:
  IOException - If there was an error saving unsaved changes.



doImportCSV
protected void doImportCSV(GraphLayoutCache cache, String filename) throws IOException(Code)
Displays a file- or URL-dialog and loads the selected file or URL into the specified diagram as a comma separated value file (CSV) using JGraphpadFileAction.importCSVFile(GraphLayoutCache,InputStream,String,Object,Object,String) .
Parameters:
  cache - The graph layout cache to import into.
Parameters:
  filename - The filename to import from.
throws:
  IOException - If the file cannot be read.
See Also:   JGraphEditorModel.getInputStream(String)



doNewDiagram
protected void doNewDiagram(JGraphEditorFile file)(Code)
Inserts a new empty diagram into the specified file. The name is assigned automatically using the Diagram resource string and the number returned by TreeModel.getChildCount(java.lang.Object) for the file.
Parameters:
  file - The file to add the diagram to.



doNewDocument
protected void doNewDocument()(Code)
Inserts a new empty document into the document model. The name is assigned automatically using the Document resource string and the number returned by JGraphpadFileAction.getFileCount(boolean) .



doNewLibrary
protected void doNewLibrary()(Code)
Inserts a new library into the given file. The name is assigned automatically using the Library resource string and the number returned by JGraphpadFileAction.getFileCount(boolean) .



doOpenFile
protected void doOpenFile(String filename) throws MalformedURLException, IOException(Code)
Opens the specified filename using JGraphEditorModel.addFile(String) if a file for the specified name is not already open.
Parameters:
  filename - The name of the file to be opened.
throws:
  IOException - If there was an error reading the file.
throws:
  MalformedURLException - If the filename is an URL but the URL is invalid.



doPageSetup
protected void doPageSetup(JGraphEditorDiagramPane diagramPane)(Code)
Displays the system page format dialog and updates the pageformat on the specified diagram pane.
Parameters:
  diagramPane - The diagram pane to set the page format.



doPrintDiagramPane
protected void doPrintDiagramPane(JGraphEditorDiagramPane diagramPane) throws PrinterException(Code)
Displays a system print dialog and prints the specified diagram pane.
Parameters:
  diagramPane - The diagram pane to be printed.
throws:
  PrinterException - If the document can not be printed.



doRemoveDiagram
protected void doRemoveDiagram(JGraphEditorDiagram diagram)(Code)
Removes the specified diagram from the parent file if the parent file contains at least one diagram after the removal. Otherwise the diagram is not removed. This implementation displays a confirmation dialog before actually removing the diagram.
Parameters:
  diagram - The diagram to be removed from its parent file.
See Also:   JGraphpadDialogs.confirmDialog(ComponentStringbooleanboolean)



doRenameDiagram
protected void doRenameDiagram(JGraphEditorDiagram diagram)(Code)
Displays a dialog to enter the new name for the specified diagram and updates the name of the diagram using JGraphEditorModel.setName(JGraphEditorDiagramString) .
Parameters:
  diagram - The diagram to be renamed.
See Also:   JGraphpadDialogs.valueDialog(StringString)



doSave
public void doSave(String filename, byte[] data) throws Exception(Code)
Saves the specified byte array to the specified file.
Parameters:
  filename - The filename of the file to be written.
Parameters:
  data - The array of bytes to write to the file.



doSaveAll
protected void doSaveAll() throws IOException(Code)
Saves all open files using JGraphpadFileAction.doSaveFile(JGraphEditorFile,boolean,boolean) showing file dialogs for files whose filename has not been assigned.
throws:
  IOException - If there was an error saving the files.



doSaveFile
protected void doSaveFile(JGraphEditorFile file, boolean forceFilenameDialog, boolean urlDialog) throws IOException(Code)
Saves the specified file displaying a filename dialog if the filename is not set or if forceFilenameDialog is true. If urlDialog is true, then the dialog will ask for an URL instead of a local file.
This implementation does the following additional checks:
  • If the file already exists it asks whether it should be overwritten.
  • It rejects to assign filenames of files which are already open.
  • If filename is an URL it tries to upload the data to that URL.
Furthermore, this implementation updates the isNew and modified state of the file if it has successfully been saved.
Parameters:
  file - The file to be saved.
Parameters:
  forceFilenameDialog - Whether to display a dialog regardless of the filename.
Parameters:
  urlDialog - Whether to display an URL dialog to specifiy the filename.
throws:
  IOException - If the file cannot be saved.
See Also:   JGraphEditorModel.getOutputStream(String)
See Also:   JGraphpadFileAction.postPlain(URL,String,OutputStream)



doSaveImage
protected void doSaveImage(JGraphEditorDiagramPane diagramPane, int inset, String filename) throws IOException(Code)
Saves the specified graph as an image using inset as the size of the empty border around the image. This implementation displays a dialog to ask for transparency-support if the chosen fileformat supports it (eg. PNG, GIF). If filename is an URL it tries to upload the data to that URL.
Parameters:
  diagramPane - The diagram pane to save to the image for.
Parameters:
  inset - The size of the empty border around the image.
Parameters:
  filename - The filename to save or upload the image to.
throws:
  IOException - If the image cannot be saved.
throws:
  IllegalArgumentException - If the graph contains no cells.
See Also:   JGraph.getImage(Colorint)
See Also:   ImageIO.write(java.awt.image.RenderedImagejava.lang.Stringjava.io.OutputStream)
See Also:   JGraphEditorModel.getOutputStream(String)
See Also:   JGraphpadFileAction.post(URL,String,String,OutputStream)



getCellForKey
public static Object getCellForKey(GraphModel model, Object prototype, Hashtable map, String key, int cols, int w, int h, int offset, boolean image)(Code)
Utility method to return the cell stored under key in the specified map or create the cell using the specified prototype and model and put it into the map under key. The cells will be positioned into a matrix with cols columns and entries of size (w,h).
Parameters:
  model - The model to use for cloning the prototype.
Parameters:
  prototype - The prototype to use for creating new cells.
Parameters:
  map - The map to check whether the cell exists for key.
Parameters:
  key - The key to return the cell for.
Parameters:
  cols - The number of columns for the matrix.
Parameters:
  w - The width of the entries.
Parameters:
  h - The height of the entries.
Parameters:
  offset - The offset from the top left.
Parameters:
  image - Whether to insert image or text cells. Returns the cell for the specified key.



getFileCount
protected int getFileCount(boolean countLibraries)(Code)
Uses JGraphpadFileAction.isLibrary(JGraphEditorFile) to find the number of roots that are instances of JGraphEditorFile . If countLibraries is true, then the number of libraries is returned.
The following always holds: getFileCount(false) + getFileCount(true) == getChildCount(getRoot())
Parameters:
  countLibraries - Whether libraries or non-libraries should be counted. Returns the number of libraries or non-libraries.



getFileCount
protected int getFileCount(Object root, boolean countLibraries)(Code)
Uses JGraphpadFileAction.isLibrary(JGraphEditorFile) to find the number of roots that are instances of JGraphEditorFile . If countLibraries is true, then the number of libraries is returned.
The following always holds: getFileCount(false) + getFileCount(true) == getChildCount(getRoot())
Parameters:
  countLibraries - Whether libraries or non-libraries should be counted. Returns the number of libraries or non-libraries.



getPermanentFocusOwnerFile
public static JGraphEditorFile getPermanentFocusOwnerFile()(Code)
Returns the diagram for the permanent focus owner diagram pane.



getPermanentFocusOwnerLibraryPane
public static JGraphpadLibraryPane getPermanentFocusOwnerLibraryPane()(Code)
Returns the permanent focus owner library pane.



importCSVFile
public static void importCSVFile(GraphLayoutCache cache, InputStream fstream, String delim, Object vertexPrototype, Object edgePrototype, String defaultEdgeLabel) throws IOException(Code)
Reads the specified input stream as a comma-delimeted file, using the following format: a,b[,c] where a and b are vertices and c is the label of the edge to be inserted between a and b. For example, to create a triangle, use:
a,b,ab
b,c,bc
c,a,ca

Parameters:
  cache - The layout cache to import the file into.
Parameters:
  fstream - The stream to import the cells from.
Parameters:
  delim - The delimeter to parse the tokens.
Parameters:
  vertexPrototype - The prototype to create new vertices with.
Parameters:
  edgePrototype - The prototype to create new edges with.
Parameters:
  defaultEdgeLabel - The default label to use for edges if none is specified.
throws:
  IOException -



isLibrary
protected boolean isLibrary(JGraphEditorFile file)(Code)
Returns true if the specified file is a library. This implementation returns true if file is an instance of JGraphpadLibrary .
Parameters:
  file - The file to be checked. Returns true if file is a library.



makeMimeForm
public static String makeMimeForm(String fileName, String type, String path, String content, String comment, String sep)(Code)
Returns a mime form using the specified parameters.



post
public static boolean post(URL url, String path, String mime, OutputStream data) throws IOException(Code)
Posts the data to the specified url using path to specify the filename in the mime response for the specified mime type.
Parameters:
  url - The url to post the mime response to.
Parameters:
  path - The filename to use in the mime response.
Parameters:
  mime - The mime type to use for the response.
Parameters:
  data - The binary data to send with the mime response. Returns true if the data was successfuly posted.
throws:
  IOException -



post
public static boolean post(URL url, String path, String mime, String data) throws IOException(Code)
Posts the data to the specified url using path to specify the filename in the mime response for the specified mime type.
Parameters:
  url - The url to post the mime response to.
Parameters:
  path - The filename to use in the mime response.
Parameters:
  mime - The mime type to use for the response.
Parameters:
  data - The binary data to send with the mime response. Returns true if the data was successfuly posted.
throws:
  IOException -



postPlain
public static boolean postPlain(URL url, String path, OutputStream data) throws IOException(Code)
Posts the data to the specified url using path to specify the filename in the mime response using for type JGraphpadFileAction.MIME_PLAINTEXT .
Parameters:
  url - The url to post the mime response to.
Parameters:
  path - The filename to use in the mime response.
Parameters:
  data - The binary data to send with the mime response. Returns true if the data was successfuly posted.
throws:
  IOException -



Fields inherited from com.jgraph.editor.JGraphEditorAction
final public static String PROPERTY_ISSELECTED(Code)(Java Doc)
final public static String PROPERTY_ISVISIBLE(Code)(Java Doc)
protected boolean isToggleAction(Code)(Java Doc)

Methods inherited from com.jgraph.editor.JGraphEditorAction
public static Frame getActiveFrame()(Code)(Java Doc)
public static Frame getFrame(ActionEvent event)(Code)(Java Doc)
public static JGraphpadPane getJGraphpadPane()(Code)(Java Doc)
public static JGraphpadPane getJGraphpadPane(JFrame frame)(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public static JGraph getParentGraph(Component component)(Code)(Java Doc)
public static Component getPermanentFocusOwner()(Code)(Java Doc)
public static JGraphEditorDiagram getPermanentFocusOwnerDiagram()(Code)(Java Doc)
public static JGraphEditorDiagramPane getPermanentFocusOwnerDiagramPane()(Code)(Java Doc)
public static JGraph getPermanentFocusOwnerGraph()(Code)(Java Doc)
public static Component getPermanentFocusOwnerOrParent()(Code)(Java Doc)
public static String getString(String key)(Code)(Java Doc)
public boolean isSelected()(Code)(Java Doc)
public boolean isToggleAction()(Code)(Java Doc)
public boolean isVisible()(Code)(Java Doc)
public void setEnabled(boolean newValue)(Code)(Java Doc)
public void setSelected(boolean selected)(Code)(Java Doc)
public void setToggleAction(boolean isToggleAction)(Code)(Java Doc)
public void setVisible(boolean visible)(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.