本文整理汇总了Java中javafx.scene.effect.SepiaTone类的典型用法代码示例。如果您正苦于以下问题:Java SepiaTone类的具体用法?Java SepiaTone怎么用?Java SepiaTone使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SepiaTone类属于javafx.scene.effect包,在下文中一共展示了SepiaTone类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setSepiaTone
import javafx.scene.effect.SepiaTone; //导入依赖的package包/类
/**
* @param sepiaToneLevel
*/
@SuppressWarnings("unused")
public void setSepiaTone(double sepiaToneLevel) {
// For some reason in some computers setting the SepiaTone effect hide the pane.
if(true) {
return;
}
Effect effect = getEffect();
if(effect == null) {
setEffect(new SepiaTone(sepiaToneLevel));
}
else if(effect instanceof SepiaTone) {
((SepiaTone) effect).setLevel(sepiaToneLevel);
}
}
开发者ID:ipfaffen,项目名称:prishonor,代码行数:19,代码来源:ElementLostAssistant.java
示例2: SepiaToneSample
import javafx.scene.effect.SepiaTone; //导入依赖的package包/类
public SepiaToneSample() {
ImageView sample = new ImageView(BOAT);
final SepiaTone sepiaTone = new SepiaTone();
sepiaTone.setLevel(0.5d);
sample.setEffect(sepiaTone);
getChildren().add(sample);
// REMOVE ME
setControls(
new SimplePropertySheet.PropDesc("SepiaTone Level", sepiaTone.levelProperty(), 0d, 1d)
);
// END REMOVE ME
}
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:13,代码来源:SepiaToneSample.java
示例3: createIconContent
import javafx.scene.effect.SepiaTone; //导入依赖的package包/类
public static Node createIconContent() {
ImageView iv = new ImageView(BOAT);
iv.setFitWidth(80);
iv.setFitHeight(80);
iv.setViewport(new Rectangle2D(90,0,332,332));
final SepiaTone SepiaTone = new SepiaTone();
SepiaTone.setLevel(1);
iv.setEffect(SepiaTone);
return iv;
}
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:11,代码来源:SepiaToneSample.java
示例4: createGUI
import javafx.scene.effect.SepiaTone; //导入依赖的package包/类
/** render the application on a stage */
public StackPane createGUI() {
SwingUtilities.invokeLater(() -> {
//Simulation.instance().getJConsole().write(ADDRESS,Color.ORANGE,Color.BLACK);
});
// place the address content in a bordered title pane.
Pane titledContent = new BorderedTitledPane(TITLE, getContent());
titledContent.getStyleClass().add("titled-address");
titledContent.setPrefSize(800, 745);
// make some crumpled paper as a background.
final Image paper = new Image(PAPER);
final ImageView paperView = new ImageView(paper);
ColorAdjust colorAdjust = new ColorAdjust(0, -.2, .2, 0);
paperView.setEffect(colorAdjust);
// place the address content over the top of the paper.
StackPane stackedContent = new StackPane();
stackedContent.getChildren().addAll(paperView, titledContent);
// manage the viewport of the paper background, to size it to the content.
paperView.setViewport(new Rectangle2D(0, 0, titledContent.getPrefWidth(), titledContent.getPrefHeight()));
stackedContent.layoutBoundsProperty().addListener(new ChangeListener<Bounds>() {
@Override public void changed(ObservableValue<? extends Bounds> observableValue, Bounds oldValue, Bounds newValue) {
paperView.setViewport(new Rectangle2D(
newValue.getMinX(), newValue.getMinY(),
Math.min(newValue.getWidth(), paper.getWidth()), Math.min(newValue.getHeight(), paper.getHeight())
));
}
});
// blend the content into the paper and make it look old.
titledContent.setMaxWidth(paper.getWidth());
titledContent.setEffect(new SepiaTone());
titledContent.setBlendMode(BlendMode.MULTIPLY);
// configure and display the scene and stage.
//Scene scene = new Scene(stackedContent);
//scene.getStylesheets().add(getClass().getResource("/css/gettysburg.css").toExternalForm());
/*
stage.setTitle(TITLE);
stage.getIcons().add(new Image(ICON));
stage.setScene(scene);
stage.setMinWidth(600); stage.setMinHeight(500);
stage.show();
*/
// make the scrollbar in the address scroll pane hide when it is not needed.
makeScrollFadeable(titledContent.lookup(".address > .scroll-pane"));
return stackedContent;
}
开发者ID:mars-sim,项目名称:mars-sim,代码行数:55,代码来源:Story.java
示例5: createContent
import javafx.scene.effect.SepiaTone; //导入依赖的package包/类
private Parent createContent() {
Pane root = new Pane();
ImageView imageView = new ImageView(new Image(getClass()
.getResource("res/Fallout4_bg.jpg").toExternalForm()));
imageView.setFitWidth(1280);
imageView.setFitHeight(720);
SepiaTone tone = new SepiaTone(0.85);
imageView.setEffect(tone);
Rectangle masker = new Rectangle(1280, 720);
masker.setOpacity(0);
masker.setMouseTransparent(true);
MenuBox menuBox = new MenuBox(250, 350);
menuBox.setTranslateX(250);
menuBox.setTranslateY(230);
MenuBox menuBox2 = new MenuBox(510, 350);
menuBox2.setTranslateX(250 + 20 + 250);
menuBox2.setTranslateY(230);
menuBox.addItem(new MenuItem("CONTINUE", 250));
MenuItem itemNew = new MenuItem("NEW", 250);
itemNew.setOnAction(() -> {
FadeTransition ft = new FadeTransition(Duration.seconds(1.5), masker);
ft.setToValue(1);
ft.setOnFinished(e -> {
root.getChildren().setAll(new LoadingScreen(1280, 720, () -> {
masker.setOpacity(0);
root.getChildren().setAll(imageView, menuBox, menuBox2, masker);
}));
});
ft.play();
});
menuBox.addItem(itemNew);
menuBox.addItem(new MenuItem("LOAD", 250));
MenuItem itemSettings = new MenuItem("SETTINGS", 250);
itemSettings.setOnAction(() -> {
menuBox2.addItems(
new MenuItem("GAMEPLAY", 510),
new MenuItem("CONTROLS", 510),
new MenuItem("DISPLAY", 510),
new MenuItem("AUDIO", 510));
});
menuBox.addItem(itemSettings);
menuBox.addItem(new MenuItem("CREW", 250));
MenuItem itemExit = new MenuItem("EXIT", 250);
itemExit.setOnAction(() -> System.exit(0));
menuBox.addItem(itemExit);
root.getChildren().addAll(imageView, menuBox, menuBox2, masker);
return root;
}
开发者ID:AlmasB,项目名称:FXTutorials,代码行数:63,代码来源:Fallout4MenuApp.java
注:本文中的javafx.scene.effect.SepiaTone类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论