Search in sources :

Example 1 with MethodDVO

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

the class ProjectInfoBaseInfoTab method supplyNode.

@Override
public BorderPane supplyNode() throws Exception {
    BorderPane root = new BorderPane();
    try {
        /* BaseInfo */
        baseInfoController = new BaseInfoComposite(this);
        //			FXMLLoader loader = new FXMLLoader();
        //			loader.setLocation(BaseInfoComposite.class.getResource("BaseInfoApp.fxml"));
        //			BorderPane supplyNode = loader.load();
        //			supplyNode.setPrefWidth(BorderPane.USE_COMPUTED_SIZE);
        //			BaseInfoComposite baseInfoController = loader.getController();
        /* 버튼박스 */
        HBox hboxButton = new HBox(5);
        hboxButton.setPrefHeight(HBox.USE_COMPUTED_SIZE);
        HBox.setHgrow(hboxButton, Priority.NEVER);
        btnGenerate = new Button("사양서 생성");
        btnGenerate.setOnMouseClicked(this::btnGenerateOnMouseClick);
        btnGenerate.setPrefWidth(120);
        hboxButton.getChildren().add(btnGenerate);
        /* TableInfo */
        gv = new CrudBaseGridView<MethodDVO>(MethodDVO.class, new AnnotateBizOptions<MethodDVO>(MethodDVO.class) {

            @Override
            public boolean isCreateColumn(String columnName) {
                if ("methodMetaDVO".equals(columnName))
                    return false;
                //						return false;
                return super.isCreateColumn(columnName);
            }

            @Override
            public boolean visible(String columnName) {
                if ("methodMetaDVO".equals(columnName))
                    return false;
                return super.visible(columnName);
            }
        });
        //이벤트 리스너로 그리드에 추가되는 항목이 존재하면 추가.
        ObservableList<MethodDVO> methodData = baseInfoController.getMethodData();
        methodData.addListener(new ListChangeListener<MethodDVO>() {

            @Override
            public void onChanged(javafx.collections.ListChangeListener.Change<? extends MethodDVO> c) {
                if (c.next()) {
                    if (c.wasAdded()) {
                        gv.getItems().addAll(c.getAddedSubList());
                    } else if (c.wasRemoved()) {
                        gv.getItems().removeAll(c.getRemoved());
                    }
                }
            }
        });
        //			ObservableList<MethodDVO> items = gv.getItems();
        //			gv.getItems().addAll(methodData);
        baseInfoController.setBottom(hboxButton);
        root.setTop(baseInfoController);
        root.setCenter(gv);
        baseInfoController.start();
    } catch (IOException | NullPointerException e) {
        LOGGER.error(ValueUtil.toString(e));
    }
    root.setPrefSize(BorderPane.USE_COMPUTED_SIZE, BorderPane.USE_COMPUTED_SIZE);
    root.setPadding(new Insets(5, 5, 5, 5));
    return root;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) BaseInfoComposite(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.skin.BaseInfoComposite) IOException(java.io.IOException) ListChangeListener(javafx.collections.ListChangeListener) AnnotateBizOptions(com.kyj.fx.voeditor.visual.component.grid.AnnotateBizOptions) Button(javafx.scene.control.Button) MethodDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO)

Example 2 with MethodDVO

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

the class ProgramSpecUtil method doJavaFile.

