You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by vi...@apache.org on 2015/10/19 08:08:59 UTC

svn commit: r1709357 - in /poi/trunk/src/ooxml/java/org/apache/poi/xdgf: usermodel/ usermodel/section/ usermodel/shape/ util/

Author: virtuald
Date: Mon Oct 19 06:08:58 2015
New Revision: 1709357

URL: http://svn.apache.org/viewvc?rev=1709357&view=rev
Log:
Add some limited XDGF documentation

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFBaseContents.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFCell.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFConnection.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFDocument.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMaster.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasterContents.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPage.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPageContents.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPages.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFRelation.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFSheet.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFText.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XmlVisioDocument.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/shape/ShapeVisitor.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/util/HierarchyPrinter.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/util/VsdxToPng.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFBaseContents.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFBaseContents.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFBaseContents.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFBaseContents.java Mon Oct 19 06:08:58 2015
@@ -40,7 +40,9 @@ import com.microsoft.schemas.office.visi
 import com.microsoft.schemas.office.visio.x2012.main.ShapeSheetType;
 
 /**
- * Container of shapes for a page in a visio document
+ * Container of shapes for a page in a Visio diagram. Shapes are not
+ * necessarily literal shapes in the diagram, but is the term that is
+ * used to describe the basic elements that make up a Visio diagram.
  */
 public class XDGFBaseContents extends XDGFXMLDocumentPart {
 
@@ -105,6 +107,7 @@ public class XDGFBaseContents extends XD
     //
 
     /**
+     * Draws the contents of a page onto a Graphics2D object
      *
      * @param graphics
      */
@@ -128,8 +131,7 @@ public class XDGFBaseContents extends XD
     public List<XDGFShape> getTopLevelShapes() {
         return Collections.unmodifiableList(_toplevelShapes);
     }
-
-    // get connections
+    
     public List<XDGFConnection> getConnections() {
         return Collections.unmodifiableList(_connections);
     }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFCell.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFCell.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFCell.java Mon Oct 19 06:08:58 2015
@@ -31,6 +31,10 @@ import com.microsoft.schemas.office.visi
  *
  * The various attributes of a Cell are constrained, and are better defined in
  * the XSD 1.1 visio schema
+ * 
+ * Values of a cell are often the result of a formula computation. Luckily for
+ * you, Visio seems to always write the result to the document file, so unless
+ * the values change we don't need to recompute the values.
  */
 public class XDGFCell {
 
@@ -97,7 +101,10 @@ public class XDGFCell {
         }
     }
 
-    // returns a length, converts it to inches?
+    /**
+     * @param cell
+     * @return A value converted to inches
+     */
     public static Double parseVLength(CellType cell) {
         try {
             return Double.parseDouble(cell.getV());
@@ -116,7 +123,7 @@ public class XDGFCell {
     }
 
     @Internal
-    CellType getXmlObject() {
+    protected CellType getXmlObject() {
         return _cell;
     }
 

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFConnection.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFConnection.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFConnection.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFConnection.java Mon Oct 19 06:08:58 2015
@@ -19,6 +19,15 @@ package org.apache.poi.xdgf.usermodel;
 
 import com.microsoft.schemas.office.visio.x2012.main.ConnectType;
 
+/**
+ * Represents connections in a Visio diagram.
+ * 
+ * Note that just because something appears to be visually connected in a
+ * document does not mean that the user actually connected the elements. It
+ * turns out there are a lot of ways that a careless user can neglect to
+ * properly make connections that will not be recorded in the diagram
+ * in a machine readable way.
+ */
 public class XDGFConnection {
 
     // comments on frompart/topart taken from pkgVisio
@@ -126,7 +135,11 @@ public class XDGFConnection {
             return null;
     }
 
-    // see constants above
+    /**
+     * The ToPart property identifies the part of a shape to which another
+     * shape is glued, such as its begin point or endpoint, one of its edges,
+     * or a connection point.
+     */
     public Integer getToPart() {
         if (_connect.isSetToPart())
             return _connect.getToPart();

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFDocument.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFDocument.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFDocument.java Mon Oct 19 06:08:58 2015
@@ -44,7 +44,7 @@ public class XDGFDocument {
 
 
     public XDGFDocument(VisioDocumentType document) {
-
+        
         _document = document;
 
         if (!_document.isSetDocumentSettings())

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMaster.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMaster.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMaster.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMaster.java Mon Oct 19 06:08:58 2015
@@ -22,13 +22,14 @@ import org.apache.poi.util.Internal;
 import com.microsoft.schemas.office.visio.x2012.main.MasterType;
 
 /**
- * Provides the API to work with an underlying master
+ * Provides the API to work with an underlying master. Typically, each set of
+ * stencils used in a Visio diagram are found in a separate master for each.
  */
 public class XDGFMaster {
 
     private MasterType _master;
-    private XDGFMasterContents _content;
-    XDGFSheet _pageSheet = null;
+    protected XDGFMasterContents _content;
+    protected XDGFSheet _pageSheet = null;
 
     public XDGFMaster(MasterType master, XDGFMasterContents content,
             XDGFDocument document) {
@@ -41,7 +42,7 @@ public class XDGFMaster {
     }
 
     @Internal
-    MasterType getXmlObject() {
+    protected MasterType getXmlObject() {
         return _master;
     }
 

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasterContents.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasterContents.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasterContents.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasterContents.java Mon Oct 19 06:08:58 2015
@@ -27,9 +27,12 @@ import org.apache.xmlbeans.XmlException;
 
 import com.microsoft.schemas.office.visio.x2012.main.MasterContentsDocument;
 
+/**
+ * Contains the actual contents of the master/stencil
+ */
 public class XDGFMasterContents extends XDGFBaseContents {
 
-    private XDGFMaster _master;
+    protected XDGFMaster _master;
 
     public XDGFMasterContents(PackagePart part, PackageRelationship rel,
             XDGFDocument document) {

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMasters.java Mon Oct 19 06:08:58 2015
@@ -36,19 +36,22 @@ import com.microsoft.schemas.office.visi
 import com.microsoft.schemas.office.visio.x2012.main.MastersDocument;
 import com.microsoft.schemas.office.visio.x2012.main.MastersType;
 
+/**
+ * A collection of masters (typically stencils) in a Visio document
+ */
 public class XDGFMasters extends XDGFXMLDocumentPart {
 
     MastersType _mastersObject;
 
     // key: id of master
-    Map<Long, XDGFMaster> _masters = new HashMap<Long, XDGFMaster>();
+    protected Map<Long, XDGFMaster> _masters = new HashMap<Long, XDGFMaster>();
 
     public XDGFMasters(PackagePart part, PackageRelationship rel, XDGFDocument document) {
         super(part, rel, document);
     }
 
     @Internal
-    MastersType getXmlObject() {
+    protected MastersType getXmlObject() {
         return _mastersObject;
     }
 

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPage.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPage.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPage.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPage.java Mon Oct 19 06:08:58 2015
@@ -31,10 +31,10 @@ import com.microsoft.schemas.office.visi
  */
 public class XDGFPage {
 
-    PageType _page;
-    XDGFPageContents _content;
-    XDGFPages _pages;
-    XDGFSheet _pageSheet = null;
+    private PageType _page;
+    protected XDGFPageContents _content;
+    protected XDGFPages _pages;
+    protected XDGFSheet _pageSheet = null;
 
     public XDGFPage(PageType page, XDGFPageContents content,
             XDGFDocument document, XDGFPages pages) {
@@ -48,7 +48,7 @@ public class XDGFPage {
     }
 
     @Internal
-    PageType getXmlObject() {
+    protected PageType getXmlObject() {
         return _page;
     }
 
@@ -72,7 +72,9 @@ public class XDGFPage {
         return _pages.getPageList().indexOf(this) + 1;
     }
 
-    // height/width of page
+    /**
+     * @return width/height of page
+     */
     public Dimension2dDouble getPageSize() {
         XDGFCell w = _pageSheet.getCell("PageWidth");
         XDGFCell h = _pageSheet.getCell("PageHeight");
@@ -84,7 +86,9 @@ public class XDGFPage {
                 Double.parseDouble(h.getValue()));
     }
 
-    // origin of coordinate system
+    /**
+     * @return origin of coordinate system
+     */
     public Point2D.Double getPageOffset() {
         XDGFCell xoffcell = _pageSheet.getCell("XRulerOrigin");
         XDGFCell yoffcell = _pageSheet.getCell("YRulerOrigin");
@@ -101,7 +105,9 @@ public class XDGFPage {
         return new Point2D.Double(xoffset, yoffset);
     }
 
-    // bounding box of page
+    /**
+     * @return bounding box of page
+     */
     public Rectangle2D getBoundingBox() {
         Dimension2dDouble sz = getPageSize();
         Point2D.Double offset = getPageOffset();

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPageContents.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPageContents.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPageContents.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPageContents.java Mon Oct 19 06:08:58 2015
@@ -32,8 +32,8 @@ import com.microsoft.schemas.office.visi
 
 public class XDGFPageContents extends XDGFBaseContents {
 
-    Map<Long, XDGFMaster> _masters = new HashMap<Long, XDGFMaster>();
-    XDGFPage _page;
+    protected Map<Long, XDGFMaster> _masters = new HashMap<Long, XDGFMaster>();
+    protected XDGFPage _page;
 
     public XDGFPageContents(PackagePart part, PackageRelationship rel, XDGFDocument document) {
         super(part, rel, document);
@@ -71,6 +71,9 @@ public class XDGFPageContents extends XD
         }
     }
 
+    /**
+     * @return Parent page
+     */
     public XDGFPage getPage() {
         return _page;
     }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPages.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPages.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPages.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPages.java Mon Oct 19 06:08:58 2015
@@ -90,7 +90,9 @@ public class XDGFPages extends XDGFXMLDo
         }
     }
 
-    // ordered by page number
+    /**
+     * @return A list of pages ordered by page number
+     */
     public List<XDGFPage> getPageList() {
         return Collections.unmodifiableList(_pages);
     }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFRelation.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFRelation.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFRelation.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFRelation.java Mon Oct 19 06:08:58 2015
@@ -33,7 +33,7 @@ public class XDGFRelation extends POIXML
 
     public static final XDGFRelation DOCUMENT = new XDGFRelation(
             "application/vnd.ms-visio.drawing.main+xml",
-            "http://schemas.microsoft.com/visio/2010/relationships/document",
+            PackageRelationshipTypes.VISIO_CORE_DOCUMENT,
             "/visio/document.xml", null);
 
     public static final XDGFRelation MASTERS = new XDGFRelation(

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java Mon Oct 19 06:08:58 2015
@@ -173,8 +173,6 @@ public class XDGFShape extends XDGFSheet
      * Shapes that have a 'Master' attribute refer to a specific master in the
      * page, whereas shapes with a 'MasterShape' attribute refer to a subshape
      * of a Master.
-     *
-     *
      */
     protected void setupMaster(XDGFPageContents pageContents,
             XDGFMasterContents master) {
@@ -295,7 +293,9 @@ public class XDGFShape extends XDGFSheet
         return _geometry.get(idx);
     }
 
-    // only available if this is a shape group
+    /**
+     * Only available if this shape is a shape group, may be null 
+     */
     // -> May be null
     public List<XDGFShape> getShapes() {
         return _shapes;
@@ -334,7 +334,9 @@ public class XDGFShape extends XDGFSheet
         return _masterShape;
     }
 
-    // returns the parent shape of this shape, if its in a subshape
+    /**
+     * @return The parent shape if this is a subshape, null otherwise
+     */
     public XDGFShape getParentShape() {
         return _parent;
     }
@@ -807,14 +809,20 @@ public class XDGFShape extends XDGFSheet
                 _masterShape != null ? _masterShape._geometry : null);
     }
 
-    // returns a rectangle in local coordinates
+    /**
+     * @return rectangle in local coordinates
+     */
     public Rectangle2D.Double getBounds() {
         return new Rectangle2D.Double(0, 0, getWidth(), getHeight());
     }
-
-    // returns bounds as a path in local coordinates
-    // -> useful if you need to transform to global coordinates
-    // -> Don't use for 1d objects, fails for infinite line objects
+    
+    /**
+     * @return returns bounds as a path in local coordinates, which is
+     *         userful if you need to transform to global coordinates
+     *         
+     * @warning Don't use this for 1d objects, and will fail for
+     *          infinite line objects
+     */
     public Path2D.Double getBoundsAsPath() {
 
         Double w = getWidth();
@@ -830,7 +838,9 @@ public class XDGFShape extends XDGFSheet
         return bounds;
     }
 
-    // returns the path in local coordinates
+    /**
+     * @return The outline of the shape in local coordinates
+     */
     public Path2D.Double getPath() {
         for (GeometrySection geoSection : getGeometrySections()) {
             if (geoSection.getNoShow() == true)

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFSheet.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFSheet.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFSheet.java Mon Oct 19 06:08:58 2015
@@ -92,7 +92,11 @@ public abstract class XDGFSheet {
         return _document;
     }
 
-    // A cell is really just a setting
+    /**
+     * A cell is really just a setting
+     *
+     * @param cellName The particular setting you want
+     */
     public XDGFCell getCell(String cellName) {
         return _cells.get(cellName);
     }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFText.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFText.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFText.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFText.java Mon Oct 19 06:08:58 2015
@@ -52,10 +52,12 @@ public class XDGFText {
         // is a mixed type)
         return ((TextTypeImpl) _text).getStringValue();
     }
-
-    // these are in the shape coordinate system
-    // -> See
-    // https://msdn.microsoft.com/en-us/library/hh644132(v=office.12).aspx
+    
+    /**
+     * These are in the shape coordinate system
+     *
+     * @see https://msdn.microsoft.com/en-us/library/hh644132(v=office.12).aspx
+     */
     public Rectangle2D.Double getTextBounds() {
 
         double txtPinX = _parent.getTxtPinX();
@@ -73,8 +75,10 @@ public class XDGFText {
         return new Rectangle2D.Double(x, y, txtWidth, txtHeight);
     }
 
-    // returns bounds as a path in local coordinates
-    // -> useful if you need to transform to global coordinates
+    /**
+     * @return Text bounds as a path in local coordinates, which is useful
+     *         if you need to transform to global coordinates
+     */
     public Path2D.Double getBoundsAsPath() {
 
         Rectangle2D.Double rect = getTextBounds();
@@ -90,14 +94,19 @@ public class XDGFText {
 
         return bounds;
     }
-
-    // center of text in local coordinates
+    
+    /**
+     * @return Center of text in local coordinates
+     */
     public Point2D.Double getTextCenter() {
         return new Point2D.Double(_parent.getTxtLocPinX(),
                 _parent.getTxtLocPinY());
     }
 
-    // assumes graphics is set properly to draw in the right style
+    /**
+     * When calling this to draw text, it assumes graphics is set properly
+     * to draw in the right style.
+     */
     public void draw(Graphics2D graphics) {
 
         String textContent = getTextContent();

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XmlVisioDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XmlVisioDocument.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XmlVisioDocument.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/XmlVisioDocument.java Mon Oct 19 06:08:58 2015
@@ -28,22 +28,39 @@ import org.apache.poi.POIXMLException;
 import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
 import org.apache.poi.openxml4j.opc.OPCPackage;
 import org.apache.poi.openxml4j.opc.PackagePart;
+import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
 import org.apache.poi.util.PackageHelper;
 import org.apache.xmlbeans.XmlException;
 
 import com.microsoft.schemas.office.visio.x2012.main.VisioDocumentDocument1;
 import com.microsoft.schemas.office.visio.x2012.main.VisioDocumentType;
 
+/**
+ * This is your high-level starting point for working with Visio XML
+ * documents (.vsdx).
+ * 
+ * Currently, only read support has been implemented, and the API is
+ * not mature and is subject to change.
+ * 
+ * For more information about the visio XML format (with an XSD 1.0
+ * schema), you can find documentation at
+ * https://msdn.microsoft.com/en-us/library/hh645006(v=office.12).aspx
+ * 
+ * That document lacks in some areas, but you can find additional
+ * documentation and an updated XSD 1.1 schema at
+ * https://msdn.microsoft.com/en-us/library/office/jj684209(v=office.15).aspx
+ * 
+ * Each provides different details, but the SharePoint reference
+ * has better documentation and is more useful.
+ */
 public class XmlVisioDocument extends POIXMLDocument {
 
-    public static String CORE_DOCUMENT = "http://schemas.microsoft.com/visio/2010/relationships/document";
-
-    XDGFPages _pages;
-    XDGFMasters _masters;
-    XDGFDocument _document;
+    protected XDGFPages _pages;
+    protected XDGFMasters _masters;
+    protected XDGFDocument _document;
 
     public XmlVisioDocument(OPCPackage pkg) throws IOException {
-        super(pkg, CORE_DOCUMENT);
+        super(pkg, PackageRelationshipTypes.VISIO_CORE_DOCUMENT);
 
         VisioDocumentType document;
 
@@ -98,7 +115,7 @@ public class XmlVisioDocument extends PO
     //
     // Useful public API goes here
     //
-
+    
     public Collection<XDGFPage> getPages() {
         return _pages.getPageList();
     }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java Mon Oct 19 06:08:58 2015
@@ -23,7 +23,11 @@ import java.util.Map.Entry;
 import java.util.NoSuchElementException;
 import java.util.SortedMap;
 
-// iterates over the base and master
+/**
+ * An iterator used to iterate over the base and master items
+ *
+ * @param <T>
+ */
 public class CombinedIterable<T> implements Iterable<T> {
 
     final SortedMap<Long, T> _baseItems;

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/shape/ShapeVisitor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/shape/ShapeVisitor.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/shape/ShapeVisitor.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/shape/ShapeVisitor.java Mon Oct 19 06:08:58 2015
@@ -32,15 +32,17 @@ import org.apache.poi.xdgf.usermodel.XDG
  */
 public abstract class ShapeVisitor {
 
-    ShapeVisitorAcceptor _acceptor;
+    protected ShapeVisitorAcceptor _acceptor;
 
     public ShapeVisitor() {
         _acceptor = getAcceptor();
     }
-
-    // is only called on construction of the visitor, allows
-    // mixing visitors and acceptors
-    public ShapeVisitorAcceptor getAcceptor() {
+    
+    /**
+     * Is only called on construction of the visitor, allows
+     * mixing visitors and acceptors
+     */
+    protected ShapeVisitorAcceptor getAcceptor() {
         return new ShapeVisitorAcceptor() {
             @Override
             public boolean accept(XDGFShape shape) {

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/util/HierarchyPrinter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/util/HierarchyPrinter.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/util/HierarchyPrinter.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/util/HierarchyPrinter.java Mon Oct 19 06:08:58 2015
@@ -30,6 +30,10 @@ import org.apache.poi.xdgf.usermodel.XDG
 import org.apache.poi.xdgf.usermodel.XmlVisioDocument;
 import org.apache.poi.xdgf.usermodel.shape.ShapeVisitor;
 
+/**
+ * Debugging tool useful when trying to figure out the hierarchy of the
+ * shapes in a Visio diagram
+ */
 public class HierarchyPrinter {
 
     public static void printHierarchy(XDGFPage page, File outDir)

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/util/VsdxToPng.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/util/VsdxToPng.java?rev=1709357&r1=1709356&r2=1709357&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/util/VsdxToPng.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/util/VsdxToPng.java Mon Oct 19 06:08:58 2015
@@ -34,6 +34,12 @@ import org.apache.poi.xdgf.usermodel.Xml
 import org.apache.poi.xdgf.usermodel.shape.ShapeDebuggerRenderer;
 import org.apache.poi.xdgf.usermodel.shape.ShapeRenderer;
 
+/**
+ * Converts a Visio diagram to a PNG file.
+ * 
+ * As more elements and styles are added/supported the output will get
+ * better, but it's very rough right now.
+ */
 public class VsdxToPng {
 
     public static void renderToPng(XDGFPage page, String outFilename,



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org