Search in sources :

Example 1 with ITextureBlock

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

the class EtcDefineDVO method toSummarize.

public List<Summarize> toSummarize(boolean autoNumbering) {
    final List<Summarize> arrayList = new ArrayList<Summarize>();
    // [START] #### ⓝ 4. 기타 정의 사항 ####
    arrayList.add(new Summarize(true, TYPE.TITLE, true, TYPE.TITLE.getText()));
    arrayList.add(new Summarize(true, TYPE.MESSAGE, true, TYPE.MESSAGE.getText()));
    doNotEmptyTextureScope(messageList, new ITextureBlock() {

        @Override
        public void doScope(String text) {
            arrayList.add(new Summarize(TYPE.MESSAGE, false, text));
        }

        @Override
        public void emptyThen() {
            arrayList.add(new Summarize(TYPE.MESSAGE, false, "N/A"));
        }
    }, autoNumbering);
    arrayList.add(new Summarize(true, TYPE.CODE_MASTER, true, TYPE.CODE_MASTER.getText()));
    doNotEmptyTextureScope(codeMasterList, new ITextureBlock() {

        @Override
        public void doScope(String text) {
            arrayList.add(new Summarize(TYPE.CODE_MASTER, false, text));
        }

        @Override
        public void emptyThen() {
            arrayList.add(new Summarize(TYPE.CODE_MASTER, false, "N/A"));
        }
    }, autoNumbering);
    arrayList.add(new Summarize(true, TYPE.CHK_AUTH, true, TYPE.CHK_AUTH.getText()));
    doNotEmptyTextureScope(chkAuthList, new ITextureBlock() {

        @Override
        public void doScope(String text) {
            arrayList.add(new Summarize(TYPE.CHK_AUTH, false, text));
        }

        @Override
        public void emptyThen() {
            arrayList.add(new Summarize(TYPE.CHK_AUTH, false, "N/A"));
        }
    }, autoNumbering);
    arrayList.add(new Summarize(true, TYPE.RELATIVE_FACTORY, true, TYPE.RELATIVE_FACTORY.getText()));
    doNotEmptyTextureScope(relativeFactoryList, new ITextureBlock() {

        @Override
        public void doScope(String text) {
            arrayList.add(new Summarize(TYPE.RELATIVE_FACTORY, false, text));
        }

        @Override
        public void emptyThen() {
            arrayList.add(new Summarize(TYPE.RELATIVE_FACTORY, false, "N/A"));
        }
    }, autoNumbering);
    arrayList.add(new Summarize(true, TYPE.EFFECT_MODULE, true, TYPE.EFFECT_MODULE.getText()));
    doNotEmptyTextureScope(effectModuleList, new ITextureBlock() {

        @Override
        public void doScope(String text) {
            arrayList.add(new Summarize(TYPE.EFFECT_MODULE, false, text));
        }

        @Override
        public void emptyThen() {
            arrayList.add(new Summarize(TYPE.EFFECT_MODULE, false, "N/A"));
        }
    }, autoNumbering);
    arrayList.add(new Summarize(true, TYPE.CAUTION_TEST, true, TYPE.CAUTION_TEST.getText()));
    doNotEmptyTextureScope(cautionTestList, new ITextureBlock() {

        @Override
        public void doScope(String text) {
            arrayList.add(new Summarize(TYPE.CAUTION_TEST, false, text));
        }

        @Override
        public void emptyThen() {
            arrayList.add(new Summarize(TYPE.CAUTION_TEST, false, "N/A"));
        }
    }, autoNumbering);
    arrayList.add(new Summarize(true, TYPE.CAUTION_DEPLOY, true, TYPE.CAUTION_DEPLOY.getText()));
    doNotEmptyTextureScope(cautionDeployList, new ITextureBlock() {

        @Override
        public void doScope(String text) {
            arrayList.add(new Summarize(TYPE.CAUTION_DEPLOY, false, text));
        }

        @Override
        public void emptyThen() {
            arrayList.add(new Summarize(TYPE.CAUTION_DEPLOY, false, "N/A"));
        }
    }, autoNumbering);
    arrayList.add(new Summarize(true, TYPE.ETC, true, TYPE.ETC.getText()));
    doNotEmptyTextureScope(etcList, new ITextureBlock() {

        @Override
        public void doScope(String text) {
            arrayList.add(new Summarize(TYPE.ETC, false, text));
        }

        @Override
        public void emptyThen() {
            arrayList.add(new Summarize(TYPE.ETC, false, "N/A"));
        }
    }, autoNumbering);
    return arrayList;
}
Also used : ITextureBlock(com.kyj.fx.voeditor.visual.words.spec.auto.msword.interfaces.ITextureBlock) ArrayList(java.util.ArrayList)

