use of com.kyj.fx.voeditor.visual.main.model.vo.ConfigurationGraphicsNodeItem in project Gargoyle by callakrsos.
the class CustomSkinConfigView method load.
/**
* Load TreeItem
*
* @작성자 : KYJ
* @작성일 : 2016. 12. 2.
* @param item
*/
private void load(ConfigurationTreeItem item) {
if (item != null) {
if (item instanceof ConfigurationGraphicsNodeItem) {
ConfigurationGraphicsNodeItem node = (ConfigurationGraphicsNodeItem) item;
if (node.getCustomOpenStyle() != null) {
Consumer<Class<?>> customOpenStyle = node.getCustomOpenStyle();
customOpenStyle.accept(node.getContentNode());
} else if (node.getContentNode() != null) {
Class<?> cont = node.getContentNode();
try {
Object newInstance = cont.newInstance();
if (newInstance instanceof Parent) {
FxUtil.createStageAndShow((Parent) newInstance, stage -> {
stage.initOwner(CustomSkinConfigView.this.getScene().getWindow());
stage.setTitle(node.getItemName());
});
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
use of com.kyj.fx.voeditor.visual.main.model.vo.ConfigurationGraphicsNodeItem in project Gargoyle by callakrsos.
the class ConfigurationViewController method change.
/**
* 트리를 더블클릭할때 처리되는 이벤트 함수이다.
*
* ConfigurationLeafNodeItem 타입의 트리노드인 경우에 ConfigurationLeafNodeItem 클래스안의
* ContentNode에 존재하는 Class를 읽은후 객체를 생성하며, 객체생성에 문제가 없는 경우 화면에 불러들인다.
*
* @작성자 : KYJ
* @작성일 : 2015. 11. 4.
* @param e
*/
// @FXML
// public void tvItemsMouseClick(MouseEvent e) {
// if (e.getClickCount() == 1) {
// TreeItem<ConfigurationTreeItem> selectedItem = tvItems.getSelectionModel().getSelectedItem();
// if (selectedItem == null) {
// return;
// }
//
// change(selectedItem);
// }
// }
/**
* 선택 아이템 변경시 처리.
* @작성자 : KYJ
* @작성일 : 2016. 12. 1.
* @param selectedItem
*/
private void change(TreeItem<ConfigurationTreeItem> selectedItem) {
ConfigurationTreeItem value = selectedItem.getValue();
if (value == null) {
return;
}
if (value instanceof ConfigurationGraphicsNodeItem) {
ConfigurationGraphicsNodeItem node = (ConfigurationGraphicsNodeItem) value;
Class<?> contentNode = node.getContentNode();
if (contentNode == null)
return;
try {
Node newInstance = (Node) contentNode.newInstance();
borContent.setCenter(newInstance);
} catch (Exception e1) {
LOGGER.error(ValueUtil.toString(e1));
}
}
}
Aggregations