Exemple #1
0
 /** Build a shape for the entire subtree by joining together the shapes for each of its edges. */
 public Shape constructFullTextShape(DiagramBase diagram) {
   GeneralPath shape = new GeneralPath();
   Enumeration edges = m_edgeList.elements();
   while (edges.hasMoreElements()) {
     TreeEdge edge = (TreeEdge) edges.nextElement();
     if (!edge.visible) {
       continue;
     }
     Shape edgeShape = edge.getSchemeShape(diagram);
     PathIterator path = edgeShape.getPathIterator(null);
     shape.append(path, false);
     TreeVertex vertex = edge.getSourceVertex();
     if (!vertex.isVirtual()) {
       shape.append(vertex.getShape(diagram).getPathIterator(null), false);
     }
     vertex = edge.getDestVertex();
     if (!vertex.isVirtual()) {
       shape.append(vertex.getShape(diagram).getPathIterator(null), false);
     }
   }
   BasicStroke stroke = new BasicStroke(20, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER);
   shapeTable.put(diagram, stroke.createStrokedShape(shape));
   return (Shape) shapeTable.get(diagram);
 }