예제 #1
0
  public void drawWhiteEdge(Edge e) {
    // Graphics
    GraphicsContext gc = kochPanel.getGraphicsContext2D();

    // Adjust edge for zoom and drag
    Edge e1 = edgeAfterZoomAndDrag(e);

    // Set line color
    gc.setStroke(Color.WHITE);

    // Set line width depending on level
    if (currentLevel <= 3) {
      gc.setLineWidth(2.0);
    } else if (currentLevel <= 5) {
      gc.setLineWidth(1.5);
    } else {
      gc.setLineWidth(1.0);
    }

    // Draw line
    gc.strokeLine(e1.X1, e1.Y1, e1.X2, e1.Y2);
  }
예제 #2
0
 public void clearKochPanel() {
   GraphicsContext gc = kochPanel.getGraphicsContext2D();
   gc.clearRect(0.0, 0.0, kpWidth, kpHeight);
   gc.setFill(Color.BLACK);
   gc.fillRect(0.0, 0.0, kpWidth, kpHeight);
 }