use of javafx.scene.Node in project Gargoyle by callakrsos.
the class BigTextView method initialize.
@FXML
public void initialize() {
// javaTextArea = new TextArea();
// javaTextArea.setPrefSize(TextArea.USE_COMPUTED_SIZE, Double.MAX_VALUE);
hboxButtons.setVisible(showButtons);
pagination = new Pagination(TOTAL_PAGE);
pagination.setCache(true);
pagination.setPageFactory(new Callback<Integer, Node>() {
@Override
public Node call(Integer param) {
if (isUsePageCache && pageCache.containsValue(param)) {
return pageCache.get(param);
}
String readContent = readPage(param);
//new PagedSimpleTextView(BigTextView.this, readContent, false);
SimpleTextView simpleTextView = new SimpleTextView(readContent, false);
simpleTextView.setPrefSize(TextArea.USE_COMPUTED_SIZE, Double.MAX_VALUE);
if (isUsePageCache)
pageCache.put(param, simpleTextView);
return simpleTextView;
}
});
pagination.setPrefSize(Pagination.USE_COMPUTED_SIZE, Pagination.USE_COMPUTED_SIZE);
this.setCenter(pagination);
}
use of javafx.scene.Node in project Gargoyle by callakrsos.
the class FxSVNHistoryDataSupplier method createEntryListView.
// MenuItem createDiffMenu(){
//
// }
ListView<SVNLogEntry> createEntryListView(ObservableList<SVNLogEntry> list) {
ListView<SVNLogEntry> listView = new ListView<SVNLogEntry>(list);
listView.setCellFactory(new Callback<ListView<SVNLogEntry>, ListCell<SVNLogEntry>>() {
@Override
public ListCell<SVNLogEntry> call(ListView<SVNLogEntry> param) {
ListCell<SVNLogEntry> listCell = new ListCell<SVNLogEntry>() {
/* (non-Javadoc)
* @see javafx.scene.control.Cell#updateItem(java.lang.Object, boolean)
*/
@Override
protected void updateItem(SVNLogEntry item, boolean empty) {
super.updateItem(item, empty);
if (empty) {
setText(null);
} else {
long revision = item.getRevision();
String author = item.getAuthor();
String dateString = YYYY_MM_DD_HH_MM_SS_PATTERN.format(item.getDate());
String message = item.getMessage();
setText(String.format("Resivion :%d author %s date :%s message :%s ", revision, author, dateString, message));
}
}
};
return listCell;
}
});
listView.setPrefSize(600, ListView.USE_COMPUTED_SIZE);
listView.addEventHandler(MouseEvent.MOUSE_CLICKED, ev -> {
if (ev.getClickCount() == 2 && ev.getButton() == MouseButton.PRIMARY) {
SVNLogEntry selectedItem = listView.getSelectionModel().getSelectedItem();
if (selectedItem != null) {
Map<String, SVNLogEntryPath> changedPaths = selectedItem.getChangedPaths();
if (ValueUtil.isNotEmpty(changedPaths)) {
ObservableList<GargoyleSVNLogEntryPath> collect = createStream(Arrays.asList(selectedItem)).collect(FxCollectors.toObservableList());
Node showing = null;
if (collect.isEmpty()) {
showing = new Label("Empty.");
showing.setStyle("-fx-text-fill:black");
} else {
showing = createHistoryListView(collect);
}
FxUtil.showPopOver(ev.getPickResult().getIntersectedNode(), showing);
}
}
}
});
return listView;
}
use of javafx.scene.Node in project Gargoyle by callakrsos.
the class NrchRealtimeSrchFlowComposite method defineService.
private void defineService() {
/*
* 비동기 실시간 검색어 조회 처리가 기술.
*/
service = new Service<List<RealtimeSearchVO>>() {
@Override
protected Task<List<RealtimeSearchVO>> createTask() {
return new Task<List<RealtimeSearchVO>>() {
@Override
protected List<RealtimeSearchVO> call() throws Exception {
List<RealtimeSearchVO> meta = Collections.emptyList();
try {
meta = NaverRealtimeSrchSupplier.getInstance().getMeta();
} catch (Exception e) {
DialogUtil.showExceptionDailog(e);
}
return meta;
}
};
}
};
service.setOnCancelled(stat -> {
if (State.CANCELLED == stat.getSource().getState()) {
LOGGER.debug("Cancel Requested");
}
});
service.setOnSucceeded(stat -> {
applyResponseTime(DateUtil.getCurrentDateString());
FlowCardComposite value = new FlowCardComposite();
flowCardComposite.set(value);
this.getParent().setCenter(flowCardComposite.get());
FlowCardComposite tmp = flowCardComposite.get();
ObservableList<Node> flowChildrens = tmp.getFlowChildrens();
tmp.setLimitColumn(20);
data.setAll((List<RealtimeSearchVO>) stat.getSource().getValue());
List<VBox> collect = data.stream().map(nodeConverter::apply).flatMap(v -> v.stream()).collect(Collectors.toList());
flowChildrens.setAll(collect);
if (isRecycle.get()) {
WaitThread waitThread = new WaitThread(THREAD_RUNNER_GROUP, choWaitItems.getValue()) {
@Override
public boolean isContinue() {
return isRecycle.get();
}
@Override
public void execute() {
Platform.runLater(() -> {
if (isContinue())
service.restart();
});
}
@Override
public boolean isRecycle() {
return isRecycle.get();
}
};
waitThread.setDaemon(true);
waitThread.start();
}
});
}
use of javafx.scene.Node in project Gargoyle by callakrsos.
the class CrudBaseGridView method saveBtnClickHandler.
/**
* 저장버튼 클릭 핸들러
*
* @param saveClickCallbackProperty2
*
* @Date 2015. 10. 10.
* @return
* @User KYJ
*/
private EventHandler<MouseEvent> saveBtnClickHandler(ObjectProperty<Consumer<List<T>>> saveClickCallbackProperty) {
return new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
try {
Consumer<List<T>> callback = saveClickCallbackProperty.get();
if (callback == null) {
errorMsgCallback.accept("saveClickCallback 함수에 에러메세지 콜백을 등록하세요.");
return;
}
gridview.fireEvent(event);
List<T> items = getItems();
//필수값 검증로직 추가. 2016.12.08
AbstractVoNullChecker<T> nullCheckHandler = new DefaultVoNullChecker<>(CrudBaseGridView.this);
nullCheckHandler.setList(items);
Optional<Field> findFirst = nullCheckHandler.findFirst();
boolean present = findFirst.isPresent();
if (present) {
String msgFieldName = nullCheckHandler.getMsgNameByfield();
// String message = ValueUtil.getMessage("MSG_W_000001", msgFieldName);
int emptyIndex = nullCheckHandler.getEmptyIndex();
Set<Node> findAllByNodes = CrudBaseGridView.this.lookupAll("TableRow");
findAllByNodes.stream().map(n -> (TableRow) n).filter(r -> {
return emptyIndex == r.getIndex();
}).findFirst().ifPresent(n -> {
Timeline timeline = new Timeline();
timeline.setCycleCount(10);
timeline.setAutoReverse(true);
KeyFrame keyFrame = new KeyFrame(Duration.millis(500), new KeyValue(n.styleProperty(), "-fx-border-color : red ; -fx-border-width : 1px"));
KeyFrame keyFrame2 = new KeyFrame(Duration.millis(500), new KeyValue(n.styleProperty(), ""));
KeyValue keyValueX = new KeyValue(n.styleProperty(), "-fx-border-color : red ; -fx-border-width : 1px");
KeyValue keyValueY = new KeyValue(n.styleProperty(), "");
KeyFrame keyFrame3 = new KeyFrame(Duration.seconds(2), "", keyValueX, keyValueY);
timeline.getKeyFrames().add(keyFrame3);
timeline.play();
});
getSelectionModel().select(emptyIndex);
// DialogUtil.showMessageDialog(SharedMemory.getPrimaryStage(), msgFieldName + " Field is empty.");
return;
}
List<T> arrayList = new ArrayList<T>(items);
arrayList.addAll(deleteItems);
callback.accept(arrayList);
// 사용자 정의 로직이 이상없으면 deleteItems 항목도 비운다.
deleteItems.clear();
} catch (Exception e) {
throw e;
}
}
};
}
use of javafx.scene.Node in project Gargoyle by callakrsos.
the class PMDViolationbyBarChartComposite method style.
/**
* @작성자 : KYJ
* @작성일 : 2016. 10. 24.
* @param barChart2
*/
private void style(BarChart<String, Number> chart) {
Color lineColor = Color.web("#58AD58");
// chart-bar series0 data2 default-color0
String style = "-fx-bar-fill: ".concat(FxUtil.toWebString(lineColor)).concat(";");
Set<Node> lookupAll = chart.lookupAll(".default-color0");
for (Node n : lookupAll) {
// anotherStyleAction.accept(style);
n.setStyle(style);
}
}
Aggregations