Search in sources :

Example 1 with TextNoteVO

use of com.centurylink.mdw.model.value.activity.TextNoteVO in project mdw-designer by CenturyLinkCloud.

the class Graph method reinit.

/**
 * Invoked loading an existing process definition or process instance
 * Invoked after saving the process
 * Also invoked by constructor above.
 */
public void reinit(ProcessVO processVO) {
    this.processVO = processVO;
    this.geo_attribute = WorkAttributeConstant.WORK_DISPLAY_INFO;
    nodes = new Vector<Node>();
    links = new Vector<Link>();
    subgraphs = new ArrayList<SubGraph>();
    notes = null;
    dirtyLevel = CLEAN;
    originalName = processVO.getProcessName();
    zoom = 100;
    largestActivityLogicalId = -1;
    largestTransitionLogicalId = -1;
    Node node, node2;
    Link link;
    ActivityVO nodet;
    WorkTransitionVO conn;
    parseCoord(geo_attribute);
    arrowstyle = getAttribute(Link.ATTRIBUTE_ARROW_STYLE);
    if (arrowstyle == null)
        arrowstyle = Link.ARROW_STYLE_END;
    nodestyle = getAttribute(Node.ATTRIBUTE_NODE_STYLE);
    if (nodestyle == null)
        nodestyle = Node.NODE_STYLE_ICON;
    int i, n;
    List<ActivityVO> nodes0 = processVO.getActivities();
    n = nodes0 == null ? 0 : nodes0.size();
    for (i = 0; i < n; i++) {
        nodet = processVO.getActivities().get(i);
        node = new Node(nodet, this, metainfo);
        nodes.add(node);
    }
    List<WorkTransitionVO> connectors = processVO.getTransitions();
    n = connectors == null ? 0 : connectors.size();
    for (i = 0; i < n; i++) {
        conn = processVO.getTransitions().get(i);
        node = findNode(conn.getFromWorkId());
        node2 = findNode(conn.getToWorkId());
        if (node != null && node2 != null) {
            link = new Link(node, node2, conn, arrowstyle);
            links.add(link);
        }
    }
    List<ProcessVO> subprocs = processVO.getSubProcesses();
    if (subprocs != null) {
        for (ProcessVO subproc : subprocs) {
            SubGraph subgraph = new SubGraph(subproc, this, metainfo, getIconFactory());
            subgraphs.add(subgraph);
        }
    }
    if (processVO.getTextNotes() != null) {
        for (TextNoteVO note : processVO.getTextNotes()) {
            if (notes == null)
                notes = new ArrayList<TextNote>();
            notes.add(new TextNote(note, this));
        }
    }
}
Also used : WorkTransitionVO(com.centurylink.mdw.model.value.work.WorkTransitionVO) ActivityVO(com.centurylink.mdw.model.value.activity.ActivityVO) MbengNode(com.qwest.mbeng.MbengNode) ArrayList(java.util.ArrayList) ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) TextNoteVO(com.centurylink.mdw.model.value.activity.TextNoteVO)

Example 2 with TextNoteVO

use of com.centurylink.mdw.model.value.activity.TextNoteVO in project mdw-designer by CenturyLinkCloud.

the class Graph method addTextNote.

public TextNote addTextNote(int x, int y, String content) {
    TextNoteVO vo = new TextNoteVO();
    List<TextNoteVO> textNotes = getProcessVO().getTextNotes();
    if (textNotes == null) {
        textNotes = new ArrayList<TextNoteVO>();
        getProcessVO().setTextNotes(textNotes);
    }
    textNotes.add(vo);
    String logicalId = generateLogicalId("N");
    vo.setContent(content);
    vo.setLogicalId(logicalId);
    TextNote textNote = new TextNote(vo, this, x, y, 200, 60);
    if (notes == null)
        notes = new ArrayList<TextNote>();
    notes.add(textNote);
    setDirtyLevel(DIRTY);
    return textNote;
}
Also used : ArrayList(java.util.ArrayList) TextNoteVO(com.centurylink.mdw.model.value.activity.TextNoteVO)

Aggregations

TextNoteVO (com.centurylink.mdw.model.value.activity.TextNoteVO)2 ArrayList (java.util.ArrayList)2 ActivityVO (com.centurylink.mdw.model.value.activity.ActivityVO)1 ProcessVO (com.centurylink.mdw.model.value.process.ProcessVO)1 WorkTransitionVO (com.centurylink.mdw.model.value.work.WorkTransitionVO)1 MbengNode (com.qwest.mbeng.MbengNode)1