当前位置: 首页>>代码示例>>Java>>正文


Java CycleMethod.REFLECT属性代码示例

本文整理汇总了Java中javafx.scene.paint.CycleMethod.REFLECT属性的典型用法代码示例。如果您正苦于以下问题:Java CycleMethod.REFLECT属性的具体用法?Java CycleMethod.REFLECT怎么用?Java CycleMethod.REFLECT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javafx.scene.paint.CycleMethod的用法示例。


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

示例1: changeGradient2Color

private void changeGradient2Color(int index, Color color)
{
	if (index == 0)
	{
		stopsInner[index] = new Stop (0, color);
	} else if (index == 1)
	{
		stopsInner[index] = new Stop (.1, color);
	} else if (index == 2)
	{
		stopsInner[index] = new Stop (.8, color);
	} else if (index == 3)
	{
		stopsInner[index] = new Stop (1, color);
	}
	// reset the gradient containing the given color
	lg2 = new LinearGradient (0, 0, 0, .5, true, CycleMethod.REFLECT,
			stopsInner);
}
 
开发者ID:entitycs,项目名称:AudioVisualizer2.0,代码行数:19,代码来源:RenderTestVis2Frame.java

示例2: LinearGradientSample

public LinearGradientSample() {
    //First rectangle
    Rectangle rect1 = new Rectangle(0,0,80,80);

    //create simple linear gradient
    LinearGradient gradient1 = new LinearGradient(0, 0, 1, 0, true, CycleMethod.NO_CYCLE, new Stop[] {
        new Stop(0, Color.DODGERBLUE),
        new Stop(1, Color.BLACK)
    });

    //set rectangle fill
    rect1.setFill(gradient1);

    // Second rectangle
    Rectangle rect2 = new Rectangle(0,0,80,80);

    //create complex linear gradient
    LinearGradient gradient2 = new LinearGradient(0, 0, 0, 0.5,  true, CycleMethod.REFLECT, new Stop[] {
        new Stop(0, Color.DODGERBLUE),
        new Stop(0.1, Color.BLACK),
        new Stop(1, Color.DODGERBLUE)
    });

    //set rectangle fill
    rect2.setFill(gradient2);

    // show the rectangles
    HBox hb = new HBox(10);
    hb.getChildren().addAll(rect1, rect2);
    getChildren().add(hb);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:31,代码来源:LinearGradientSample.java

示例3: drawNode

@Override
        public Node drawNode() {
            Group group = new Group();
            Rectangle rect = new Rectangle(0, 0, 90, 60);
            LinearGradient lg = new LinearGradient(
                0, 0, 0.25f, 0.25f, true, CycleMethod.REFLECT,
                new Stop[] { new Stop(0, Color.RED), new Stop(1, Color.YELLOW) }
            );
            rect.setFill(lg);
            group.getChildren().add(rect);
            Text text = new Text("XYZ");
            text.setX(5);
            text.setY(50);
            text.setFill(Color.BLUE);
            setFontViaCss(text, 40);
            //text.setFont(Font.font("Arial", FontWeight.BOLD, 40));
//            text.setEffect(new Blend() {{
//                            //setMode(BlendMode.SRC_OUT); see http://javafx-jira.kenai.com/browse/RT-15041
//                            setTopInput(new ColorInput(5, 5, 80, 80, Color.GREEN) {{
//                                    setPaint(Color.GREEN);
//                                    setX(5);
//                                    setY(5);
//                                    setWidth(80); // TODO (SLOTSIZEX - 10);
//                                    setHeight(80); // (SLOTSIZEY - 10);
//                                }
//                            });
//                        }
//                    });
            text.setEffect(new Blend(BlendMode.SRC_OVER, null, new ColorInput(5, 5, 80, 80, Color.GREEN)));
            group.getChildren().add(text);
            return group;
        }
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:32,代码来源:Effects2App.java

示例4: changeGradient1Color

private void changeGradient1Color(int index, Color color)
{
	if (index == 0)
	{
		stops[0] = new Stop (0.0, color);
	} else if (index == 1)
	{
		stops[1] = new Stop (1.0, color);
	}
	// reset the gradient containing the given color
	lg1 = new LinearGradient (0, 0, 0, .5, true, CycleMethod.REFLECT, stops);
}
 
开发者ID:entitycs,项目名称:AudioVisualizer2.0,代码行数:12,代码来源:RenderTestVis2Frame.java

示例5: getToDayControl

public Group getToDayControl(){
    String[] months = {"Jan", "Feb","Mar", "Apr", "May",          "Jun", "Jul","Aug", "Sep", "Oct", "Nov","Dec"};
    Calendar cal =  Calendar.getInstance();
 
    Group ctrl = new Group();
    Rectangle rect = new Rectangle();
    rect.setWidth(WIDTH);
    rect.setHeight(HEIGHT);
    rect.setArcHeight(10.0);
    rect.setArcWidth(10.0);
 
    Rectangle headerRect = new Rectangle();
    headerRect.setWidth(WIDTH);
    headerRect.setHeight(30);
    headerRect.setArcHeight(10.0);
    headerRect.setArcWidth(10.0);
 
    Stop[] stops = new Stop[] { new Stop(0, Color.color(0.31, 0.31, 0.31, 0.443)), new Stop(1,  Color.color(0, 0, 0, 0.737))};
    LinearGradient lg = new LinearGradient( 0.482, -0.017, 0.518, 1.017, true, CycleMethod.REFLECT, stops);
    headerRect.setFill(lg);
 
    Rectangle footerRect = new Rectangle();
    footerRect.setY(headerRect.getBoundsInLocal().getHeight() -4);
    footerRect.setWidth(WIDTH);
    footerRect.setHeight(125);
    footerRect.setFill(Color.color(0.51,  0.671,  0.992));
 
    final Text currentMon = new Text(months[(cal.get(Calendar.MONTH) )]);
    currentMon.setFont(Font.font("null", FontWeight.BOLD, 24));
    currentMon.setTranslateX((footerRect.getBoundsInLocal().getWidth() - currentMon.getBoundsInLocal().getWidth())/2.0);
    currentMon.setTranslateY(23);
    currentMon.setFill(Color.WHITE);
 
    final Text currentDate = new          Text(Integer.toString(cal.get(Calendar.DATE)));
    currentDate.setFont(new Font(100.0));
    currentDate.setTranslateX((footerRect.getBoundsInLocal().getWidth() - currentDate.getBoundsInLocal().getWidth())/2.0);
    currentDate.setTranslateY(120);
    currentDate.setFill(Color.WHITE);
 
    ctrl.getChildren().addAll(rect, headerRect, footerRect , currentMon,currentDate);
 
    DropShadow ds = new DropShadow();
    ds.setOffsetY(3.0);
    ds.setOffsetX(3.0);
    ds.setColor(Color.GRAY);
    ctrl.setEffect(ds);
 
    return ctrl;
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:49,代码来源:TodaysDateWiget.java

示例6: getToDayControl

public Group getToDayControl(){
	String[] months = {"Jan", "Feb","Mar", "Apr", "May",          "Jun", "Jul","Aug", "Sep", "Oct", "Nov","Dec"};
	Calendar cal =  Calendar.getInstance();

	Group ctrl = new Group();
	Rectangle rect = new Rectangle();
	rect.setWidth(WIDTH);
	rect.setHeight(HEIGHT);
	rect.setArcHeight(10.0);
	rect.setArcWidth(10.0);

	Rectangle headerRect = new Rectangle();
	headerRect.setWidth(WIDTH);
	headerRect.setHeight(30);
	headerRect.setArcHeight(10.0);
	headerRect.setArcWidth(10.0);

	Stop[] stops = new Stop[] { new Stop(0, Color.color(0.31, 0.31, 0.31, 0.443)), new Stop(1,  Color.color(0, 0, 0, 0.737))};
	LinearGradient lg = new LinearGradient( 0.482, -0.017, 0.518, 1.017, true, CycleMethod.REFLECT, stops);
	headerRect.setFill(lg);

	Rectangle footerRect = new Rectangle();
	footerRect.setY(headerRect.getBoundsInLocal().getHeight() -4);
	footerRect.setWidth(WIDTH);
	footerRect.setHeight(125);
	footerRect.setFill(Color.color(0.51,  0.671,  0.992));

	final Text currentMon = new Text(months[(cal.get(Calendar.MONTH) )]);
	currentMon.setFont(Font.font("null", FontWeight.BOLD, 24));
	currentMon.setTranslateX((footerRect.getBoundsInLocal().getWidth() - currentMon.getBoundsInLocal().getWidth())/2.0);
	currentMon.setTranslateY(23);
	currentMon.setFill(Color.WHITE);

	final Text currentDate = new          Text(Integer.toString(cal.get(Calendar.DATE)));
	currentDate.setFont(new Font(100.0));
	currentDate.setTranslateX((footerRect.getBoundsInLocal().getWidth() - currentDate.getBoundsInLocal().getWidth())/2.0);
	currentDate.setTranslateY(120);
	currentDate.setFill(Color.WHITE);

	ctrl.getChildren().addAll(rect, headerRect, footerRect , currentMon,currentDate);

	DropShadow ds = new DropShadow();
	ds.setOffsetY(3.0);
	ds.setOffsetX(3.0);
	ds.setColor(Color.GRAY);
	ctrl.setEffect(ds);

	return ctrl;
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:49,代码来源:TodaysDateWiget.java


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