예제 #1
0
 public void updateEdgeWidthTo(double value) {
   PPath ppath = getEdgePPath();
   if (ppath != null) {
     if (isSelfLoop) {
       //        ppath.setBounds(getSelfLoopBoundsFor(value));
       ppath.setPathTo(createSelfLoopShape());
       ppath.setStroke(null);
     } else {
       double strokeWidth = normalizeForWidthScale(value);
       Stroke stroke = createStrokeFor(strokeWidth);
       ppath.setStroke(stroke);
     }
   }
   updateVisibilityFor(value);
 }
예제 #2
0
  protected void calcConnectorLine() {
    Polygon linePoints = getRawPolygon();

    connectorLine = new PPath();
    connectorLine.setStroke(stroke);
    connectorLine.setStrokePaint(this.color);

    applyAffineTransform(linePoints);
  }
예제 #3
0
  ///////////////////////////////////////////////////////////////////////////
  /// Marquee
  protected void initializeMarquee(PInputEvent e) {
    marquee = PPath.createRectangle((float) presspt.getX(), (float) presspt.getY(), 0, 0);
    marquee.setPaint(marqueePaint);
    marquee.setTransparency(marqueePaintTransparency);
    marquee.setStrokePaint(marqueeStrokePaint);
    marquee.setStroke(strokes[0]);

    marqueeParent.getPiccolo().addChild(marquee);

    marqueeObjects.clear();
  }
예제 #4
0
  /** This gets called continuously during the drag, and is used to animate the marquee */
  protected void dragActivityStep(PInputEvent aEvent) {
    if (marquee != null) {
      float origStrokeNum = strokeNum;

      // Increment by partial steps to slow down animation
      strokeNum = (strokeNum + 0.5f) % NUM_STROKES;
      if ((int) strokeNum != (int) origStrokeNum) {
        marquee.setStroke(strokes[(int) strokeNum]);
      }
    }
  }
    public VisualFlowMapLayer(VisualFlowMap visualFlowMap, PCamera camera) {
      this.visualFlowMap = visualFlowMap;
      this.camera = camera;
      this.camera.addLayer(this);
      //      this.camera.addChild(visualFlowMap.getTooltipBox());

      // border
      pp = new PPath(new PBounds(0, 0, 1, 1));
      pp.setStroke(new PFixedWidthStroke(2));
      pp.setStrokePaint(Color.gray);
      camera.addChild(pp);

      visualFlowMap.setFlowWeightAttrLabelVisibile(true);

      addChild(visualFlowMap);
    }