本文整理了Java中javafx.scene.paint.Color.valueOf()
方法的一些代码示例,展示了Color.valueOf()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Color.valueOf()
方法的具体详情如下:
包路径:javafx.scene.paint.Color
类名称:Color
方法名:valueOf
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
private void updateColorFromUserInput(String colorWebString) {
if (!systemChange) {
userChange = true;
try {
curvedColorPicker.setColor(Color.valueOf(colorWebString));
} catch (IllegalArgumentException ignored) {
// if color is not valid then do nothing
}
userChange = false;
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
public Paint getDefaultColor() {
return defaultColor == null ? Color.valueOf("#009688") : defaultColor.get();
}
代码示例来源:origin: jfoenixadmin/JFoenix
public Paint getToggleLineColor() {
return toggleLineColor == null ? Color.valueOf("#77C2BB") : toggleLineColor.get();
}
代码示例来源:origin: jfoenixadmin/JFoenix
public Paint getUnToggleLineColor() {
return untoggleLineColor == null ? Color.valueOf("#999999") : untoggleLineColor.get();
}
代码示例来源:origin: jfoenixadmin/JFoenix
public Paint getDefaultColor() {
return defaultColor == null ? Color.valueOf("#009688") : defaultColor.get();
}
代码示例来源:origin: jfoenixadmin/JFoenix
public Paint getFocusColor() {
return focusColor == null ? Color.valueOf("#4059A9") : focusColor.get();
}
代码示例来源:origin: jfoenixadmin/JFoenix
public Paint getCheckedColor() {
return checkedColor == null ? Color.valueOf("#0F9D58") : checkedColor.get();
}
代码示例来源:origin: jfoenixadmin/JFoenix
public Paint getUnCheckedColor() {
return unCheckedColor == null ? Color.valueOf("#5A5A5A") : unCheckedColor.get();
}
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
public Paint getFocusColor() {
return focusColor == null ? Color.valueOf("#4059A9") : focusColor.get();
}
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
public Paint getFocusColor() {
return focusColor == null ? Color.valueOf("#4059A9") : focusColor.get();
}
代码示例来源:origin: jfoenixadmin/JFoenix
public Paint getToggleColor() {
return toggleColor == null ? Color.valueOf("#009688") : toggleColor.get();
}
代码示例来源:origin: jfoenixadmin/JFoenix
public Paint getUnToggleColor() {
return untoggleColor == null ? Color.valueOf("#FAFAFA") : untoggleColor.get();
}
代码示例来源:origin: jfoenixadmin/JFoenix
public Paint getFocusColor() {
return focusColor == null ? Color.valueOf("#4059A9") : focusColor.get();
}
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
public void start(Stage stage) {
FlowPane main = new FlowPane();
main.setVgap(20);
main.setHgap(20);
DatePicker datePicker = new DatePicker();
main.getChildren().add(datePicker);
JFXDatePicker datePickerFX = new JFXDatePicker();
main.getChildren().add(datePickerFX);
datePickerFX.setPromptText("pick a date");
JFXTimePicker blueDatePicker = new JFXTimePicker();
blueDatePicker.setDefaultColor(Color.valueOf("#3f51b5"));
blueDatePicker.setOverLay(true);
main.getChildren().add(blueDatePicker);
StackPane pane = new StackPane();
pane.getChildren().add(main);
StackPane.setMargin(main, new Insets(100));
pane.setStyle("-fx-background-color:WHITE");
final Scene scene = new Scene(pane, 400, 700);
final ObservableList<String> stylesheets = scene.getStylesheets();
stylesheets.addAll(MainDemo.class.getResource("/css/jfoenix-fonts.css").toExternalForm(),
MainDemo.class.getResource("/css/jfoenix-design.css").toExternalForm());
stage.setTitle("JFX Date Picker Demo");
stage.setScene(scene);
stage.show();
}
代码示例来源:origin: jfoenixadmin/JFoenix
@Override
public void start(Stage stage) throws Exception {
final VBox pane = new VBox();
pane.setSpacing(30);
pane.setStyle("-fx-background-color:#EEE; -fx-padding: 40;");
ToggleButton button = new ToggleButton("JavaFx Toggle");
pane.getChildren().add(button);
JFXToggleButton toggleButton = new JFXToggleButton();
toggleButton.setText("New Skin");
pane.getChildren().add(toggleButton);
JFXToggleNode node = new JFXToggleNode();
final GlyphIcon heartIcon = GlyphsBuilder.create(FontAwesomeIconView.class)
.glyph(FontAwesomeIcon.HEART)
.build();
heartIcon.setStyle("-fx-padding: 10");
node.setGraphic(heartIcon);
pane.getChildren().add(node);
final Scene scene = new Scene(pane, 600, 400, Color.valueOf("#EEE"));
stage.setTitle("JFX Toggle Button Demo ");
scene.getStylesheets()
.add(ToggleButtonDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());
stage.setScene(scene);
stage.setResizable(false);
stage.show();
}
代码示例来源:origin: jfoenixadmin/JFoenix
.get(0);
((Region) glyphDetailViewer.sizeSlider.lookup(lookup)).setBackground(new Background(new BackgroundFill(
Color.valueOf(webColor),
fill.getRadii(),
fill.getInsets())));
.toString()
.substring(0, 8);
final BackgroundFill backgroundFill = new BackgroundFill(Color.valueOf(currentColor + DEFAULT_OPACITY),
lastClicked.getBackground().getFills().get(0).getRadii(),
null);
.substring(0, 8);
button.setBackground(new Background(new BackgroundFill(Color.valueOf(currentColor + DEFAULT_OPACITY),
button.getBackground() == null ? null : button.getBackground().getFills().get(0).getRadii(),
null)));
代码示例来源:origin: jfoenixadmin/JFoenix
blueColor = Color.valueOf("#4285f4");
redColor = Color.valueOf("#db4437");
yellowColor = Color.valueOf("#f4b400");
greenColor = Color.valueOf("#0F9D58");
代码示例来源:origin: jfoenixadmin/JFoenix
path.getTransforms().add(rotate);
this.getChildren().add(shapesStartIndex, path);
path.setFill(Color.valueOf(getDefaultColor(i)));
path.addEventHandler(MouseEvent.MOUSE_CLICKED, (event) -> selectedPath.set(path));
代码示例来源:origin: jfoenixadmin/JFoenix
private void updateColor() {
final ColorPicker colorPicker = (ColorPicker) getSkinnable();
Color color = colorPicker.getValue();
// update picker box color
Color circleColor = color == null ? Color.WHITE : color;
Circle colorCircle = new Circle();
colorCircle.setFill(circleColor);
colorCircle.setLayoutX(colorBox.getWidth() / 4);
colorCircle.setLayoutY(colorBox.getHeight() / 2);
colorBox.getChildren().add(colorCircle);
Timeline animateColor = new Timeline(new KeyFrame(Duration.millis(240),
new KeyValue(colorCircle.radiusProperty(),
200,
Interpolator.EASE_BOTH)));
animateColor.setOnFinished((finish) -> {
JFXNodeUtils.updateBackground(colorBox.getBackground(), colorBox, colorCircle.getFill());
colorBox.getChildren().remove(colorCircle);
});
animateColor.play();
// update label color
displayNode.setTextFill(circleColor.grayscale().getRed() < 0.5 ? Color.valueOf(
"rgba(255, 255, 255, 0.87)") : Color.valueOf("rgba(0, 0, 0, 0.87)"));
if (colorLabelVisible.get()) {
displayNode.setText(JFXNodeUtils.colorToHex(circleColor));
} else {
displayNode.setText("");
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
dayCell.setBackground(new Background(new BackgroundFill(Color.valueOf("#EDEDED"),
new CornerRadii(40),
Insets.EMPTY)));
内容来源于网络,如有侵权,请联系作者删除!