@Override public void visit(XDGFShape shape, AffineTransform globalTransform, int level) { for (int i = 0; i < level; i++) { os.append(" "); } // TODO: write text? os.println(shape + " [" + shape.getShapeType() + ", " + shape.getSymbolName() + "] " + shape.getMasterShape() + " " + shape.getTextAsString().trim()); } });
@Override protected Path2D drawPath(XDGFShape shape) { Path2D path = super.drawPath(shape); if (_debugAcceptor == null || _debugAcceptor.accept(shape)) { // show numbers to associate shapes with ids.. doesn't always work Font f = _graphics.getFont(); _graphics.scale(1, -1); _graphics.setFont(f.deriveFont(0.05F)); String shapeId = "" + shape.getID(); float shapeOffset = -0.1F; if (shape.hasMasterShape()) { shapeId += " MS:" + shape.getMasterShape().getID(); shapeOffset -= 0.15F; } _graphics.drawString(shapeId, shapeOffset, 0); _graphics.setFont(f); _graphics.scale(1, -1); } return path; }
@Override public boolean accept(XDGFShape shape) { if (shape.isDeleted()) return false; // text is interesting if (shape.hasText() && shape.getTextAsString().length() != 0) return true; // 1d shapes are interesting, they create connections if (shape.isShape1D()) return true; // User specified shapes are interesting if (!shape.hasMaster() && !shape.hasMasterShape()) return true; if (shape.hasMaster() && !shape.hasMasterShape()) return true; // include stencil content, but try to elide stencil interiors // if (shape.getXmlObject().isSetMaster()) // return true; if (shape.hasMasterShape() && shape.getMasterShape().isTopmost()) return true; return false; }
@Override public void visit(XDGFShape shape, AffineTransform globalTransform, int level) { for (int i = 0; i < level; i++) { os.append(" "); } // TODO: write text? os.println(shape + " [" + shape.getShapeType() + ", " + shape.getSymbolName() + "] " + shape.getMasterShape() + " " + shape.getTextAsString().trim()); } });
@Override protected Path2D drawPath(XDGFShape shape) { Path2D path = super.drawPath(shape); if (_debugAcceptor == null || _debugAcceptor.accept(shape)) { // show numbers to associate shapes with ids.. doesn't always work Font f = _graphics.getFont(); _graphics.scale(1, -1); _graphics.setFont(f.deriveFont(0.05F)); String shapeId = "" + shape.getID(); float shapeOffset = -0.1F; if (shape.hasMasterShape()) { shapeId += " MS:" + shape.getMasterShape().getID(); shapeOffset -= 0.15F; } _graphics.drawString(shapeId, shapeOffset, 0); _graphics.setFont(f); _graphics.scale(1, -1); } return path; }
@Override public boolean accept(XDGFShape shape) { if (shape.isDeleted()) return false; // text is interesting if (shape.hasText() && shape.getTextAsString().length() != 0) return true; // 1d shapes are interesting, they create connections if (shape.isShape1D()) return true; // User specified shapes are interesting if (!shape.hasMaster() && !shape.hasMasterShape()) return true; if (shape.hasMaster() && !shape.hasMasterShape()) return true; // include stencil content, but try to elide stencil interiors // if (shape.getXmlObject().isSetMaster()) // return true; if (shape.hasMasterShape() && shape.getMasterShape().isTopmost()) return true; return false; }