Diagram

Inheritance: java.lang.Object

public class Diagram

Root element of Visio objects hierarchy.

Constructors

ConstructorDescription
Diagram()
Diagram(String filename)Public class constructor, loads the diagram from the file.
Diagram(InputStream stream)Public class constructor, loads the diagram from the stream.
Diagram(InputStream stream, int format)Public class constructor, loads the diagram from the stream using predefined format.
Diagram(InputStream stream, LoadOptions options)Public class constructor, loads the diagram from the stream using predefined load file options.
Diagram(String filename, int format)Public class constructor, loads the diagram from the file using predefined format.
Diagram(String filename, LoadOptions options)Public class constructor, loads the diagram from the file using predefined load file options.

Methods

MethodDescription
addMaster(Diagram srcDiagram, String masterName)Adds master to diagram from source diagram by master’s Name or NameU.
addMaster(InputStream templateStream, int masterID)Adds master to diagram from template stream by master’s ID.
addMaster(InputStream templateStream, String masterName)Adds master to diagram from template stream by master’s Name or NameU.
addMaster(String templateFilePath, int masterID)Adds master to diagram from template file by master’s ID.
addMaster(String templateFilePath, String masterName)Adds master to diagram from template file by master’s Name or NameU.
addShape(Shape newShape, String masterName, int pageNumber)Adds shape created by master to specific page.
addShape(double pinX, double pinY, double width, double height, String masterName, int pageNumber)Adds shape created by master on page with defined PinX,PinY,Width and Height.
addShape(double pinX, double pinY, String masterName, int pageNumber)Adds shape created by master on page with defined PinX and PinY.
combine(Diagram secondDiagram)Combines another Diagram object.
copyTheme(Diagram source)Copies Theme from a source Diagram.
dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
equals(Object arg0)
export(InputStream inputVsd, InputStream outputVdw)Exports the diagram from vsd stream to vdw stream format.
export(InputStream inputVsd, String outputVdw)Exports the diagram from vsd stream to *.vdw file format.
export(String inputVsd, InputStream outputVdw)Exports the diagram from vsd file to vdw stream format.
export(String inputVsd, String outputVdw)Exports the diagram from vsd to vdw format.
getActivePage()Specifies the active page
getBuildnum()The build number of the Visio instance used to create the document.
getClass()
getColors()Contains the document’s color table.
getDataConnections()Contains the DataConnection elements for the document.
getDataRecordSets()The collection of DataRecordset objects associated with a Document object.
getDefaultFontDir()Get the Default Fonts folder path
getDocLangID()The unique ID of the user-interface language the user has specified in Microsoft Office 2010 Language Preferences.
getDocumentProps()Contains document property elements such as the document’s title, author, and so on.
getDocumentSettings()Contains elements that specify document settings.
getDocumentSheet()Specifies a document’s ShapeSheet structure.
getEmailRoutingData()Contains a MIME (Multipurpose Internet Mail Extensions) encoded MAPI e-mail routing slip for the document.
getEventItems()Contains an EventItem element for each event to which an object should respond.
getFonts()Contains a collection of Font elements
getHeaderFooter()Contains elements for a document’s header and footer.
getInterruptMonitor()the interrupt monitor.
getKey()Indicates whether the document has been modified outside of Visio.
getMasters()Collection Master objects.
getMetric()Whether to use metric units in the drawing.
getPages()Collection Page objects.
getRibbonX()The Ribbon XML string that is passed to the document to customize the ribbon user interface.
getSolutionXMLs()XML value.
getStart()Indicates whether the document has been modified outside of Visio.
getStyleSheets()Collection StyleSheet objects.
getUnusedStyles()Get unused Styles
getUserCustomUI()The Ribbon XML string that is passed to the document to customize the Quick Access toolbar or the ribbon.
getValidation()Stores information about diagram validation for the document.
getVbProjectData()Contains the Microsoft Visual Basic for Applications project data in MIME (Multipurpose Internet Mail Extensions) encoded format.
getVbaProject()Gets the VbaProjectgetVbaProject().
getVersion()The version number of the Visio instance.
getWindows()Contains the Window elements for a document.
hasHiddenInfo()Indicates whether this diagram has hidden information.
hashCode()
layout(LayoutOptions options)Lays out the shapes and/or reroutes the connectors for all pages of diagram.
notify()
notifyAll()
print(String printerName)Print the whole document to the specified printer,using the standard (no User Interface) print controller.
print(String printerName, PrintSaveOptions options)Print the whole document to the specified printer,using the standard (no User Interface) print controller.
print(String printerName, String documentName)Prints the document,using the standard (no User Interface) print controller and a document name.
print(String printerName, String documentName, PrintSaveOptions options)Prints the document,using the standard (no User Interface) print controller and a document name.
removeHiddenInformation(int item)Remove unused information
removeMacro()Removes VBA/macro from this diagram.
save(OutputStream stream, SaveOptions saveOptions)Save the diagram to the stream.
save(OutputStream stream, int format)Save the diagram to the stream.
save(String filename, SaveOptions options)Saves the document to a file using the specified save options.
save(String filename, int format)Saves the diagram data to the file.
setBuildnum(long value)For the description of this property, please see getBuildnum()
setDocLangID(int value)For the description of this property, please see getDocLangID()
setEmailRoutingData(byte[] value)For the description of this property, please see getEmailRoutingData()
setFontDirs(String[] value)Indicates the Fonts folder path
setInterruptMonitor(AbstractInterruptMonitor value)For the description of this property, please see getInterruptMonitor()
setKey(String value)For the description of this property, please see getKey()
setMetric(int value)For the description of this property, please see getMetric()
setRibbonX(String value)For the description of this property, please see getRibbonX()
setStart(long value)For the description of this property, please see getStart()
setUserCustomUI(String value)For the description of this property, please see getUserCustomUI()
setVbProjectData(byte[] value)For the description of this property, please see getVbProjectData()
setVersion(String value)For the description of this property, please see getVersion()
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

