Skip to content

Commit

Permalink
Revamped for latest version
Browse files Browse the repository at this point in the history
Revamped with several updates
  • Loading branch information
farhan-raza committed Jan 28, 2019
1 parent 92d81e4 commit 493e7fc
Show file tree
Hide file tree
Showing 47 changed files with 74 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Examples/pom.xml
Expand Up @@ -31,7 +31,7 @@
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-diagram</artifactId>
<version>18.12</version>
<version>19.1</version>
<classifier>jdk16</classifier>
</dependency>
<dependency>
Expand Down
Expand Up @@ -17,7 +17,7 @@ public static void main(String[] args) throws Exception {
diagram.getPages().getPage(0).addComment(7.205905511811023, 3.880708661417323, "test@");

// Save diagram
diagram.save(dataDir + "AddPageLevelCommentInVisio-out.vdx", SaveFileFormat.VSDX);
diagram.save(dataDir + "AddPageLevelCommentInVisio-out.vsdx", SaveFileFormat.VSDX);
}

}
Expand Up @@ -12,7 +12,7 @@ public class ModifyVBAModuleCode {
public static void main(String[] args) throws Exception {
// load an existing Visio diagram
String dataDir = Utils.getSharedDataDir(ModifyVBAModuleCode.class) + "Diagrams/";
InputStream input = new FileInputStream(dataDir + "macro.vsdm");
InputStream input = new FileInputStream(dataDir + "Macro.vsdm");
com.aspose.diagram.Diagram diagram = new com.aspose.diagram.Diagram(input);
// extract VBA project
VbaProject v = diagram.getVbaProject();
Expand Down
Expand Up @@ -13,7 +13,7 @@ public static void main(String[] args) throws Exception {
String dataDir = Utils.getSharedDataDir(ReadDiagramFile.class) + "Diagrams/";
// Open the stream. Read only access is enough for Aspose.Diagram to
// load a diagram.
InputStream stream = new FileInputStream(dataDir + "ReadDiagramFile.vsdx");
InputStream stream = new FileInputStream(dataDir + "ReadDiagramFile.vsd");

// load diagram
Diagram vsdDiagram = new Diagram(stream);
Expand Down
Expand Up @@ -17,7 +17,7 @@ public static void main(String[] args) throws Exception {
Diagram diagram = new Diagram(path);

// Set some summary information about the diagram
diagram.getDocumentProps().setCreator("Ijaz");
diagram.getDocumentProps().setCreator("Farhan");
diagram.getDocumentProps().setCompany("Aspose");
diagram.getDocumentProps().setCategory("Drawing 2D");
diagram.getDocumentProps().setManager("Sergey Polshkov");
Expand Down
Expand Up @@ -19,7 +19,7 @@ public static void main(String[] args) throws Exception {
String dataDir = Utils.getSharedDataDir(RetrieveMasterInfo.class) + "Masters/";

// Call the diagram constructor to load diagram from a VDX file
Diagram diagram = new Diagram(dataDir + "drawing.vdx");
Diagram diagram = new Diagram(dataDir + "drawing1.vdx");

for (Master master : (Iterable<Master>) diagram.getMasters()) {
// Display information about the masters
Expand Down
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] args) throws Exception {
String dataDir = Utils.getSharedDataDir(CopyVisioPage.class) + "Pages/";

// Call the diagram constructor to load diagram from a VSD file
Diagram originalDiagram = new Diagram(dataDir + "Drawing1.vsd");
Diagram originalDiagram = new Diagram(dataDir + "Drawing1.vsdx");

// initialize the new visio diagram
Diagram newDiagram = new Diagram();
Expand Down
Expand Up @@ -13,7 +13,7 @@ public class AddingNewShape {
public static void main(String[] args) throws Exception {
// ExStart:AddingNewShape
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(AddingNewShape.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(AddingNewShape.class) + "Shapes/";
// Load a diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
// get page by name
Expand Down
Expand Up @@ -11,7 +11,7 @@ public class CalculateCenterOfSubShapes {
public static void main(String[] args) throws Exception {
// ExStart:CalculateCenterOfSubShapes
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(CalculateCenterOfSubShapes.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(CalculateCenterOfSubShapes.class) + "Shapes/";

// load Visio diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
Expand Down
Expand Up @@ -11,7 +11,7 @@ public class ChangeShapeSize {
public static void main(String[] args) throws Exception {
// ExStart:ChangeShapeSize
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(ChangeShapeSize.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(ChangeShapeSize.class) + "Shapes/";

// call a Diagram class constructor to load the VSDX diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
Expand Down
Expand Up @@ -12,7 +12,7 @@ public class ConnectVisioSubShapes {
public static void main(String[] args) throws Exception {
// ExStart:ConnectVisioSubShapes
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(ConnectVisioSubShapes.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(ConnectVisioSubShapes.class) + "Shapes/";
// set sub shape ids
long shapeFromId = 2;
long shapeToId = 4;
Expand All @@ -28,7 +28,8 @@ public static void main(String[] args) throws Exception {
shape.getLine().getLineWeight().setValue(0.01388);

// add shape
long connecter1Id = diagram.addShape(shape, "Dynamic connector", page.getID());
long connecter1Id = page.addShape(shape, "Dynamic connector");

// connect sub-shapes
page.connectShapesViaConnector(shapeFromId, ConnectionPointPlace.RIGHT, shapeToId, ConnectionPointPlace.LEFT,
connecter1Id);
Expand Down
Expand Up @@ -13,7 +13,7 @@ public class CopyShape {
public static void main(String[] args) throws Exception {
// ExStart:CopyShape
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(CopyShape.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(CopyShape.class) + "Shapes/";
// load a source Visio
Diagram srcVisio = new Diagram(dataDir + "Drawing1.vsdx");

Expand Down
Expand Up @@ -9,7 +9,7 @@ public class GetAllConnectedShapes {
public static void main(String[] args) throws Exception {
// ExStart:GetAllConnectedShapes
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(GetAllConnectedShapes.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(GetAllConnectedShapes.class) + "Shapes/";
// call a Diagram class constructor to load the VSDX diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
// get shape by id
Expand Down
Expand Up @@ -11,7 +11,7 @@ public class GroupShapes {
public static void main(String[] args) throws Exception {
// ExStart:GroupShapes
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(GroupShapes.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(GroupShapes.class) + "Shapes/";
// load a Visio diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
// get page by name
Expand Down
Expand Up @@ -11,7 +11,7 @@ public class MoveVisioShape {
public static void main(String[] args) throws Exception {
// ExStart:MoveVisioShape
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(MoveVisioShape.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(MoveVisioShape.class) + "Shapes/";
// call a Diagram class constructor to load the VSDX diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
// get page by name
Expand Down
Expand Up @@ -11,7 +11,7 @@ public class ReadAllShapeProps {
public static void main(String[] args) throws Exception {
// ExStart:ReadAllShapeProps
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(ReadAllShapeProps.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(ReadAllShapeProps.class) + "Shapes/";

// call a Diagram class constructor to load the VSDX diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
Expand Down
Expand Up @@ -11,7 +11,7 @@ public class ReadShapePropByName {
public static void main(String[] args) throws Exception {
// ExStart:ReadShapePropByName
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(ReadShapePropByName.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(ReadShapePropByName.class) + "Shapes/";
// call a Diagram class constructor to load the VSDX diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
// get page by name
Expand Down
Expand Up @@ -12,7 +12,7 @@ public class RerouteConnectors {
public static void main(String[] args) throws Exception {
// ExStart:RerouteConnectors
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(RerouteConnectors.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(RerouteConnectors.class) + "Shapes/";
// call a Diagram class constructor to load the VSDX diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
// get page by name
Expand Down
Expand Up @@ -15,7 +15,7 @@ public class RetrieveShapeInfo {
public static void main(String[] args) throws Exception {
// ExStart:RetrieveShapeInfo
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(RetrieveShapeInfo.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(RetrieveShapeInfo.class) + "Shapes/";

// Load diagram
Diagram diagram = new Diagram(dataDir + "RetrieveShapeInfo.vsd");
Expand Down
Expand Up @@ -14,7 +14,7 @@ public class SaveVisioShapeInOtherFormats {
public static void main(String[] args) throws Exception {
// ExStart:SaveVisioShapeInOtherFormats
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(SaveVisioShapeInOtherFormats.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(SaveVisioShapeInOtherFormats.class) + "Shapes/";

double shapeWidth = 0;
double shapeHeight = 0;
Expand Down
Expand Up @@ -12,7 +12,7 @@ public class SetConnectorAppearance {
public static void main(String[] args) throws Exception {
// ExStart:SetConnectorAppearance
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(SetConnectorAppearance.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(SetConnectorAppearance.class) + "Shapes/";
// call a Diagram class constructor to load the VSDX diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");

Expand Down
Expand Up @@ -15,7 +15,7 @@ public class SetFillData {
public static void main(String[] args) throws Exception {
// ExStart:SetFillData
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(SetFillData.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(SetFillData.class) + "Shapes/";

// Call the diagram constructor to load diagram from a VDX file
Diagram diagram = new Diagram(dataDir + "Drawing1.vsd");
Expand Down
Expand Up @@ -15,7 +15,7 @@ public class SetLineData {
public static void main(String[] args) throws Exception {
// ExStart:SetLineData
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(SetLineData.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(SetLineData.class) + "Shapes/";

// load a Visio diagram
Diagram diagram = new Diagram(dataDir + "SetLineData.vsd");
Expand Down
Expand Up @@ -10,7 +10,7 @@ public class SetXFormdata {
public static void main(String[] args) throws Exception {
// ExStart:SetXFormdata
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(SetXFormdata.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(SetXFormdata.class) + "Shapes/";
// call a Diagram class constructor to load the VSD diagram
Diagram diagram = new Diagram(dataDir + "SetXFormdata.vsd");

Expand Down
Expand Up @@ -10,7 +10,7 @@ public class VerifyConnectedOrGluedShapes {
public static void main(String[] args) throws Exception {
// ExStart:VerifyConnectedOrGluedShapes
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(VerifyConnectedOrGluedShapes.class) + "Protection/";
String dataDir = Utils.getSharedDataDir(VerifyConnectedOrGluedShapes.class) + "Shapes/";
// call a Diagram class constructor to load the VSD diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
// set two shape ids
Expand Down
Expand Up @@ -96,7 +96,7 @@ public static void main(String[] args) throws Exception {
ConnectionPointPlace.LEFT, connecter2Id);

// Save the diagram
diagram.save(dataDir + "AddConnectShapes_Out.vsdx", SaveFileFormat.VDX);
diagram.save(dataDir + "AddConnectShapes_Out.vsdx", SaveFileFormat.VSDX);
// ExEnd:AddConnectShapes
}
}
Expand Up @@ -12,7 +12,7 @@ public static void main(String[] args) throws Exception {
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(RetrieveActiveXControl.class) + "VisioActiveXControls/";
// load a Visio diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsd");
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
// get a Visio page by name
Page page = diagram.getPages().getPage("Page-1");
// get a shape by ID
Expand Down
Expand Up @@ -29,6 +29,6 @@ public static void main(String[] args) throws Exception {
shape.getEvent().getEventXFMod().getUfe().setF("CALLTHIS(\"ThisDocument.ShowAlert\")");

// save diagram
diagram.save(dataDir + "Output_NET.vsdm", SaveFileFormat.VSDM);
diagram.save(dataDir + "Output_Java.vsdm", SaveFileFormat.VSDM);
}
}
Binary file added Examples/src/main/resources/Diagrams/out.vssm
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
1 change: 1 addition & 0 deletions Examples/src/main/resources/Masters/Drawing1.vdx

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
12 changes: 12 additions & 0 deletions Examples/src/main/resources/Text/ApplyCustomStyleSheets_Out.vdx

Large diffs are not rendered by default.

Binary file modified Examples/src/main/resources/VisioActiveXControls/Drawing1.vsdx
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 493e7fc

Please sign in to comment.