Exemplo n.º 1
0
  @Override
  public void resetToDefaultElements() {
    removeAllElements();

    ComposableElementController.addElement(
        new ArrowheadElement(
            Calico.uuid(),
            uuid,
            CConnector.TYPE_HEAD,
            CalicoOptions.arrow.stroke_size,
            Color.black,
            Color.red,
            ArrowheadElement.getDefaultArrow()));
    ComposableElementController.addElement(
        new ArrowheadElement(
            Calico.uuid(),
            uuid,
            CConnector.TYPE_TAIL,
            CalicoOptions.arrow.stroke_size,
            Color.black,
            Color.black,
            ArrowheadElement.getDefaultCircle()));
    ComposableElementController.addElement(
        new HighlightElement(
            Calico.uuid(),
            uuid,
            CalicoOptions.stroke.background_transparency,
            new BasicStroke(CalicoOptions.pen.stroke_size + 8),
            Color.blue));

    redraw();
  }
Exemplo n.º 2
0
  @Override
  public void removeAllElements() {
    if (!ComposableElementController.elementList.containsKey(uuid)) return;

    for (Map.Entry<Long, ComposableElement> entry :
        ComposableElementController.elementList.get(uuid).entrySet()) {
      ComposableElementController.removeElement(entry.getValue().getElementUUID(), uuid);
    }
  }
Exemplo n.º 3
0
  public void delete() {
    // Remove all elements
    ComposableElementController.no_notify_removeAllElements(this.uuid);

    // remove from canvas
    CCanvasController.no_notify_delete_child_connector(this.canvasUID, this.uuid);

    // Remove from groups
    CGroupController.no_notify_delete_child_connector(this.getAnchorUUID(TYPE_HEAD), uuid);
    CGroupController.no_notify_delete_child_connector(this.getAnchorUUID(TYPE_TAIL), uuid);

    if (CCanvasController.canvas_has_child_connector_node(this.canvasUID, uuid)) {
      // This line is not thread safe so must invokeLater to prevent eraser artifacts.
      /*SwingUtilities.invokeLater(
      		new Runnable() { public void run() { removeFromParent(); } }
      );*/
      CalicoDraw.removeNodeFromParent(this);
      // removeFromParent();
    }
  }