• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Blend类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javafx.scene.effect.Blend的典型用法代码示例。如果您正苦于以下问题:Java Blend类的具体用法?Java Blend怎么用?Java Blend使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Blend类属于javafx.scene.effect包,在下文中一共展示了Blend类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createTargetButton

import javafx.scene.effect.Blend; //导入依赖的package包/类
private void createTargetButton() {
	target = (StackPane) lookup("#targetAnchor");
	Image image = IconFactory.getTargetIcon();
	ImageView targetIcon = new ImageView(image);
	targetIcon.setClip(new ImageView(image));
	ColorAdjust monochrome = new ColorAdjust();
	monochrome.setSaturation(-1.0);

	Blend red = new Blend(BlendMode.MULTIPLY, monochrome,
			new ColorInput(0, 0, targetIcon.getImage().getWidth(), targetIcon.getImage().getHeight(), Color.RED));

	Blend green = new Blend(BlendMode.MULTIPLY, monochrome,
			new ColorInput(0, 0, targetIcon.getImage().getWidth(), targetIcon.getImage().getHeight(), new Color(0, 1, 0, 0.5)));

	targetButton = targetIcon;

	targetIcon.effectProperty().bind(Bindings.when(targetButton.hoverProperty()).then((Effect) green).otherwise((Effect) red));
	targetButton.setId("target_button");
	hideTargetMarker();
	target.getChildren().add(targetButton);
}
 
开发者ID:demilich1,项目名称:metastone,代码行数:22,代码来源:GameToken.java


示例2: decorate

