Example #1
0
  public void prepareForSave() {
    useCase_elements = UMLLauncher.instance.useCaseDisplay.elements;
    classDiagram_elements = UMLLauncher.instance.classDiagramDisplay.elements;
    // Use case
    ArrayList<EditorElement> elements = useCase_elements;
    EditorElement.Data[] datas = new EditorElement.Data[elements.size()];
    int index = 0;

    for (EditorElement e : elements) {
      e.prepareData();
      datas[index++] = e.data;
    }
    useCase_elementData.clear();
    for (EditorElement.Data data : datas) {
      useCase_elementData.add(data);
    }
    // Class diagram
    elements = classDiagram_elements;
    datas = new EditorElement.Data[elements.size()];
    index = 0;
    for (EditorElement e : elements) {
      e.prepareData();
      datas[index++] = e.data;
    }
    classDiagram_elementData.clear();
    for (EditorElement.Data data : datas) {
      classDiagram_elementData.add(data);
    }
  }