Diagram()

public Diagram()

Diagram(String filename)

public Diagram(String filename)

Public class constructor, loads the diagram from the file.

Parameters:

ParameterTypeDescription
filenamejava.lang.StringThe file name.

Diagram(InputStream stream)

public Diagram(InputStream stream)

Public class constructor, loads the diagram from the stream.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamThe data stream.

Diagram(InputStream stream, int format)

public Diagram(InputStream stream, int format)

Public class constructor, loads the diagram from the stream using predefined format.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamThe data stream.
formatintThe data Aspose.Diagram.LoadFileFormat.

Diagram(InputStream stream, LoadOptions options)

public Diagram(InputStream stream, LoadOptions options)

Public class constructor, loads the diagram from the stream using predefined load file options.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamThe data stream.
optionsLoadOptionsThe data LoadOptions.

Diagram(String filename, int format)

public Diagram(String filename, int format)

Public class constructor, loads the diagram from the file using predefined format.

Parameters:

ParameterTypeDescription
filenamejava.lang.StringThe file name.
formatintThe file format.

Diagram(String filename, LoadOptions options)

public Diagram(String filename, LoadOptions options)

Public class constructor, loads the diagram from the file using predefined load file options.

Parameters:

ParameterTypeDescription
filenamejava.lang.StringThe file name.
optionsLoadOptionsThe data LoadOptions.

addMaster(Diagram srcDiagram, String masterName)

public int addMaster(Diagram srcDiagram, String masterName)

Adds master to diagram from source diagram by master’s Name or NameU.

Parameters:

ParameterTypeDescription
srcDiagramDiagramsource diagram.
masterNamejava.lang.StringMaster’s Name or NameU.

Returns: int - The unique ID of the master within masters collection in this diagram.

addMaster(InputStream templateStream, int masterID)

public int addMaster(InputStream templateStream, int masterID)

Adds master to diagram from template stream by master’s ID.

Parameters:

ParameterTypeDescription
templateStreamjava.io.InputStreamtemplate stream.
masterIDintThe unique ID of the master within masters collection in template.

Returns: int - The unique ID of the master within masters collection in this diagram.

addMaster(InputStream templateStream, String masterName)

public int addMaster(InputStream templateStream, String masterName)

Adds master to diagram from template stream by master’s Name or NameU.

Parameters:

ParameterTypeDescription
templateStreamjava.io.InputStreamtemplate stream.
masterNamejava.lang.StringMaster’s Name or NameU.

Returns: int - The unique ID of the master within masters collection in this diagram.

addMaster(String templateFilePath, int masterID)

public int addMaster(String templateFilePath, int masterID)

Adds master to diagram from template file by master’s ID.

Parameters:

ParameterTypeDescription
templateFilePathjava.lang.StringPath to template file(can be vdx, vst or vsd format).
masterIDintThe unique ID of the master within masters collection in template.

