Beispiel #1
0
  /**
   * Returns a clone of this state where all members are deeply cloned except the view and cell
   * references, which are copied with no cloning to the new instance.
   */
  public Object clone() {
    mxCellState clone = new mxCellState(view, cell, style);

    if (absolutePoints != null) {
      clone.absolutePoints = new ArrayList<mxPoint>();

      for (int i = 0; i < absolutePoints.size(); i++) {
        clone.absolutePoints.add((mxPoint) absolutePoints.get(i).clone());
      }
    }

    if (origin != null) {
      clone.origin = (mxPoint) origin.clone();
    }

    if (absoluteOffset != null) {
      clone.absoluteOffset = (mxPoint) absoluteOffset.clone();
    }

    if (boundingBox != null) {
      clone.boundingBox = (mxRectangle) boundingBox.clone();
    }

    clone.terminalDistance = terminalDistance;
    clone.segments = segments;
    clone.length = length;
    clone.x = x;
    clone.y = y;
    clone.width = width;
    clone.height = height;

    return clone;
  }