View Javadoc

1   package org.catacomb.dataview.display;
2   
3   import java.awt.Color;
4   
5   import org.catacomb.datalish.Box;
6   import org.catacomb.graph.gui.Painter;
7   
8   public class PolyLine extends Displayable {
9   
10  
11      double[] xpts;
12      double[] ypts;
13  
14  
15      double width;
16  
17  
18      public PolyLine(String lab, Color col, double[] xa, double[] ya, double w) {
19          super(lab, col);
20  
21          xpts = xa;
22          ypts = ya;
23          width = w;
24      }
25  
26  
27  
28      public void pushBox(Box b) {
29          b.extendTo(xpts, ypts);
30      }
31  
32  
33  
34  
35      public void instruct(Painter p) {
36          if (width < 0.1) {
37              width = 1.;
38          }
39          p.drawPolyline(xpts, ypts, xpts.length, color, width, true);
40  
41      }
42  
43  }