|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindfusion.diagramming.ShapeLibrary
public class ShapeLibrary
The ShapeLibrary
class represents a collection of shape definitions stored together.
Shape libraries can be created using the ShapeDesigner tool that comes with Diagram.NET. Use the
loadFrom(java.io.File)
method to load a shape library from a file. The loaded shapes can be accessed through
the getShapes()
method. They will be automatically added to the shared list of shapes kept
in the Shape
class, which lets you access them via the Shape.fromId(java.lang.String)
method.
A shape library can be saved into a file in XML based format using the saveTo(java.lang.String)
method.
Constructor Summary | |
---|---|
ShapeLibrary(Shape[] shapes)
|
Method Summary | |
---|---|
static ShapeLibrary |
fromXmlElement(org.w3c.dom.Element shapes)
Creates a ShapeLibrary from a DOM tree. |
Shape[] |
getShapes()
Gets the shapes contained in this library. |
static ShapeLibrary |
loadFrom(java.io.File file)
Loads (creates) a ShapeLibrary object from the specified file. |
static ShapeLibrary |
loadFrom(org.xml.sax.InputSource source)
Loads (creates) a ShapeLibrary object from the specified XML source. |
void |
makeImagesRelativeTo(java.lang.String shapeLibraryPath)
Makes image locations relative to specified shapeLibraryPath so that the shape library can be moved/distributed. |
void |
saveTo(java.lang.String filename)
Saves the shape library to the specified file. |
void |
setShapes(Shape[] shapes)
Sets the shape library shapes. |
org.w3c.dom.Element |
toDOM(org.w3c.dom.Document owner)
Converts the ShapeLibrary to a DOM element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShapeLibrary(Shape[] shapes)
Method Detail |
---|
public static ShapeLibrary loadFrom(java.io.File file)
file
- A File
object that contains the shape library data.
ShapeLibrary
instance.public static ShapeLibrary loadFrom(org.xml.sax.InputSource source)
source
- An InputSource
object that contains the shape library data.
ShapeLibrary
instance.public void saveTo(java.lang.String filename) throws XmlException
filename
- The name of the file where the library should be saved.
XmlException
public org.w3c.dom.Element toDOM(org.w3c.dom.Document owner)
owner
- The XML document.
public static ShapeLibrary fromXmlElement(org.w3c.dom.Element shapes) throws javax.xml.transform.TransformerException, XmlException
shapes
- An XML element containing the shape library data.
ShapeLibrary
instance.
XmlException
javax.xml.transform.TransformerException
public Shape[] getShapes()
Shape
objects.public void setShapes(Shape[] shapes)
shapes
- An array of Shape
objects.public void makeImagesRelativeTo(java.lang.String shapeLibraryPath) throws java.net.URISyntaxException
java.net.URISyntaxException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |