Exemplo n.º 1
0
  private void drawMeshPart(Graphics g, MeshPart m) {
    if (m.size() > 0) {
      MeshSection s = (MeshSection) m.elementAt(1);
      //			c=0;

      while (s.next != null) {
        //				g.setColor(clr[c]);
        if (s.size() >= s.next.size()) {
          for (int i = 0; i < s.size(); i++) {
            drawLine(g, s.here(i), s.up(i));
            drawLine(g, s.here(i), s.right(i));
          }
          s = s.next;
          //					c=1-c;
        } else {
          s = s.next;
          //					c=1-c;
          for (int i = 0; i < s.size(); i++) {
            drawLine(g, s.here(i), s.down(i));
            drawLine(g, s.here(i), s.right(i));
          }
        }
      }
    }
  }
Exemplo n.º 2
0
 private void drawMesh(Graphics g) {
   try {
     for (Enumeration parts = previewTree.getMesh().elements(); parts.hasMoreElements(); ) {
       MeshPart m = (MeshPart) parts.nextElement();
       if (m.getLevel() == previewTree.getShowLevel()) {
         g.setColor(thisLevelColor);
       } else {
         g.setColor(otherLevelColor);
       }
       drawMeshPart(g, m);
     }
   } catch (Exception e) {
     // System.err.println("nummer "+i);
     e.printStackTrace();
   }
 }