use of javafx.scene.paint.Color 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 javafx.scene.paint.Color in project Gargoyle by callakrsos.
the class ScmCommitComposite method load.
public void load() {
try {
scmHistoryWalk();
getBarChartDayOfMonthCategory().setLabel("기간별 커밋 통계");
getLineChartDayOfWeekCategory().setLabel("요일별 커밋 통계");
getBarChartDayOfMonthCategory().getCategories().add(SERIES_LABEL);
getLineChartDayOfWeekCategory().getCategories().add(SERIES_LABEL);
Color lineColor = Color.GREEN;
double strokeWidth = 1;
String cssStyleClassName = ".chart-series-line";
{
/*start Desing css.*/
BarChart<String, Long> barChartDayOfMonth = getBarChartDayOfMonth();
String style = "-fx-bar-fill: ".concat(FxUtil.toWebString(lineColor)).concat(";");
for (Node n : barChartDayOfMonth.lookupAll(".default-color0.chart-bar")) {
n.setStyle(style);
}
// barChartDayOfMonth.setStyle(
// ".chart-legend-item-syCmbol chart-bar series0 bar-legend-symbol default-color0{- fx-background-color:green;}");
/*end Desing css.*/
/*start Popover*/
//무조건 1개의 시리즈만 처리하므로 인덱스에서 바로 가져옴.
ObservableList<Data<String, Long>> dataArr = getBarChartDayOfMonth().getData().get(0).getData();
for (Data<String, Long> d : dataArr) {
d.getNode().setOnMouseClicked(ev -> {
if (ev.getClickCount() == 1 && ev.getButton() == MouseButton.PRIMARY)
createPopOver(d);
});
}
barChartDayOfMonth.setMinWidth(BarChart.USE_COMPUTED_SIZE);
barChartDayOfMonth.requestLayout();
/*end Popover*/
}
{
LineChart<String, Long> lineChartDayOfWeek = getLineChartDayOfWeek();
lineChartDayOfWeek.setStyle(".chart-series-line .series0 .default-color0{- fx-background-color:green;}");
Set<Node> lookupAll = lineChartDayOfWeek.lookupAll(".chart-line-symbol");
StringBuffer sb = new StringBuffer();
sb.append("-fx-background-color: " + FxUtil.toRgbString(lineColor) + ", white;");
sb.append(" -fx-background-insets: 0, 2;");
sb.append("-fx-background-radius: 5px;");
sb.append("-fx-padding: 5px;");
for (Node n : lookupAll) {
n.setStyle(sb.toString());
}
String style = "-fx-stroke: " + FxUtil.toRgbString(lineColor) + "; -fx-stroke-width: " + strokeWidth + ";";
for (Node seriesLine : lineChartDayOfWeek.lookupAll(cssStyleClassName)) {
seriesLine.setStyle(style);
}
}
} catch (SVNException e) {
LOGGER.error(ValueUtil.toString(e));
}
}
use of javafx.scene.paint.Color 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);
}
}
use of javafx.scene.paint.Color in project JFoenix by jfoenixadmin.
the class JFXRadioButtonSkin method handleControlPropertyChanged.
@Override
protected void handleControlPropertyChanged(String p) {
super.handleControlPropertyChanged(p);
if ("SELECTED_COLOR".equals(p)) {
// update animation
updateAnimation();
// update current colors
boolean isSelected = getSkinnable().isSelected();
Color unSelectedColor = ((JFXRadioButton) getSkinnable()).getUnSelectedColor();
Color selectedColor = ((JFXRadioButton) getSkinnable()).getSelectedColor();
rippler.setRipplerFill(isSelected ? selectedColor : unSelectedColor);
if (isSelected)
radio.strokeProperty().set(selectedColor);
} else if ("UNSELECTED_COLOR".equals(p)) {
// update animation
updateAnimation();
// update current colors
boolean isSelected = getSkinnable().isSelected();
Color unSelectedColor = ((JFXRadioButton) getSkinnable()).getUnSelectedColor();
Color selectedColor = ((JFXRadioButton) getSkinnable()).getSelectedColor();
rippler.setRipplerFill(isSelected ? selectedColor : unSelectedColor);
if (!isSelected)
radio.strokeProperty().set(unSelectedColor);
} else if ("SELECTED".equals(p)) {
// update ripple color
boolean isSelected = getSkinnable().isSelected();
Color unSelectedColor = ((JFXRadioButton) getSkinnable()).getUnSelectedColor();
Color selectedColor = ((JFXRadioButton) getSkinnable()).getSelectedColor();
rippler.setRipplerFill(isSelected ? selectedColor : unSelectedColor);
// play selection animation
playAnimation();
}
}
use of javafx.scene.paint.Color in project JFoenix by jfoenixadmin.
the class JFXCheckBoxSkin method createFillTransition.
private void createFillTransition() {
select = new JFXFillTransition(Duration.millis(120), box, Color.TRANSPARENT, (Color) ((JFXCheckBox) getSkinnable()).getCheckedColor());
select.setInterpolator(Interpolator.EASE_OUT);
}
Aggregations