Renders and displays DOT code.
More...
|
| | DOTrenderer (String title, String dotCode) |
| | Constructor of this JFrame instance.
|
| | DOTrenderer (String title, String dotCode, String layout) |
| | Constructor of this JFrame instance.
|
| void | actionPerformed (ActionEvent e) |
| | This method is called whenever a button is pressed.
|
|
| boolean | createDOTFile (String dotCode, String fileName) |
| | This method creates a temporary file from a string representing DOT code.
|
| ImageIcon | createDOTfigure () |
| | This method calls the layout executable in order to create an image from the DOT code given in a temporary file.
|
| ImageIcon | zoomFigure (ImageIcon figure, boolean zoomIn) |
| synchronized int | increaseFileID () |
| void | copyFile (File srcFile, File destFile) |
| | This method is used to copy a file.
|
|
| static final long | serialVersionUID = -8149101075827511346L |
| | Serial version ID of JFrame.
|
| static final String | TEMP_DOT_FILE_NAME = ".temp" |
| | String determining name of temporary files.
|
| static int | TEMP_FILE_ID = 0 |
| | Integer used to create unique file names.
|
| static final Object | posLock = new Object () |
| | Lock to synchronize access to xPos and yPos.
|
| static int | xPos = 0 |
| | The x position of the next window.
|
| static int | yPos = 30 |
| | The y position of the next window.
|
Renders and displays DOT code.
- Author
- Andreas Schaedeli, Thomas Leaute
- Todo
- Increase scrolling speed.
◆ DOTrenderer() [1/2]
| frodo2.gui.DOTrenderer.DOTrenderer |
( |
String | title, |
|
|
String | dotCode ) |
Constructor of this JFrame instance.
Determines size and components of the Frame. Uses the dot layout.
- Parameters
-
| title | JFrame title |
| dotCode | DOT formatted code to be displayed as image |
◆ DOTrenderer() [2/2]
| frodo2.gui.DOTrenderer.DOTrenderer |
( |
String | title, |
|
|
String | dotCode, |
|
|
String | layout ) |
Constructor of this JFrame instance.
Determines size and components of the Frame.
- Parameters
-
| title | JFrame title |
| dotCode | DOT formatted code to be displayed as image |
| layout | one of the following: dot, neato, twopi, circo, fdp, sfdp |
References content, createDOTfigure(), createDOTFile(), currentDotImage, dotFileName, increaseFileID(), layout, posLock, TEMP_DOT_FILE_NAME, xPos, and yPos.
◆ actionPerformed()
| void frodo2.gui.DOTrenderer.actionPerformed |
( |
ActionEvent | e | ) |
|
◆ copyFile()
| void frodo2.gui.DOTrenderer.copyFile |
( |
File | srcFile, |
|
|
File | destFile ) |
|
private |
This method is used to copy a file.
This is needed, as all the files created are only temporary and will be deleted when JVM exits. Therefore, to keep them, they need to be copied to files that will not be deleted. For this, the input file is read and the content is written to the destination file.
- Parameters
-
| srcFile | Source file (temporary) |
| destFile | Destination file (durable) |
Referenced by actionPerformed().
◆ createDOTfigure()
| ImageIcon frodo2.gui.DOTrenderer.createDOTfigure |
( |
| ) |
|
|
private |
This method calls the layout executable in order to create an image from the DOT code given in a temporary file.
- Returns
- ImageIcon representing the image created from DOT code
- Bug
- err will not be closed
References dotFileName, and dotImage.
Referenced by DOTrenderer().
◆ createDOTFile()
| boolean frodo2.gui.DOTrenderer.createDOTFile |
( |
String | dotCode, |
|
|
String | fileName ) |
|
private |
This method creates a temporary file from a string representing DOT code.
- Parameters
-
| dotCode | String representing DOT formatted code |
| fileName | Name of temporary file where code should be saved |
- Returns
- true if creation of file was successful, else false
Referenced by DOTrenderer().
◆ increaseFileID()
| synchronized int frodo2.gui.DOTrenderer.increaseFileID |
( |
| ) |
|
|
private |
◆ zoomFigure()
| ImageIcon frodo2.gui.DOTrenderer.zoomFigure |
( |
ImageIcon | figure, |
|
|
boolean | zoomIn ) |
|
private |
- Parameters
-
| figure | Currently displayed image |
| zoomIn | true if user wants to zoom in, false if he wants to zoom out |
- Returns
- Scaled instance of the image
References dotImage.
Referenced by actionPerformed().
◆ content
| JLabel frodo2.gui.DOTrenderer.content |
|
private |
◆ currentDotImage
| ImageIcon frodo2.gui.DOTrenderer.currentDotImage |
|
private |
◆ dotFileName
| String frodo2.gui.DOTrenderer.dotFileName |
|
private |
◆ dotImage
| Image frodo2.gui.DOTrenderer.dotImage |
|
private |
◆ layout
| String frodo2.gui.DOTrenderer.layout |
|
private |
The name of the Graphviz executable.
Referenced by DOTrenderer().
◆ posLock
| final Object frodo2.gui.DOTrenderer.posLock = new Object () |
|
staticprivate |
Lock to synchronize access to xPos and yPos.
Referenced by DOTrenderer().
◆ serialVersionUID
| final long frodo2.gui.DOTrenderer.serialVersionUID = -8149101075827511346L |
|
staticprivate |
Serial version ID of JFrame.
◆ TEMP_DOT_FILE_NAME
| final String frodo2.gui.DOTrenderer.TEMP_DOT_FILE_NAME = ".temp" |
|
staticprivate |
String determining name of temporary files.
Referenced by DOTrenderer().
◆ TEMP_FILE_ID
| int frodo2.gui.DOTrenderer.TEMP_FILE_ID = 0 |
|
staticprivate |
◆ xPos
| int frodo2.gui.DOTrenderer.xPos = 0 |
|
staticprivate |
◆ yPos
| int frodo2.gui.DOTrenderer.yPos = 30 |
|
staticprivate |
The documentation for this class was generated from the following file: