com.aspose.diagram
Class Diagram

java.lang.Object
    extended by com.aspose.diagram.Diagram

public class Diagram 
extends java.lang.Object

Root element of Visio objects hierarchy.


Constructor Summary
Diagram()
          
Diagram(java.lang.String filename)
           Public class constructor, loads the diagram from the file.
Diagram(java.io.InputStream stream)
           Public class constructor, loads the diagram from the stream.
Diagram(java.io.InputStream stream, int format)
           Public class constructor, loads the diagram from the stream using predefined format.
Diagram(java.io.InputStream stream, LoadOptions options)
           Public class constructor, loads the diagram from the stream using predefined load file options.
Diagram(java.lang.String filename, int format)
           Public class constructor, loads the diagram from the file using predefined format.
Diagram(java.lang.String filename, LoadOptions options)
           Public class constructor, loads the diagram from the file using predefined load file options.
 
Property Getters/Setters Summary
PagegetActivePage()
           Specifies the active page
longgetBuildnum()
voidsetBuildnum(long)
           The build number of the Visio instance used to create the document.
ColorEntryCollectiongetColors()
           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.
DataConnectionCollectiongetDataConnections()
           Contains the DataConnection elements for the document.
DataRecordSetCollectiongetDataRecordSets()
           The collection of DataRecordset objects associated with a Document object.
intgetDocLangID()
voidsetDocLangID(int)
           The unique ID of the user-interface language the user has specified in Microsoft Office 2010 Language Preferences.
DocumentPropertiesgetDocumentProps()
           Contains document property elements such as the document's title, author, and so on.
DocumentSettingsgetDocumentSettings()
           Contains elements that specify document settings.
DocumentSheetgetDocumentSheet()
           Specifies a document's ShapeSheet structure.
byte[]getEmailRoutingData()
voidsetEmailRoutingData(byte[])
           Contains a MIME (Multipurpose Internet Mail Extensions) encoded MAPI e-mail routing slip for the document.
EventItemCollectiongetEventItems()
           Contains an EventItem element for each event to which an object should respond.
voidsetFontDirs(java.lang.String[])
           Indicates the Fonts folder path
FontCollectiongetFonts()
           Contains a collection of Font elements
HeaderFootergetHeaderFooter()
           Contains elements for a document's header and footer.
AbstractInterruptMonitorgetInterruptMonitor()
voidsetInterruptMonitor(AbstractInterruptMonitor)
           Gets and sets the interrupt monitor.
java.lang.StringgetKey()
voidsetKey(java.lang.String)
           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.
MasterCollectiongetMasters()
           Collection Master objects.
intgetMetric()
voidsetMetric(int)
           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. The value of the property is BOOL integer constant.
PageCollectiongetPages()
           Collection Page objects.
java.lang.StringgetRibbonX()
voidsetRibbonX(java.lang.String)
           The Ribbon XML string that is passed to the document to customize the ribbon user interface.
SolutionXMLCollectiongetSolutionXMLs()
           XML value.
longgetStart()
voidsetStart(long)
           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.
StyleSheetCollectiongetStyleSheets()
           Collection StyleSheet objects.
java.lang.StringgetUserCustomUI()
voidsetUserCustomUI(java.lang.String)
           The Ribbon XML string that is passed to the document to customize the Quick Access toolbar or the ribbon.
ValidationgetValidation()
           Stores information about diagram validation for the document.
VbaProjectgetVbaProject()
           Gets the VbaProjectVbaProject.
byte[]getVbProjectData()
voidsetVbProjectData(byte[])
           Contains the Microsoft Visual Basic for Applications project data in MIME (Multipurpose Internet Mail Extensions) encoded format.
java.lang.StringgetVersion()
voidsetVersion(java.lang.String)
           The version number of the Visio instance. Microsoft Visio 2010 = 14.
WindowCollectiongetWindows()
           Contains the Window elements for a document.
 
Method Summary
intaddMaster(Diagram srcDiagram, java.lang.String masterName)
           Adds master to diagram from source diagram by master's Name or NameU.
intaddMaster(java.io.InputStream templateStream, int masterID)
           Adds master to diagram from template stream by master's ID.
intaddMaster(java.io.InputStream templateStream, java.lang.String masterName)
           Adds master to diagram from template stream by master's Name or NameU.
intaddMaster(java.lang.String templateFilePath, int masterID)
           Adds master to diagram from template file by master's ID.
intaddMaster(java.lang.String templateFilePath, java.lang.String masterName)
           Adds master to diagram from template file by master's Name or NameU.
longaddShape(Shape newShape, java.lang.String masterName, int pageNumber)
           Adds shape created by master to specific page.
longaddShape(double pinX, double pinY, double width, double height, java.lang.String masterName, int pageNumber)
           Adds shape created by master on page with defined PinX,PinY,Width and Height.
longaddShape(double pinX, double pinY, java.lang.String masterName, int pageNumber)
           Adds shape created by master on page with defined PinX and PinY.
voidcombine(Diagram secondDiagram)
           Combines another Diagram object.
voidcopyTheme(Diagram source)
           Copies Theme from a source Diagram.
voiddispose()
           Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
static voidexport(java.lang.String inputVsd, java.lang.String outputVdw)
           Exports the diagram from vsd to vdw format. Not implemented yet.
java.util.ArrayListgetDefaultFontDir()
           Get the Default Fonts folder path
StyleSheetCollectiongetUnusedStyles()
           Get unused Styles
booleanhasHiddenInfo()
           Indicates whether this diagram has hidden information.
voidlayout(LayoutOptions options)
           Lays out the shapes and/or reroutes the connectors for all pages of diagram.
voidprint(java.lang.String printerName)
           Print the whole document to the specified printer,using the standard (no User Interface) print controller.
voidprint(java.lang.String printerName, PrintSaveOptions options)
           Print the whole document to the specified printer,using the standard (no User Interface) print controller.
voidprint(java.lang.String printerName, java.lang.String documentName)
           Prints the document,using the standard (no User Interface) print controller and a document name.
voidprint(java.lang.String printerName, java.lang.String documentName, PrintSaveOptions options)
           Prints the document,using the standard (no User Interface) print controller and a document name.
voidremoveHiddenInformation(int item)
           Remove unused information
voidremoveMacro()
           Removes VBA/macro from this diagram.
voidsave(java.io.OutputStream stream, SaveOptions saveOptions)
           Save the diagram to the stream.
voidsave(java.io.OutputStream stream, int format)
           Save the diagram to the stream.
voidsave(java.lang.String filename, SaveOptions options)
           Saves the document to a file using the specified save options.
voidsave(java.lang.String filename, int format)
           Saves the diagram data to the file.
 

Constructor Detail

Diagram

public Diagram()

Diagram

public Diagram(java.lang.String filename)
        throws java.lang.Exception
Public class constructor, loads the diagram from the file.
Parameters:
filename - The file name.

Diagram

public Diagram(java.io.InputStream stream)
        throws java.lang.Exception
Public class constructor, loads the diagram from the stream.
Parameters:
stream - The data stream.

Diagram

public Diagram(java.io.InputStream stream, int format)
        throws java.lang.Exception
Public class constructor, loads the diagram from the stream using predefined format.
Parameters:
stream - The data stream.
format - A LoadFileFormat value. The data LoadFileFormat.

Diagram

public Diagram(java.io.InputStream stream, LoadOptions options)
        throws java.lang.Exception
Public class constructor, loads the diagram from the stream using predefined load file options.
Parameters:
stream - The data stream.
options - The data LoadOptions.

Diagram

public Diagram(java.lang.String filename, int format)
        throws java.lang.Exception
Public class constructor, loads the diagram from the file using predefined format.
Parameters:
filename - The file name.
format - A LoadFileFormat value. The file format.

Diagram

public Diagram(java.lang.String filename, LoadOptions options)
        throws java.lang.Exception
Public class constructor, loads the diagram from the file using predefined load file options.
Parameters:
filename - The file name.
options - The data LoadOptions.

Property Getters/Setters Detail

getStart/setStart

public long getStart() / public void setStart(long value)
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.

setFontDirs

public void setFontDirs(java.lang.String[] value)
Indicates the Fonts folder path

getKey/setKey

public java.lang.String getKey() / public void setKey(java.lang.String value)
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.

getMetric/setMetric

public int getMetric() / public void setMetric(int value)
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. The value of the property is BOOL integer constant.

getBuildnum/setBuildnum

public long getBuildnum() / public void setBuildnum(long value)
The build number of the Visio instance used to create the document.

getVersion/setVersion

public java.lang.String getVersion() / public void setVersion(java.lang.String value)
The version number of the Visio instance. Microsoft Visio 2010 = 14.

getDocLangID/setDocLangID

public int getDocLangID() / public void setDocLangID(int value)
The unique ID of the user-interface language the user has specified in Microsoft Office 2010 Language Preferences.

getStyleSheets

public StyleSheetCollection getStyleSheets()
Collection StyleSheet objects.

getMasters

public MasterCollection getMasters()
Collection Master objects.

getPages

public PageCollection getPages()
Collection Page objects.

getDocumentProps

public DocumentProperties getDocumentProps()
Contains document property elements such as the document's title, author, and so on.

getDocumentSettings

public DocumentSettings getDocumentSettings()
Contains elements that specify document settings.

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.

getFonts

public FontCollection getFonts()
Contains a collection of Font elements

getDocumentSheet

public DocumentSheet getDocumentSheet()
Specifies a document's ShapeSheet structure.

getActivePage

public Page getActivePage()
Specifies the active page

getWindows

public WindowCollection getWindows()
Contains the Window elements for a document.

getEventItems

public EventItemCollection getEventItems()
Contains an EventItem element for each event to which an object should respond.

getHeaderFooter

public HeaderFooter getHeaderFooter()
Contains elements for a document's header and footer.

getVbProjectData/setVbProjectData

public byte[] getVbProjectData() / public void setVbProjectData(byte[] value)
Contains the Microsoft Visual Basic for Applications project data in MIME (Multipurpose Internet Mail Extensions) encoded format.

getEmailRoutingData/setEmailRoutingData

public byte[] getEmailRoutingData() / public void setEmailRoutingData(byte[] value)
Contains a MIME (Multipurpose Internet Mail Extensions) encoded MAPI e-mail routing slip for the document.

getDataConnections

public DataConnectionCollection getDataConnections()
Contains the DataConnection elements for the document.

getDataRecordSets

public DataRecordSetCollection getDataRecordSets()
The collection of DataRecordset objects associated with a Document object.

getRibbonX/setRibbonX

public java.lang.String getRibbonX() / public void setRibbonX(java.lang.String value)
The Ribbon XML string that is passed to the document to customize the ribbon user interface.

getUserCustomUI/setUserCustomUI

public java.lang.String getUserCustomUI() / public void setUserCustomUI(java.lang.String value)
The Ribbon XML string that is passed to the document to customize the Quick Access toolbar or the ribbon.

getValidation

public Validation getValidation()
Stores information about diagram validation for the document.

getSolutionXMLs

public SolutionXMLCollection getSolutionXMLs()
XML value.

getVbaProject

public VbaProject getVbaProject()
Gets the VbaProjectVbaProject.

getInterruptMonitor/setInterruptMonitor

public AbstractInterruptMonitor getInterruptMonitor() / public void setInterruptMonitor(AbstractInterruptMonitor value)
Gets and sets the interrupt monitor.

Method Detail

save

public void save(java.lang.String filename, int format)
         throws java.lang.Exception
Saves the diagram data to the file.
Parameters:
filename - The file name.
format - A SaveFileFormat value. SaveFileFormat save file format.

save

public void save(java.io.OutputStream stream, int format)
         throws java.lang.Exception
Save the diagram to the stream.
Parameters:
stream - The file stream.
saveFormat - The save file format type.
Parameters:
format - A SaveFileFormat value.

save

public void save(java.io.OutputStream stream, SaveOptions saveOptions)
         throws java.lang.Exception
Save the diagram to the stream.
Parameters:
stream - The file stream.
saveOptions - The save options.

save

public void save(java.lang.String filename, SaveOptions options)
         throws java.lang.Exception
Saves the document to a file using the specified save options.
Parameters:
filename - The file name.
options - SaveOptions save diagram options.

export

public static void export(java.lang.String inputVsd, java.lang.String outputVdw)
                       throws java.lang.Exception
Exports the diagram from vsd to vdw format. Not implemented yet.
Parameters:
inputVsd - *.vsd file name.
outputVdw - *.vdw file name.

dispose

public void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

copyTheme

public void copyTheme(Diagram source)
Copies Theme from a source Diagram.
Parameters:
source - source diagram.

combine

public void combine(Diagram secondDiagram)
            throws java.lang.Exception
Combines another Diagram object.
Parameters:
secondDiagram - Another Diagram object.

layout

public void layout(LayoutOptions options)
           throws java.lang.Exception
Lays out the shapes and/or reroutes the connectors for all pages of diagram.
Parameters:
options - Using the LayoutOptions to configure options of layout.

addMaster

public int addMaster(Diagram srcDiagram, java.lang.String masterName)
             throws java.lang.Exception
Adds master to diagram from source diagram by master's Name or NameU.
Parameters:
srcDiagram - source diagram.
masterName - Master's Name or NameU.
Returns:
The unique ID of the master within masters collection in this diagram.

addMaster

public int addMaster(java.io.InputStream templateStream, java.lang.String masterName)
             throws java.lang.Exception
Adds master to diagram from template stream by master's Name or NameU.
Parameters:
templateStream - template stream.
masterName - Master's Name or NameU.
Returns:
The unique ID of the master within masters collection in this diagram.

addMaster

public int addMaster(java.io.InputStream templateStream, int masterID)
             throws java.lang.Exception
Adds master to diagram from template stream by master's ID.
Parameters:
templateStream - template stream.
masterID - The unique ID of the master within masters collection in template.
Returns:
The unique ID of the master within masters collection in this diagram.

addMaster

public int addMaster(java.lang.String templateFilePath, java.lang.String masterName)
             throws java.lang.Exception
Adds master to diagram from template file by master's Name or NameU.
Parameters:
templateFilePath - Path to template file(can be vdx, vst or vsd format).
masterName - Master's Name or NameU.
Returns:
The unique ID of the master within masters collection in this diagram.

addMaster

public int addMaster(java.lang.String templateFilePath, int masterID)
             throws java.lang.Exception
Adds master to diagram from template file by master's ID.
Parameters:
templateFilePath - Path to template file(can be vdx, vst or vsd format).
masterID - The unique ID of the master within masters collection in template.
Returns:
The unique ID of the master within masters collection in this diagram.

hasHiddenInfo

public boolean hasHiddenInfo()
Indicates whether this diagram has hidden information.

removeHiddenInformation

public void removeHiddenInformation(int item)
Remove unused information
Parameters:
item - RemoveHiddenInfoItem.

getUnusedStyles

public StyleSheetCollection getUnusedStyles()
Get unused Styles

addShape

public long addShape(Shape newShape, java.lang.String masterName, int pageNumber)
             throws java.lang.Exception
Adds shape created by master to specific page.
Parameters:
newShape - New shape objectShape.
masterName - Master's name.
pageNumber - Index of page.
Returns:
The unique ID of the shape within shapes collection on the specified page.

addShape

public long addShape(double pinX, double pinY, java.lang.String masterName, int pageNumber)
             throws java.lang.Exception
Adds shape created by master on page with defined PinX and PinY.
Parameters:
pinX - Specifies the x-coordinate of the shape's pin (center of rotation) in relation to the page.
pinY - Specifies the y-coordinate of the shape's pin (center of rotation) in relation to the page.
masterName - Master's name.
pageNumber - Index of page.
Returns:
The unique ID of the shape within shapes collection on the specified page.

addShape

public long addShape(double pinX, double pinY, double width, double height, java.lang.String masterName, int pageNumber)
             throws java.lang.Exception
Adds shape created by master on page with defined PinX,PinY,Width and Height.
Parameters:
pinX - Specifies the x-coordinate of the shape's pin (center of rotation) in relation to the page.
pinY - Specifies the y-coordinate of the shape's pin (center of rotation) in relation to the page.
width - Specifies the width of the shape in inches.
height - Specifies the height of the shape in inches.
masterName - Master's name.
pageNumber - Index of page.
Returns:
The unique ID of the shape within shapes collection on the specified page.

print

public void print(java.lang.String printerName)
          throws java.lang.Exception
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:
printerName - The name of the printer.Can be Null

print

public void print(java.lang.String printerName, PrintSaveOptions options)
          throws java.lang.Exception
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:
printerName - The name of the printer.Can be Null
options - The print options.

print

public void print(java.lang.String printerName, java.lang.String documentName, PrintSaveOptions options)
          throws java.lang.Exception
Prints the document,using the standard (no User Interface) print controller and a document name.
Parameters:
printerName - The name of the printer.Can be Null
documentName - The document name to display (for example, in a print status dialog box or printer queue) while printing the document.
options - The print options.

print

public void print(java.lang.String printerName, java.lang.String documentName)
          throws java.lang.Exception
Prints the document,using the standard (no User Interface) print controller and a document name.
Parameters:
printerName - The name of the printer.Can be Null
documentName - The document name to display (for example, in a print status dialog box or printer queue) while printing the document.

getDefaultFontDir

public java.util.ArrayList getDefaultFontDir()
                           throws java.lang.Exception
Get the Default Fonts folder path

removeMacro

public void removeMacro()
Removes VBA/macro from this diagram.

See Also:
          Aspose.Diagram Documentation - the home page for the Aspose.Diagram Product Documentation.
          Aspose.Diagram Support Forum - our preferred method of support.