Returns: int - The unique ID of the master within masters collection in this diagram.

addMaster(String templateFilePath, String masterName)

public int addMaster(String templateFilePath, String masterName)

Adds master to diagram from template file by master’s Name or NameU.

Parameters:

ParameterTypeDescription
templateFilePathjava.lang.StringPath to template file(can be vdx, vst or vsd format).
masterNamejava.lang.StringMaster’s Name or NameU.

Returns: int - The unique ID of the master within masters collection in this diagram.

addShape(Shape newShape, String masterName, int pageNumber)

public long addShape(Shape newShape, String masterName, int pageNumber)

Adds shape created by master to specific page.

Parameters:

ParameterTypeDescription
newShapeShapeNew shape objectShape.
masterNamejava.lang.StringMaster’s name.
pageNumberintIndex of page.

Returns: long - The unique ID of the shape within shapes collection on the specified page.

addShape(double pinX, double pinY, double width, double height, String masterName, int pageNumber)

public long addShape(double pinX, double pinY, double width, double height, String masterName, int pageNumber)

Adds shape created by master on page with defined PinX,PinY,Width and Height.

Parameters:

ParameterTypeDescription
pinXdoubleSpecifies the x-coordinate of the shape’s pin (center of rotation) in relation to the page.
pinYdoubleSpecifies the y-coordinate of the shape’s pin (center of rotation) in relation to the page.
widthdoubleSpecifies the width of the shape in inches.
heightdoubleSpecifies the height of the shape in inches.
masterNamejava.lang.StringMaster’s name.
pageNumberintIndex of page.

Returns: long - The unique ID of the shape within shapes collection on the specified page.

addShape(double pinX, double pinY, String masterName, int pageNumber)

public long addShape(double pinX, double pinY, String masterName, int pageNumber)

Adds shape created by master on page with defined PinX and PinY.

Parameters:

ParameterTypeDescription
pinXdoubleSpecifies the x-coordinate of the shape’s pin (center of rotation) in relation to the page.
pinYdoubleSpecifies the y-coordinate of the shape’s pin (center of rotation) in relation to the page.
masterNamejava.lang.StringMaster’s name.
pageNumberintIndex of page.

Returns: long - The unique ID of the shape within shapes collection on the specified page.

combine(Diagram secondDiagram)

public void combine(Diagram secondDiagram)

Combines another Diagram object.

Parameters:

ParameterTypeDescription
secondDiagramDiagramAnother Diagram object.

copyTheme(Diagram source)

public void copyTheme(Diagram source)

Copies Theme from a source Diagram.

Parameters:

ParameterTypeDescription
sourceDiagramsource diagram.

dispose()

public void dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

export(InputStream inputVsd, InputStream outputVdw)

public static void export(InputStream inputVsd, InputStream outputVdw)

Exports the diagram from vsd stream to vdw stream format. Not implemented yet.

Parameters:

ParameterTypeDescription
inputVsdjava.io.InputStreamvsd stream.
outputVdwjava.io.InputStreamvdw stream.

export(InputStream inputVsd, String outputVdw)

public static void export(InputStream inputVsd, String outputVdw)

Exports the diagram from vsd stream to *.vdw file format. Not implemented yet.

Parameters:

ParameterTypeDescription
inputVsdjava.io.InputStream*.vsd file name.
outputVdwjava.lang.Stringvdw stream.

export(String inputVsd, InputStream outputVdw)

public static void export(String inputVsd, InputStream outputVdw)

Exports the diagram from vsd file to vdw stream format. Not implemented yet.

Parameters:

ParameterTypeDescription
inputVsdjava.lang.String*.vsd file name.
outputVdwjava.io.InputStreamvdw stream.

export(String inputVsd, String outputVdw)

public static void export(String inputVsd, String outputVdw)

Exports the diagram from vsd to vdw format. Not implemented yet.

Parameters:

ParameterTypeDescription
inputVsdjava.lang.String*.vsd file name.
outputVdwjava.lang.String*.vdw file name.

getActivePage()

public Page getActivePage()

Specifies the active page

Returns: Page

getBuildnum()

public long getBuildnum()

The build number of the Visio instance used to create the document.

Returns: long

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getColors()

public ColorEntryCollection getColors()

Contains the document’s color table. Each document contains a single color table, which lists the 24 standard colors that are available for application to objects such as shapes, text, and layers in the document.

Returns: ColorEntryCollection

getDataConnections()

public DataConnectionCollection getDataConnections()

