use of com.kyj.fx.voeditor.visual.framework.annotation.FxPostInitialize in project Gargoyle by callakrsos.
the class LogViewController method onAfter.
@FxPostInitialize
public void onAfter() throws IOException {
File monitoringFile = composite.getMonitoringFile();
fileChannel = FileChannel.open(monitoringFile.toPath(), StandardOpenOption.READ);
buffer = ByteBuffer.allocate(seekSize);
String encoding = ResourceLoader.loadCharset();
if (Charset.isSupported(encoding)) {
charset.set(Charset.forName(encoding));
} else {
LOGGER.info("does not supported encoding {} , default utf-8 setting. ", encoding);
encoding = "UTF-8";
charset.set(Charset.forName(encoding));
}
//설정에 저장된 인코딩셋을 불러와 디폴트로 선택되게함.
ObservableList<Toggle> toggles = ENCODING.getToggles();
toggles.stream().map(tg -> {
if (tg instanceof RadioMenuItem) {
RadioMenuItem r = (RadioMenuItem) tg;
if (r.getText().toUpperCase().equals(charset.get().name().toUpperCase())) {
return r;
}
}
return null;
}).filter(v -> v != null).findFirst().ifPresent(rmi -> {
rmi.setSelected(true);
});
//캐릭터셋이 변경될때 환경변수에 등록하는 과정
this.charset.addListener((oba, o, newCharset) -> {
String name = newCharset.name();
if (ValueUtil.isEmpty(name)) {
return;
}
ResourceLoader.saveCharset(name);
});
}
use of com.kyj.fx.voeditor.visual.framework.annotation.FxPostInitialize in project Gargoyle by callakrsos.
the class SkinPreviewViewComposite method previewTabInit.
@FxPostInitialize
public void previewTabInit() {
Task<Void> task = new Task<Void>() {
@Override
protected Void call() throws Exception {
Thread.sleep(5000L);
Platform.runLater(() -> {
//메뉴바 배경.
{
Background background = mbSample.getBackground();
Color fill = (Color) background.getFills().get(0).getFill();
colorMbSample.setValue(fill);
//메뉴바 텍스트
{
Label lookup = (Label) mbSample.lookup(".label");
Color textFill = (Color) lookup.getTextFill();
colorMbLabelSample.setValue(textFill);
}
}
//Hbox 배경.
{
Background background = hboxSample.getBackground();
Color fill = (Color) background.getFills().get(0).getFill();
colorHboxSample.setValue(fill);
}
{
//선택디지않는 탭 색상 처리.
Set<Node> lookupAll = tabpaneSample.lookupAll(".tab:top");
lookupAll.forEach(lookup -> {
Optional<PseudoClass> findFirst = lookup.getPseudoClassStates().stream().filter(v -> {
return "selected".equals(v.getPseudoClassName());
}).findFirst();
if (findFirst.isPresent()) {
Label selectedTabLabel = (Label) lookup.lookup(".tab-label");
Color textFill = (Color) selectedTabLabel.getTextFill();
colorSelectedTabText.setValue(textFill);
} else {
Label selectedTabLabel = (Label) lookup.lookup(".tab-label");
Color textFill = (Color) selectedTabLabel.getTextFill();
colorUnSelectedTabText.setValue(textFill);
}
});
{
lookupAll.stream().findFirst().ifPresent(n -> {
Pane p = (Pane) n;
Background background = p.getBackground();
Color fill = (Color) background.getFills().get(0).getFill();
colorTabSample1Selected.setValue(fill);
});
}
}
});
return null;
}
};
Window window = this.getScene().getWindow();
if (window != null) {
FxUtil.showLoading(window, task);
} else
FxUtil.showLoading(task);
}
use of com.kyj.fx.voeditor.visual.framework.annotation.FxPostInitialize in project Gargoyle by callakrsos.
the class InjectionItemListComposite method loaditems.
@FxPostInitialize
public void loaditems() {
itemsDir = new File(CODE_DIR);
if (!itemsDir.exists()) {
itemsDir.mkdirs();
}
List<CodeItem> collect = Stream.of(itemsDir.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.endsWith(".java");
}
})).map(f -> {
CodeItem codeItem = new CodeItem();
codeItem.setFile(f);
codeItem.setName(f.getName());
return codeItem;
}).collect(Collectors.toList());
lvItems.getItems().addAll(collect);
}
use of com.kyj.fx.voeditor.visual.framework.annotation.FxPostInitialize in project Gargoyle by callakrsos.
the class CodeAnalysisJavaTextArea method init.
@FxPostInitialize
public void init() {
List<SourceAnalysisDVO> methodList = Collections.emptyList();
try {
newInstance = new BizFile(javaFile);
List<String> readLines = newInstance.getReadLines();
txtJavaTextArea.setContent(readLines);
// svo = ProgramSpecUtil.doJavaFile("sampleJavaProject",
// javaFile.getName(), (AbstractJavaProgramSpecFile) newInstance);
// this.setContent(svo.getFile().getInspectorSourceMeta().getSourceCode());
SourceCodeAnalysis sa = newInstance.getJavaSourceAnalysis();
methodList = sa.findStatement();
choMethod.getItems().addAll(methodList);
} catch (Exception e) {
LOGGER.error(ValueUtil.toString(e));
}
}
use of com.kyj.fx.voeditor.visual.framework.annotation.FxPostInitialize in project Gargoyle by callakrsos.
the class MacroSqlComposite method post.
@FxPostInitialize
public void post() {
MenuItem menuAddItem = new MenuItem("Add");
menuAddItem.setAccelerator(new KeyCodeCombination(KeyCode.INSERT, KeyCharacterCombination.CONTROL_DOWN));
menuAddItem.setOnAction(e -> {
addOnAction();
});
MenuItem menuDeleteItem = new MenuItem("Delete");
menuDeleteItem.setAccelerator(new KeyCodeCombination(KeyCode.DELETE, KeyCharacterCombination.CONTROL_DOWN));
menuDeleteItem.setOnAction(e -> {
addOnAction();
});
tvFavorite.setContextMenu(new ContextMenu(menuAddItem, menuDeleteItem));
borContent.setCenter(new MacroControl(connectionSupplier, initText));
MacroFavorTreeItemCreator macroFavorTreeItem = new MacroFavorTreeItemCreator(connectionSupplier);
MacroItemVO f = new MacroItemVO();
tvFavorite.setRoot(macroFavorTreeItem.createRoot(f));
tvFavorite.setShowRoot(false);
}
Aggregations