public final class LayoutFileOperations
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
LayoutFileOperations.SinkOrSource
Categorization of an entity.
|
Modifier and Type | Method and Description |
---|---|
static IntMatrixToken |
getLocationToken(org.netbeans.api.visual.widget.Widget widget)
Get the location from a widget in the form of an IntMatrixToken.
|
static LayoutFileOperations.SinkOrSource |
isSinkOrSource(ComponentEntity entity)
Check if the entity is a sink or source.
|
static CompositeEntity |
open(HomerMainFrame mainFrame,
java.net.URL modelURL,
java.net.URL layoutURL)
Open a model and an existing layout on the given frame.
|
static CompositeEntity |
openModelFile(java.net.URL url)
Open a MoML file, parse it, and return the parsed model.
|
static void |
parseModel(HomerMainFrame mainFrame)
Given a frame containing a model, this method will parse the model and populate
the contents defined in the frame.
|
static void |
saveAs(HomerMainFrame mainFrame,
java.io.File layoutFile)
Save a layout to a MoML file.
|
public static CompositeEntity open(HomerMainFrame mainFrame, java.net.URL modelURL, java.net.URL layoutURL) throws IllegalActionException, NameDuplicationException, java.lang.CloneNotSupportedException
mainFrame
- The frame containing the contents infrastructure and the visual
representations.modelURL
- The url to the original Ptolemy II model file to use.layoutURL
- The url to the layout file associated with the Ptolemy II model.IllegalActionException
- If the model cannot be merged with the layout.java.lang.CloneNotSupportedException
- If cloning of the Ptolemy II model is not
supported.NameDuplicationException
- If there is a name duplication when merging the
model and the layout.public static void parseModel(HomerMainFrame mainFrame) throws IllegalActionException, NameDuplicationException
mainFrame
- The frame containing the model to be parsed and the underlying contents
infrastructure.IllegalActionException
- If the parsing fails.NameDuplicationException
- If during the parsing a name duplication is found.public static CompositeEntity openModelFile(java.net.URL url) throws IllegalActionException
url
- The url of the model.IllegalActionException
- If the parsing failed.public static void saveAs(HomerMainFrame mainFrame, java.io.File layoutFile)
mainFrame
- The object containing all the information about the
elements to create the layout file, such as position information.layoutFile
- The file the layout is saved to.public static IntMatrixToken getLocationToken(org.netbeans.api.visual.widget.Widget widget)
widget
- The widget from where to extract the location from.public static LayoutFileOperations.SinkOrSource isSinkOrSource(ComponentEntity entity)
entity
- The Ptolemy entity to check.