Contains the DataConnection elements for the document.

Returns: DataConnectionCollection

getDataRecordSets()

public DataRecordSetCollection getDataRecordSets()

The collection of DataRecordset objects associated with a Document object.

Returns: DataRecordSetCollection

getDefaultFontDir()

public ArrayList getDefaultFontDir()

Get the Default Fonts folder path

Returns: java.util.ArrayList

getDocLangID()

public int getDocLangID()

The unique ID of the user-interface language the user has specified in Microsoft Office 2010 Language Preferences.

Returns: int

getDocumentProps()

public DocumentProperties getDocumentProps()

Contains document property elements such as the document’s title, author, and so on.

Returns: DocumentProperties

getDocumentSettings()

public DocumentSettings getDocumentSettings()

Contains elements that specify document settings.

Returns: DocumentSettings

getDocumentSheet()

public DocumentSheet getDocumentSheet()

Specifies a document’s ShapeSheet structure.

Returns: DocumentSheet

getEmailRoutingData()

public byte[] getEmailRoutingData()

Contains a MIME (Multipurpose Internet Mail Extensions) encoded MAPI e-mail routing slip for the document.

Returns: byte[]

getEventItems()

public EventItemCollection getEventItems()

Contains an EventItem element for each event to which an object should respond.

Returns: EventItemCollection

getFonts()

public FontCollection getFonts()

Contains a collection of Font elements

Returns: FontCollection

getHeaderFooter()

public HeaderFooter getHeaderFooter()

Contains elements for a document’s header and footer.

Returns: HeaderFooter

getInterruptMonitor()

public AbstractInterruptMonitor getInterruptMonitor()

the interrupt monitor.

Returns: AbstractInterruptMonitor

getKey()

public String getKey()

Indicates whether the document has been modified outside of Visio. If present, Visio will fully test the contents of the file. Omit for files you create outside of Visio.

Returns: java.lang.String

getMasters()

public MasterCollection getMasters()

Collection Master objects.

Returns: MasterCollection

getMetric()

public int getMetric()

Whether to use metric units in the drawing. Set this attribute to True (1) to use metric units; set it to False (0) to use English units.

Returns: int

getPages()

public PageCollection getPages()

Collection Page objects.

Returns: PageCollection

getRibbonX()

public String getRibbonX()

The Ribbon XML string that is passed to the document to customize the ribbon user interface.

Returns: java.lang.String

getSolutionXMLs()

public SolutionXMLCollection getSolutionXMLs()

XML value.

Returns: SolutionXMLCollection

getStart()

public long getStart()

Indicates whether the document has been modified outside of Visio. If present, Visio will fully test the contents of the file. Omit for files you create outside of Visio.

Returns: long

getStyleSheets()

public StyleSheetCollection getStyleSheets()

Collection StyleSheet objects.

Returns: StyleSheetCollection

getUnusedStyles()

public StyleSheetCollection getUnusedStyles()

Get unused Styles

Returns: StyleSheetCollection

getUserCustomUI()

public String getUserCustomUI()

The Ribbon XML string that is passed to the document to customize the Quick Access toolbar or the ribbon.

Returns: java.lang.String

getValidation()

public Validation getValidation()

Stores information about diagram validation for the document.

Returns: Validation

getVbProjectData()

public byte[] getVbProjectData()

Contains the Microsoft Visual Basic for Applications project data in MIME (Multipurpose Internet Mail Extensions) encoded format.

Returns: byte[]

getVbaProject()

public VbaProject getVbaProject()

Gets the VbaProjectgetVbaProject().

Returns: VbaProject

getVersion()

public String getVersion()

The version number of the Visio instance. Microsoft Visio 2010 = 14.

Returns: java.lang.String

getWindows()

public WindowCollection getWindows()

Contains the Window elements for a document.

Returns: WindowCollection

hasHiddenInfo()

public boolean hasHiddenInfo()

Indicates whether this diagram has hidden information.

Returns: boolean

hashCode()

public native int hashCode()

Returns: int

layout(LayoutOptions options)

public void layout(LayoutOptions options)

Lays out the shapes and/or reroutes the connectors for all pages of diagram.

Parameters:

ParameterTypeDescription
optionsLayoutOptionsUsing the LayoutOptions to configure options of layout.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()
public void print(String printerName)

Print the whole document to the specified printer,using the standard (no User Interface) print controller. If printerName is Null or empty will be used default printer.

Parameters:

