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;
}
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;
}
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;
}
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;
}
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);
}
}
Aggregations