Exemple #1
0
 public void appendShape(GeneralPath gp, DrawAreaInterface da, UserFunction own)
     throws MathException {
   AffPoint s, e;
   s = (AffPoint) ((UserFunction) startPoint).eval();
   e = (AffPoint) ((UserFunction) endPoint).eval();
   gp.append(
       new Line2D.Double(
           da.xCoordToPix(s.evalX()),
           da.yCoordToPix(s.evalY()),
           da.xCoordToPix(e.evalX()),
           da.yCoordToPix(e.evalY())),
       true);
 }
  public void paintGraph(Graphics gr, DrawAreaInterface da) {
    if (!isVisible()) return;
    Color ca = gr.getColor();
    Graphics2D g = (Graphics2D) gr;
    Stroke strokeOld = g.getStroke();
    g.setColor(getColor());
    g.setStroke(AbstractGraph.getStroke(da.getStroke(), getLineStyle()));

    evalFunction();
    paint(g, da);

    g.setColor(ca);
    g.setStroke(strokeOld);
  } // paintGraph