ParameterTypeDescription
printerNamejava.lang.StringThe name of the printer.Can be Null
public void print(String printerName, PrintSaveOptions options)

Print the whole document to the specified printer,using the standard (no User Interface) print controller. If printerName is Null or empty will be used default printer.

Parameters:

ParameterTypeDescription
printerNamejava.lang.StringThe name of the printer.Can be Null
optionsPrintSaveOptionsThe print options.
public void print(String printerName, String documentName)

Prints the document,using the standard (no User Interface) print controller and a document name.

Parameters:

ParameterTypeDescription
printerNamejava.lang.StringThe name of the printer.Can be Null
documentNamejava.lang.StringThe document name to display (for example, in a print status dialog box or printer queue) while printing the document.
public void print(String printerName, String documentName, PrintSaveOptions options)

Prints the document,using the standard (no User Interface) print controller and a document name.

Parameters:

ParameterTypeDescription
printerNamejava.lang.StringThe name of the printer.Can be Null
documentNamejava.lang.StringThe document name to display (for example, in a print status dialog box or printer queue) while printing the document.
optionsPrintSaveOptionsThe print options.

removeHiddenInformation(int item)

public void removeHiddenInformation(int item)

Remove unused information

Parameters:

ParameterTypeDescription
itemintRemoveHiddenInfoItem.

removeMacro()

public void removeMacro()

Removes VBA/macro from this diagram.

save(OutputStream stream, SaveOptions saveOptions)

public void save(OutputStream stream, SaveOptions saveOptions)

Save the diagram to the stream.

Parameters:

ParameterTypeDescription
streamjava.io.OutputStreamThe file stream.
saveOptionsSaveOptionsThe save options.

save(OutputStream stream, int format)

public void save(OutputStream stream, int format)

Save the diagram to the stream.

Parameters:

ParameterTypeDescription
streamjava.io.OutputStreamThe file stream.
formatint

save(String filename, SaveOptions options)

public void save(String filename, SaveOptions options)

Saves the document to a file using the specified save options.

Parameters:

ParameterTypeDescription
filenamejava.lang.StringThe file name.
optionsSaveOptionsSaveOptions save diagram options.

save(String filename, int format)

public void save(String filename, int format)

Saves the diagram data to the file.

Parameters:

ParameterTypeDescription
filenamejava.lang.StringThe file name.
formatintAspose.Diagram.SaveFileFormat save file format.

setBuildnum(long value)

public void setBuildnum(long value)

For the description of this property, please see getBuildnum()

Parameters:

ParameterTypeDescription
valuelong

setDocLangID(int value)

public void setDocLangID(int value)

For the description of this property, please see getDocLangID()

Parameters:

ParameterTypeDescription
valueint

setEmailRoutingData(byte[] value)

public void setEmailRoutingData(byte[] value)

For the description of this property, please see getEmailRoutingData()

Parameters:

ParameterTypeDescription
valuebyte[]

setFontDirs(String[] value)

public void setFontDirs(String[] value)

Indicates the Fonts folder path

Parameters:

ParameterTypeDescription
valuejava.lang.String[]

setInterruptMonitor(AbstractInterruptMonitor value)

public void setInterruptMonitor(AbstractInterruptMonitor value)

For the description of this property, please see getInterruptMonitor()

Parameters:

ParameterTypeDescription
valueAbstractInterruptMonitor

setKey(String value)

public void setKey(String value)

For the description of this property, please see getKey()

Parameters:

ParameterTypeDescription
valuejava.lang.String

setMetric(int value)

public void setMetric(int value)

For the description of this property, please see getMetric()

Parameters:

ParameterTypeDescription
valueint

setRibbonX(String value)

public void setRibbonX(String value)

For the description of this property, please see getRibbonX()

Parameters:

ParameterTypeDescription
valuejava.lang.String

setStart(long value)

public void setStart(long value)

For the description of this property, please see getStart()

Parameters:

ParameterTypeDescription
valuelong

setUserCustomUI(String value)

public void setUserCustomUI(String value)

For the description of this property, please see getUserCustomUI()

Parameters:

ParameterTypeDescription
valuejava.lang.String

setVbProjectData(byte[] value)

public void setVbProjectData(byte[] value)

For the description of this property, please see getVbProjectData()

Parameters:

ParameterTypeDescription
valuebyte[]

setVersion(String value)

public void setVersion(String value)

For the description of this property, please see getVersion()

Parameters:

ParameterTypeDescription
valuejava.lang.String

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int