import javafx.scene.effect.Blend; //导入依赖的package包/类
public void decorate(BorderPane border, Button Neues_Projekt, Button Laden, Button Beenden, Blend blend){
    GridPane root = new GridPane();
    GridPane title = new GridPane();
    GridPane empty_space = new GridPane();
    GridPane empty_space2 = new GridPane();
    GridPane empty_space3 = new GridPane();

    border.setTop(title);
    border.setLeft(empty_space);
    border.setRight(empty_space2);
    border.setCenter(root);
    border.setBottom(empty_space3);
    border.setStyle("-fx-background-color: #E0E0E0");

    root.setAlignment(Pos.TOP_CENTER);
    root.setPadding(new Insets(25, 25, 25, 25));
    root.add(Neues_Projekt, 0, 0);
    root.setVgap(10);
    root.add(Laden, 0, 1);
    root.add(Beenden, 0, 2);

    Text text = new Text("Willkommen!");
    text.setFont(Font.font("Verdana", FontPosture.ITALIC, 35));
    text.setStyle("-fx-font-weight: bold;");
    text.setFill(Color.BLACK);
    text.setEffect(blend);
    text.setCache(true);


    title.setAlignment(Pos.BOTTOM_CENTER);
    title.setPadding(new Insets(25, 25, 25, 25));
    title.add(text, 0, 6);
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-proprawunderbar,代码行数:34,代码来源:UIRunner.java


示例3: shadowandinner

import javafx.scene.effect.Blend; //导入依赖的package包/类
public void shadowandinner(Blend blend){
    DropShadow shadow = new DropShadow();
    shadow.setOffsetY(7.0f);
    shadow.setColor(Color.DARKGRAY);

    InnerShadow innerShadow = new InnerShadow();
    innerShadow.setOffsetX(1.0f);
    innerShadow.setOffsetY(1.0f);
    innerShadow.setColor(Color.LIGHTGRAY);

    blend.setMode(BlendMode.MULTIPLY);
    blend.setBottomInput(shadow);
    blend.setTopInput(innerShadow);
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-proprawunderbar,代码行数:15,代码来源:UIRunner.java


示例4: textdesign

import javafx.scene.effect.Blend; //导入依赖的package包/类
public static void textdesign(Text text,Blend blend){
	text.setFont(Font.font("Verdana", 30));
	text.setStyle("-fx-font-weight: bold; -fx-base: #FFFFFF");
	text.setFill(Color.DARKGRAY);
	text.setEffect(blend);
	text.setCache(true);
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-proprawunderbar,代码行数:8,代码来源:Test_UI.java


示例5: applyFontColor

import javafx.scene.effect.Blend; //导入依赖的package包/类
private static void applyFontColor(ImageView image, Color color) {
	ColorAdjust monochrome = new ColorAdjust();
	monochrome.setSaturation(-1.0);
	Effect colorInput = new ColorInput(0, 0, image.getImage().getWidth(), image.getImage().getHeight(), color);
	Blend blend = new Blend(BlendMode.MULTIPLY, new ImageInput(image.getImage()), colorInput);
	image.setClip(new ImageView(image.getImage()));
	image.setEffect(blend);
	image.setCache(true);
}
 
开发者ID:demilich1,项目名称:metastone,代码行数:10,代码来源:DigitFactory.java


示例6: createRequiredDecorations

import javafx.scene.effect.Blend; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected Collection<Decoration> createRequiredDecorations(Control target) {
	ImageView imageView = new ImageView(REQUIRED_IMAGE);
	// The following code will transform REQUIRED_IMAGE from red to blue.
	ColorAdjust adjust = new ColorAdjust();
	adjust.setSaturation(-1);
	Blend bluemaker = new Blend(BlendMode.SRC_ATOP, adjust,
			new ColorInput(0, 0, imageView.getImage().getWidth(),
					imageView.getImage().getHeight(), Color.DEEPSKYBLUE));
	imageView.setEffect(bluemaker);
	return Arrays.asList(new GraphicDecoration(imageView, Pos.TOP_LEFT,
			REQUIRED_IMAGE.getWidth() / 2, REQUIRED_IMAGE.getHeight() / 2));
}
 
开发者ID:ubershy,项目名称:StreamSis,代码行数:17,代码来源:CuteGraphicValidationDecoration.java


示例7: colorize

import javafx.scene.effect.Blend; //导入依赖的package包/类
/**
 * Given a monochrome image, apply a color to it
 * 
 * @param imageView A view to the target monochrome image
 * @param color Target new image color
 */
public static void colorize(final ImageView imageView, final Paint color) {		
	final ColorAdjust monochrome = new ColorAdjust();
       monochrome.setSaturation(-1.0);
       monochrome.setBrightness(0.75);

	final Blend selectionColorBlend = new Blend(BlendMode.SRC_ATOP,
			monochrome, new ColorInput(0, 0, imageView.getFitWidth(),
					imageView.getFitHeight(), color));	        
	imageView.setEffect(selectionColorBlend);			
}
 
开发者ID:veroslav,项目名称:jfx-torrent,代码行数:17,代码来源:ImageUtils.java


示例8: getOverlayImage

import javafx.scene.effect.Blend; //导入依赖的package包/类
/**
 * Retrieve an overlay image.
 *
 * @param overlayType
 *            The overlay type.
 * @param side
 *            The side of the eye.
 * @param color
 *            The overlay color.
 *
 * @return The overlay image.
 */
private static Image getOverlayImage(final int overlayType, final RightLeft side, final Color color) {
	URL imageUrl = ClassLoader.getSystemResource("overlay/" + getOverlayFileName(overlayType, side));

	Image image = new Image(imageUrl.toExternalForm());

	Canvas canvas = new Canvas(OVERLAY_SIZE, OVERLAY_SIZE);
	Color colorNoAlpha = new Color(color.getRed(), color.getGreen(), color.getBlue(), 1);

	Blend effect = new Blend(
			BlendMode.SRC_ATOP,
			null,
			new ColorInput(
					0,
					0,
					OVERLAY_SIZE,
					OVERLAY_SIZE,
					colorNoAlpha));

	// Type 2 is not changed in color.
	if (overlayType != 2) {
		canvas.getGraphicsContext2D().setEffect(effect);
	}
	canvas.getGraphicsContext2D().setGlobalAlpha(color.getOpacity());
	canvas.getGraphicsContext2D().drawImage(image, 0, 0, OVERLAY_SIZE, OVERLAY_SIZE);
	SnapshotParameters parameters = new SnapshotParameters();
	parameters.setFill(Color.TRANSPARENT);

	return canvas.snapshot(parameters, null);
}
 
开发者ID:jeisfeld,项目名称:Augendiagnose,代码行数:42,代码来源:ImageUtil.java


示例9: GeographicalFirmPortrait

import javafx.scene.effect.Blend; //导入依赖的package包/类
public GeographicalFirmPortrait(final GeographicalFirm agent,
                                  Color firmColor, GoodType goodSold, MacroII model) {
    super(agent,agent.xLocationProperty(),agent.yLocationProperty());
    color.setValue(firmColor);
    this.firm = agent;
    //add a glow effect
    Glow glow = new Glow(3);
    Blend blend = new Blend(BlendMode.SRC_OVER, glow,icon.effectProperty().getValue());

    icon.setEffect(blend);



    //schedule yourself to update your text
    StackPane.setAlignment(priceText, Pos.CENTER);
    priceText.setFont(Font.font("Verdana", FontWeight.BOLD,10));
    model.scheduleSoon(ActionOrder.GUI_PHASE,new Steppable() {
        @Override
        public void step(SimState state) {
            if(!active)
                return;
            long price = agent.getSalesDepartment(goodSold).getLastAskedPrice();
            Platform.runLater(() -> priceText.setText(String.valueOf(price)));
            //reschedule
            model.scheduleTomorrow(ActionOrder.GUI_PHASE,this);
        }
    });
    //register as deactivable with the model
    model.registerDeactivable(this);

}
 
开发者ID:CarrKnight,项目名称:MacroIIDiscrete,代码行数:32,代码来源:GeographicalFirmPortrait.java


示例10: start

import javafx.scene.effect.Blend; //导入依赖的package包/类
@Override
 public void start(Stage primaryStage) throws Exception{
 
     Button Neues_Projekt = new Button("Neue Übung Auswählen");
     
     List<Exercise> exercises = readExercise();
     Neues_Projekt.setOnAction(e -> {
         try {
         	
         	Loader.ask(exercises);}
         catch (Exception ex) {}
     	stage.close();
     });

     Button Laden = new Button("Zuletzt verwendete Übung laden");
     Laden.setOnAction(e -> {
         try {
	Loader.ask(exercises);
} catch (Exception e1) {
	e1.printStackTrace();
}
         stage.close();
     });

     Button Beenden = new Button("Beenden");
     Beenden.setOnAction(e -> {
         stage.close();
     });
     Blend blend = new Blend();
     shadowandinner(blend);

     design(Neues_Projekt,blend);
     design(Laden,blend);
     design(Beenden,blend);

     BorderPane border = new BorderPane();
     decorate(border,Neues_Projekt,Laden,Beenden,blend);

     stage.setScene(new Scene(border, 440, 350));
     stage.initStyle(StageStyle.UTILITY);
     stage.setTitle("Test-Driven-Development-Trainer");
     stage.show();
 }
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-proprawunderbar,代码行数:44,代码来源:UIRunner.java


示例11: design

import javafx.scene.effect.Blend; //导入依赖的package包/类
public void design(Button button, Blend blend){
    button.setPrefSize(250, 40);
    button.setEffect(blend);
    button.setStyle("-fx-font: 13 georgia;-fx-font-weight: bold; -fx-base: #FFFFFF");
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-proprawunderbar,代码行数:6,代码来源:UIRunner.java


示例12: createBlend

import javafx.scene.effect.Blend; //导入依赖的package包/类
public void createBlend() {

		blend = new Blend();
		blend.setMode(BlendMode.MULTIPLY);

		DropShadow ds = new DropShadow();
		ds.setColor(Color.rgb(254, 235, 66, 0.3));
		ds.setOffsetX(5);
		ds.setOffsetY(5);
		ds.setRadius(5);
		ds.setSpread(0.2);

		blend.setBottomInput(ds);

		DropShadow ds1 = new DropShadow();
		ds1.setColor(Color.web("#d68268")); // #d68268 is pinkish orange//f13a00"));
		ds1.setRadius(20);
		ds1.setSpread(0.2);

		Blend blend2 = new Blend();
		blend2.setMode(BlendMode.MULTIPLY);

		InnerShadow is = new InnerShadow();
		is.setColor(Color.web("#feeb42")); // #feeb42 is mid-pale yellow
		is.setRadius(9);
		is.setChoke(0.8);
		blend2.setBottomInput(is);

		InnerShadow is1 = new InnerShadow();
		is1.setColor(Color.web("#278206")); // # f13a00 is bright red // 278206 is dark green
		is1.setRadius(5);
		is1.setChoke(0.4);
		blend2.setTopInput(is1);

		Blend blend1 = new Blend();
		blend1.setMode(BlendMode.MULTIPLY);
		blend1.setBottomInput(ds1);
		blend1.setTopInput(blend2);

		blend.setTopInput(blend1);
	}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:42,代码来源:MainScene.java


示例13: HasLocationPortrait

import javafx.scene.effect.Blend; //导入依赖的package包/类
protected HasLocationPortrait(EconomicAgent agent, DoubleProperty xLocationProperty,
                              DoubleProperty yLocationProperty)
{
    this.agent =agent;
    this.xLocationProperty = xLocationProperty;
    this.yLocationProperty = yLocationProperty;

    nodeDelegate = new GUINodeSimple();

    //load the image
    icon = new ImageView();
    icon.setImage(initImage(agent));
    this.getChildren().add(icon);
    //bind icon height to pref-height. The idea here is that when they resize this region, we resize the location portrait as well
    icon.fitWidthProperty().bind(prefWidthProperty());
    icon.fitHeightProperty().bind(prefHeightProperty());


    //this is to keep it with the right color
    ColorAdjust monochrome = new ColorAdjust(); //this is the first effect
    //monochrome.setBrightness(-1.0);
    //keep the color
    color= new SimpleObjectProperty<>(Color.BLACK);


    ColorInput input = new ColorInput(); //this is the second effect, the coloring proper
    input.setX(0); input.setY(0);
    input.widthProperty().bind(prefWidthProperty());
    input.heightProperty().bind(prefHeightProperty());

    input.paintProperty().bind(color);

    //bind the color adjust
    Blend coloring = new Blend(BlendMode.SRC_ATOP,monochrome,input);
    icon.effectProperty().setValue(coloring);

    setCache(true);
    setCacheHint(CacheHint.SPEED);


    //now set the text
    priceText = new Text();
    this.getChildren().add(priceText );
    priceText.setFont(Font.font("Verdana", 10));

    priceText.setFill(Color.BLACK);



}
 
开发者ID:CarrKnight,项目名称:MacroIIDiscrete,代码行数:51,代码来源:HasLocationPortrait.java



注:本文中的javafx.scene.effect.Blend类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SQLiteDataSource类代码示例发布时间:2022-05-22
下一篇:
Java QuorumCall类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap