Search in sources :

Example 6 with MethodParameterDVO

use of com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodParameterDVO in project Gargoyle by callakrsos.

the class ProgramSpecWordTemplate method methodDetail.

public void methodDetail(int seq, MethodDVO dvo) {
    int DEFAULT_ROW = 4;
    addText(seq + ". ".concat(dvo.getMethodName()), true, false, false);
    // 전체 메소드에 대한 요약 정보 기술.
    List<List<String>> methodList = new ArrayList<List<String>>();
    // 0 row 메소드명 기술
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("Method 명 ");
        arr.add(dvo.getMethodName());
        methodList.add(arr);
    }
    // 1 row 메소드 유형 기술
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("Method 유형 ");
        arr.add(dvo.getLevel());
        methodList.add(arr);
    }
    // 2 row 부턴 메소드 파라미터 기술.
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("Parameters");
        arr.add("Parameter");
        arr.add("유형(M/O)");
        arr.add("Type");
        arr.add("Description");
        methodList.add(arr);
    }
    List<MethodParameterDVO> mList = dvo.getMethodParameterDVOList();
    if (mList != null) {
        for (MethodParameterDVO m : mList) {
            ArrayList<String> arr = new ArrayList<String>();
            arr.add("");
            arr.add(m.getParameter());
            arr.add(m.getParameterType());
            arr.add(m.getType());
            arr.add(m.getDescription());
            methodList.add(arr);
        }
    }
    // 여유 공간이 남는다면 빈공간을 추가한다.
    int loopCnt = DEFAULT_ROW;
    int mListSize = mList == null ? 0 : mList.size();
    if (mList != null) {
        loopCnt = DEFAULT_ROW - mListSize;
    }
    for (int i = 0; i < loopCnt; i++) {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("");
        arr.add("");
        arr.add("");
        arr.add("");
        arr.add("");
        methodList.add(arr);
    }
    XWPFTable table = addToTable(methodList);
    mergeCellHorizon(table, 0, 1, 4);
    mergeCellHorizon(table, 1, 1, 4);
    mergeCellsVertically(table, 0, 2, ((loopCnt < 0) ? (mListSize + 2) : (mListSize + loopCnt + 2)));
    if (dvo.getFlow() != null) {
        String[] split = dvo.getFlow().split("\n");
        for (String c : split) {
            // " "를 넣어주면 /t 기능이 msword상에서 적용됨.
            addText(" " + c);
        }
    }
    addBreak();
}
Also used : MethodParameterDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodParameterDVO) XWPFTable(org.apache.poi.xwpf.usermodel.XWPFTable) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

MethodParameterDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodParameterDVO)6 ArrayList (java.util.ArrayList)3 ProgramSpecSourceException (com.kyj.fx.voeditor.visual.exceptions.ProgramSpecSourceException)2 MethodDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO)2 List (java.util.List)1 XWPFTable (org.apache.poi.xwpf.usermodel.XWPFTable)1