public static ProgramSpecSVO doJavaFile(String projectName, String fileName, AbstractJavaProgramSpecFile newInstance) {
    ProgramSpecSVO svo = new ProgramSpecSVO();
    String packageNames = newInstance.getPackage();
    newInstance.setPackage(packageNames);
    newInstance.setProjectName(projectName);
    svo.setFile(newInstance);
    // svo.getUserSourceMetaDVO().setProjectName(projectName);
    // svo.getUserSourceMetaDVO().setPackages(packageNames);
    String userName = System.getProperty("user.name");
    List<SourceAnalysisDVO> listStatement = newInstance.listStatement();
    UserSourceMetaDVO userSourceMetaDVO = new UserSourceMetaDVO();
    userSourceMetaDVO.setProjectName(projectName);
    userSourceMetaDVO.setSimpleFileName(fileName);
    userSourceMetaDVO.setRealFilePath(newInstance.getFullFileName());
    userSourceMetaDVO.setUserPcName(userName);
    userSourceMetaDVO.setPackages(packageNames);
    svo.setUserSourceMetaDVO(userSourceMetaDVO);
    /* 시작 import문 처리 */
    List<String> imports = newInstance.getImports();
    ImportsDVO importsDVO = new ImportsDVO();
    importsDVO.setImports(imports);
    svo.setImportsDVO(importsDVO);
    /* 끝 import문 처리 */
    // 테이블 데이터 바인드
    List<MethodDVO> methodDVOList = new ArrayList<MethodDVO>();
    for (SourceAnalysisDVO dvo : listStatement) {
        try {
            // 소스내에 존재하는 메소드명.. 접근지 정자 + static + void 등의 잡다한 정보가 담겨있다.
            String methodName = dvo.getMethodName();
            String methodDescription = newInstance.getMethodDescription(methodName);
            MethodDVO methodDVO = null;
            methodDVO = AbstractJavaProgramSpecFile.toMethodDVO(methodName);
            methodDVO.setDescription(methodDescription);
            methodDVOList.add(methodDVO);
        } catch (ProgramSpecSourceException e) {
            e.printStackTrace();
        }
    }
    svo.setMethodDVOList(methodDVOList);
    return svo;
}
Also used : ImportsDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO) UserSourceMetaDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.UserSourceMetaDVO) ArrayList(java.util.ArrayList) ProgramSpecSVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ProgramSpecSVO) ProgramSpecSourceException(com.kyj.fx.voeditor.visual.exceptions.ProgramSpecSourceException) MethodDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO) SourceAnalysisDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.SourceAnalysisDVO)

Example 3 with MethodDVO

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

the class ProgramSpecUtil method doJsFile.

public static ProgramSpecSVO doJsFile(String projectName, String fileName, AbstractXframeProgramSpecFile newInstance) {
    ProgramSpecSVO svo = new ProgramSpecSVO();
    newInstance.setProjectName(projectName);
    svo.setFile(newInstance);
    String userName = System.getProperty("user.name");
    List<SourceAnalysisDVO> listStatement = newInstance.listStatement();
    UserSourceMetaDVO userSourceMetaDVO = new UserSourceMetaDVO();
    userSourceMetaDVO.setProjectName(projectName);
    userSourceMetaDVO.setSimpleFileName(fileName);
    userSourceMetaDVO.setRealFilePath(newInstance.getFullFileName());
    userSourceMetaDVO.setUserPcName(userName);
    userSourceMetaDVO.setPackages("");
    svo.setUserSourceMetaDVO(userSourceMetaDVO);
    /* 시작 import문 처리 */
    svo.setImportsDVO(new ImportsDVO());
    /* 끝 import문 처리 */
    // 테이블 데이터 바인드
    List<MethodDVO> methodDVOList = new ArrayList<MethodDVO>();
    for (SourceAnalysisDVO dvo : listStatement) {
        try {
            // 소스내에 존재하는 메소드명.. 접근지 정자 + static + void 등의 잡다한 정보가 담겨있다.
            String methodName = dvo.getMethodName();
            String methodDescription = newInstance.getMethodDescription(methodName);
            MethodDVO methodDVO = null;
            methodDVO = AbstractXframeProgramSpecFile.toMethodDVO(methodName);
            methodDVO.setDescription(methodDescription);
            methodDVOList.add(methodDVO);
        } catch (ProgramSpecSourceException e) {
            e.printStackTrace();
        }
    }
    svo.setMethodDVOList(methodDVOList);
    return svo;
}
Also used : ImportsDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO) UserSourceMetaDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.UserSourceMetaDVO) ArrayList(java.util.ArrayList) ProgramSpecSVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ProgramSpecSVO) ProgramSpecSourceException(com.kyj.fx.voeditor.visual.exceptions.ProgramSpecSourceException) MethodDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO) SourceAnalysisDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.SourceAnalysisDVO)