Example 2 with ITextureBlock

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

the class ProgramSpecWordTemplate method headerPage3.

/**
	 * 
	 * 전반적인 메소드에 대한 정보를 기록. 본문 요약 정보
	 * 
	 * @param msWord
	 * @param svo
	 * @throws ParseException
	 */
public void headerPage3(ProgramSpecSVO svo) {
    // [START] #### 선언부 테이블에 전체적인 내용 기술 ####
    List<List<String>> list = new ArrayList<List<String>>();
    // 0 row
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("프로그램 사양서");
        list.add(arr);
    }
    // 1 row
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("a.시스템 명");
        arr.add(" - ");
        arr.add("b.시스템");
        arr.add(" - ");
        arr.add("c.서브시스템");
        arr.add(getSubSystemName(svo.getUserSourceMetaDVO().getProjectName(), svo.getUserSourceMetaDVO().getPackages()));
        list.add(arr);
    }
    // 2 row
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("d.프로그램ID");
        arr.add(svo.getUserSourceMetaDVO().getSimpleFileName());
        arr.add("e.작성자");
        arr.add(svo.getUserSourceMetaDVO().getUserPcName());
        arr.add("f.작성일");
        arr.add(DateUtil.getCurrentDateString("yyyy-MM-dd"));
        list.add(arr);
    }
    // 3 row
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("g.프로그램명");
        // 프로그램명정의
        String programName = svo.getUserSourceMetaDVO().getProgramName();
        arr.add(programName == null ? "" : programName);
        list.add(arr);
    }
    // 4 row
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("h.개발 유형");
        arr.add(svo.getFile().getFileType().toString());
        arr.add("i.프로그램 유형");
        arr.add(" - ");
        list.add(arr);
    }
    // 5 row
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("j. 프로그램 개요");
        arr.add(" - ");
        list.add(arr);
    }
    XWPFTable table = addToTable(list);
    mergeCellHorizon(table, 0, 0, 6);
    mergeCellHorizon(table, 3, 1, 6);
    mergeCellHorizon(table, 4, 1, 2);
    mergeCellHorizon(table, 4, 3, 6);
    mergeCellHorizon(table, 5, 1, 6);
    // [END] #### 선언부 테이블에 전체적인 내용 기술 ####
    // 공백
    addBreak();
    addText("■. 화면/Report/비즈니스 로직 설계", MSWord.H4, true, false, false);
    addBreak();
    addText("■ Object  리스트", true, false, false);
    List<List<String>> objList = new ArrayList<List<String>>();
    // 0 row 테이블 헤더.
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("순번 ");
        arr.add("Object ID ");
        arr.add("주요 기능 ");
        arr.add("신규/변경 ");
        objList.add(arr);
    }
    // [START] #### 데이터부 ####
    List<MethodDVO> methodDVOList = svo.getMethodDVOList();
    for (int i = 0; i < methodDVOList.size(); i++) {
        MethodDVO methodDVO = methodDVOList.get(i);
        if (methodDVO == null || methodDVO.getMethodName() == null) {
            continue;
        }
        ArrayList<String> arr = new ArrayList<String>();
        // seq
        arr.add(String.valueOf((i + 1)));
        // 메소드명
        arr.add(methodDVO.getMethodName());
        // 주요기능-- Main펑션이 빈경우 Description으로 설정됨.
        arr.add(ValueUtil.isEmpty(methodDVO.getMainFunction()) ? methodDVO.getDescription() : methodDVO.getMainFunction());
        // 신규 or 변경
        arr.add(methodDVO.getIsNewOrChg());
        objList.add(arr);
    }
    // [END] #### 데이터부 ####
    addToTable(objList);
    addBreak();
    // [START] #### Object 선언부(패키지) ####
    addText("■ Object  선언", true, false, false);
    ImportsDVO importsDVO = svo.getImportsDVO();
    if (importsDVO != null) {
        List<String> imports = importsDVO.getImports();
        doNotEmptyTextureScope(imports, new ITextureBlock() {

            @Override
            public void doScope(String text) {
                addText(text);
            }

            @Override
            public void emptyThen() {
                addText("N/A");
            }
        });
    } else {
        addText("디폴트 (N/A)");
    }
    // [END] #### Object 선언부(패키지) ####
    addBreak();
    // [START] #### ObjectID (Object 리스트에 기술된 Object ID와 일치하게 기술함) ####
    addText("■ Object ID (Object 리스트에 기술된 Object ID와 일치하게 기술함) ", true, false, false);
    for (int i = 0; i < methodDVOList.size(); i++) {
        MethodDVO methodDVO = methodDVOList.get(i);
        if (methodDVO == null || methodDVO.getMethodName() == null) {
            continue;
        }
        String visivility = methodDVO.getVisivility();
        String methodName = methodDVO.getMethodName();
        String returnType = methodDVO.getReturnType();
        String parameters = methodDVO.getParameters();
        addText(new StringBuffer().append((i + 1)).append(". ").append(visivility).append(" ").append(returnType).append(" ").append(methodName).append(" ").append(parameters).toString());
    }
    // [END] #### (Object 리스트에 기술된 Object ID와 일치하게 기술함) ####
    addBreak();
    // [START] #### Table 리스트(프로그램에서 사용되는 Table을 모두 기술) ####
    addText("  ○ Table 리스트(프로그램에서 사용되는 Table을 모두 기술)", true, false, false);
    List<List<String>> tableList = new ArrayList<List<String>>();
    // 0 row 헤더부분 기술
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("Table ID");
        arr.add("Table 명");
        arr.add("CRUD");
        tableList.add(arr);
    }
    List<TableDVO> tableDVOList = svo.getTableDVOList();
    int DEFAULT_ROW = 4;
    // /
    if (tableDVOList != null) {
        for (TableDVO dvo : tableDVOList) {
            ArrayList<String> arr = new ArrayList<String>();
            arr.add(dvo.getTableId());
            arr.add(dvo.getTableName());
            arr.add(dvo.getCrud());
            tableList.add(arr);
        }
    }
    // 여유 공간이 남는다면 빈공간을 추가한다.
    int loopCnt = DEFAULT_ROW;
    if (tableDVOList != null) {
        loopCnt = DEFAULT_ROW - tableDVOList.size();
    }
    for (int i = 0; i < loopCnt; i++) {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add(" ");
        arr.add(" ");
        arr.add(" ");
        tableList.add(arr);
    }
    // /
    addToTable(tableList);
// [END] #### Table 리스트(프로그램에서 사용되는 Table을 모두 기술) ####
}
Also used : ImportsDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO) XWPFTable(org.apache.poi.xwpf.usermodel.XWPFTable) ArrayList(java.util.ArrayList) ITextureBlock(com.kyj.fx.voeditor.visual.words.spec.auto.msword.interfaces.ITextureBlock) TableDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.TableDVO) ArrayList(java.util.ArrayList) List(java.util.List) MethodDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO)

Aggregations

ITextureBlock (com.kyj.fx.voeditor.visual.words.spec.auto.msword.interfaces.ITextureBlock)2 ArrayList (java.util.ArrayList)2 ImportsDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO)1 MethodDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO)1 TableDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.TableDVO)1 List (java.util.List)1 XWPFTable (org.apache.poi.xwpf.usermodel.XWPFTable)1