當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。