Example 4 with MethodDVO

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

the class AbstractXframeProgramSpecFile method toMethodDVO.

public static MethodDVO toMethodDVO(String fullMethodName) throws ProgramSpecSourceException {
    String tempName = fullMethodName;
    MethodDVO methodDVO = new MethodDVO();
    methodDVO.setLevel("");
    // 파라미터부분 반환
    String parameterMatched = ValueUtil.regexMatch("\\([\\w\\W]{0,}\\)", tempName).trim();
    if (ValueUtil.isEmpty(parameterMatched)) {
        throw new ProgramSpecSourceException("[버그]파라미터 블록 확인바람.");
    }
    // 파라미터값 추출.
    int startParam_indexOf = parameterMatched.indexOf("(");
    int endParam_indexOf = parameterMatched.indexOf(")");
    String parameterContent = parameterMatched.substring(startParam_indexOf + 1, endParam_indexOf);
    System.out.println(parameterContent);
    List<MethodParameterDVO> convertParameterDVO = convertParameterDVO(parameterContent);
    System.out.println(convertParameterDVO);
    // Simple MethodName 추출.
    int indexOf = tempName.indexOf(parameterMatched);
    // [시작] 2015.3.5 파라미터에 [] 문자가 존재할 경우 정규식으로 인식하는 문제때문에 교체.
    // tempName = tempName.replaceAll(parameterMatched, "").trim();
    tempName = tempName.substring(0, indexOf).trim();
    // [끝] 2015.3.5 파라미터에 [] 문자가 존재할 경우 정규식으로 인식하는 문제때문에 교체.
    String[] args = tempName.split("\\s+");
    String simpleMethodName = args[args.length - 1];
    // 리턴타입 추출.
    String returnType = "";
    for (int i = 0; i < args.length - 1; i++) {
        returnType += args[i] + " ";
    }
    if (returnType.isEmpty()) {
        returnType = "void";
    }
    methodDVO.setReturnType(returnType);
    methodDVO.setMethodName(simpleMethodName);
    methodDVO.setMethodParameterDVOList(convertParameterDVO);
    return methodDVO;
}
Also used : MethodParameterDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodParameterDVO) ProgramSpecSourceException(com.kyj.fx.voeditor.visual.exceptions.ProgramSpecSourceException) MethodDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO)

Example 5 with MethodDVO

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

the class ProgramSpecWordTemplate method methodDetail.

public void methodDetail(List<MethodDVO> dvoList) {
    addBreak();
    int seq = 0;
    for (MethodDVO dvo : dvoList) {
        methodDetail(++seq, dvo);
    }
}
Also used : MethodDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO)

Aggregations

MethodDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO)8 ProgramSpecSourceException (com.kyj.fx.voeditor.visual.exceptions.ProgramSpecSourceException)4 ArrayList (java.util.ArrayList)4 ImportsDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO)3 MethodParameterDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodParameterDVO)2 ProgramSpecSVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ProgramSpecSVO)2 SourceAnalysisDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.SourceAnalysisDVO)2 UserSourceMetaDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.UserSourceMetaDVO)2 List (java.util.List)2 AnnotateBizOptions (com.kyj.fx.voeditor.visual.component.grid.AnnotateBizOptions)1 ITextureBlock (com.kyj.fx.voeditor.visual.words.spec.auto.msword.interfaces.ITextureBlock)1 BaseInfoComposite (com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.skin.BaseInfoComposite)1 TableDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.TableDVO)1 IOException (java.io.IOException)1 ListChangeListener (javafx.collections.ListChangeListener)1 Insets (javafx.geometry.Insets)1 Button (javafx.scene.control.Button)1 BorderPane (javafx.scene.layout.BorderPane)1 HBox (javafx.scene.layout.HBox)1 XWPFTable (org.apache.poi.xwpf.usermodel.XWPFTable)1