本文整理匯總了Java中javafx.scene.paint.CycleMethod.NO_CYCLE屬性的典型用法代碼示例。如果您正苦於以下問題:Java CycleMethod.NO_CYCLE屬性的具體用法?Java CycleMethod.NO_CYCLE怎麽用?Java CycleMethod.NO_CYCLE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類javafx.scene.paint.CycleMethod
的用法示例。
在下文中一共展示了CycleMethod.NO_CYCLE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: RadialGradientSample
public RadialGradientSample() {
//create simple radial gradient
RadialGradient gradient1 = new RadialGradient(0, 0, 0.5, 0.5, 1, true, CycleMethod.NO_CYCLE, new Stop[] {
new Stop(0, Color.DODGERBLUE),
new Stop(1, Color.BLACK)
});
Circle circle1 = new Circle(45, 45, 40, gradient1);
//create complex radial gradient
RadialGradient gradient2 = new RadialGradient(20, 1, 0.5, 0.5, 0.6, true, CycleMethod.NO_CYCLE, new Stop[] {
new Stop(0, Color.TRANSPARENT),
new Stop(0.5, Color.DARKGRAY),
new Stop(0.64, Color.WHITESMOKE),
new Stop(0.65, Color.YELLOW),
new Stop(1, Color.GOLD)
});
Circle circle2 = new Circle(145, 45, 40, gradient2);
HBox hb = new HBox(10);
hb.getChildren().addAll(circle1, circle2);
// show the circles
getChildren().addAll(hb);
}
示例2: draw
private void draw(final int LIMIT, final double RESOLUTION) {
int limit = LIMIT > points.size() ? points.size() : LIMIT + 1;
double pixelSize = 2 * RESOLUTION;
ctx.clearRect(0, 0, width, height);
for (double y = 0 ; y < height ; y += RESOLUTION) {
for (double x = 0 ; x < width ; x += RESOLUTION) {
double value = getValueAt(limit, x, y);
if (value != -255) {
Color color = getUseColorMapping() ? getColorForValue(value) : getColorForValue(value, isDiscreteColors());
RadialGradient gradient = new RadialGradient(0, 0, x, y, RESOLUTION,
false, CycleMethod.NO_CYCLE,
new Stop(0, Color.color(color.getRed(), color.getGreen(), color.getBlue(), getHeatMapOpacity())),
new Stop(1, Color.color(color.getRed(), color.getGreen(), color.getBlue(), 0.0)));
ctx.setFill(gradient);
ctx.fillOval(x - RESOLUTION, y - RESOLUTION, pixelSize, pixelSize);
}
}
}
}
示例3: initBackground
private void initBackground() {
Rectangle bg0 = new Rectangle(getWidth(), getHeight(),
new LinearGradient(getWidth() / 2, 0, getWidth() / 2, getHeight(),
false, CycleMethod.NO_CYCLE,
new Stop(0.2, Color.AQUA), new Stop(0.8, Color.BLACK)));
Rectangle bg1 = new Rectangle(getWidth(), getHeight(), Color.color(0, 0, 0, 0.2));
bg1.setBlendMode(BlendMode.DARKEN);
EntityView bg = new EntityView(RenderLayer.BACKGROUND);
bg.addNode(bg0);
bg.addNode(bg1);
// we add IrremovableComponent because regardless of the level
// the background and screen bounds stay in the game world
Entities.builder()
.viewFromNode(bg)
.with(new IrremovableComponent())
.buildAndAttach(getGameWorld());
Entity screenBounds = Entities.makeScreenBounds(40);
screenBounds.addComponent(new IrremovableComponent());
getGameWorld().addEntity(screenBounds);
}
示例4: createTopHighlightBorder
private void createTopHighlightBorder() {
Stop[] stops = new Stop[] {
new Stop(0, Color.WHITE),
new Stop(.3, Color.LIGHTGRAY),
new Stop(1, Color.TRANSPARENT)
};
LinearGradient lg1 = new LinearGradient(0, 0, 0, 1, true, CycleMethod.NO_CYCLE, stops);
topHighlightBorder =
new Border(new BorderStroke(
lg1, null, null, null,
BorderStrokeStyle.SOLID, BorderStrokeStyle.NONE, BorderStrokeStyle.NONE, BorderStrokeStyle.NONE,
CornerRadii.EMPTY,
new BorderWidths( 8.0d ),
null
));
}
示例5: createAlphaMaskedBall
/**
* Create an alpha masked ball with gradient colors from White to Black/Transparent. Used e. g. for particles.
* May only be visible when you have a background other than white, ie use black
*
* @param radius
* @return
*/
public static Node createAlphaMaskedBall( double radius) {
Circle ball = new Circle(radius);
RadialGradient gradient1 = new RadialGradient(0,
.1,
0,
0,
radius,
false,
CycleMethod.NO_CYCLE,
new Stop(0, Color.WHITE.deriveColor(1,1,1,1)),
new Stop(1, Color.BLACK.deriveColor(1,1,1,0)));
ball.setFill(gradient1);
return ball;
}
示例6: drawLeftImage
protected void drawLeftImage() {
AnchorPane pane = new AnchorPane();
pane.setPrefWidth(187);
Stop[] stops = new Stop[] { new Stop(0, Color.web("#3c79b2")), new Stop(1, Color.web("#2d5d8b")) };
RadialGradient gradient = new RadialGradient(0, 0, 0.5, 0.5, 1, true, CycleMethod.NO_CYCLE, stops);
Background background = new Background(new BackgroundFill(gradient, null, null));
pane.setBackground(background);
Text text = new Text(this.parent.getLeftImageText());
text.setFill(Color.WHITE);
text.setFont(Font.font("Maven Pro", 50));
text.setRotate(-90);
pane.setPadding(new Insets(-50));
pane.getChildren().add(text);
AnchorPane.setBottomAnchor(text, 160.0);
AnchorPane.setRightAnchor(text, -40.0);
getParent().getRoot().setLeft(pane);
}
示例7: addMenuItem
public void addMenuItem(final String iconPath,
final EventHandler<MouseEvent> eventHandler) {
final RadialGradient backGradient = new RadialGradient(0, 0, 0, 0,
radius.get(), false, CycleMethod.NO_CYCLE, new Stop(0,
BACK_GRADIENT_COLOR), new Stop(1, Color.TRANSPARENT));
final RadialGradient backSelectGradient = new RadialGradient(0, 0, 0,
0, radius.get(), false, CycleMethod.NO_CYCLE, new Stop(0,
BACK_SELECT_GRADIENT_COLOR), new Stop(1,
Color.TRANSPARENT));
final RadialMenuItem item = RadialMenuItemBuilder.create()
.length(length).graphic(new Group(getImageView(iconPath)))
.backgroundFill(backGradient)
.backgroundMouseOnFill(backSelectGradient)
.innerRadius(innerRadius).radius(radius).offset(offset)
.clockwise(true).backgroundVisible(true).strokeVisible(false)
.build();
item.setOnMouseClicked(eventHandler);
items.add(item);
itemsContainer.getChildren().addAll(item);
}
示例8: buildHueBar
private LinearGradient buildHueBar() {
double offset;
Stop[] stops = new Stop[255];
for (int y = 0; y < 255; y++) {
offset = (double) (1.0 / 255) * y;
int h = (int)((y / 255.0) * 360);
stops[y] = new Stop(offset, Color.hsb(h, 1.0, 1.0));
}
return new LinearGradient(0f, 0f, 1f, 0f, true, CycleMethod.NO_CYCLE, stops);
}
示例9: 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);
}
示例10: createIconContent
public static Node createIconContent() {
Rectangle rect = new Rectangle(80,80,new LinearGradient(0, 0, 1, 0, true, CycleMethod.NO_CYCLE, new Stop[] {
new Stop(0, Color.rgb(156,216,255)),
new Stop(0.5, Color.DODGERBLUE),
new Stop(1, Color.rgb(0,70,140))
}));
rect.setArcWidth(20);
rect.setArcHeight(20);
return rect;
}
示例11: createIconContent
public static Node createIconContent() {
Rectangle rect = new Rectangle(80,80,new RadialGradient(0, 0, 0.5, 0.5, 1, true, CycleMethod.NO_CYCLE, new Stop[] {
new Stop(0, Color.rgb(156,216,255)),
new Stop(0.5, Color.DODGERBLUE),
new Stop(1, Color.rgb(0,70,140))
}));
rect.setArcWidth(20);
rect.setArcHeight(20);
return rect;
}
示例12: createIconContent
public static Node createIconContent() {
double offset;
Stop[] stops = new Stop[255];
for (int y = 0; y < 255; y++) {
offset = (double) (1.0 / 255) * y;
int h = (int)((y / 255.0) * 360);
stops[y] = new Stop(offset, Color.hsb(h, 0.8, 0.9));
}
Rectangle rect = new Rectangle(80,80,
new LinearGradient(0f, 0f, 1f, 1f, true, CycleMethod.NO_CYCLE, stops));
rect.setArcWidth(20);
rect.setArcHeight(20);
return rect;
}
示例13: createHueGradient
private static LinearGradient createHueGradient() {
final Stop[] stops = new Stop[255];
for (int x = 0; x < 255; x++) {
final double offset = (1.0 / 255.0) * x;
final int hue = (int)((x / 255.0) * 360);
stops[x] = new Stop(offset, Color.hsb(hue, 1.0, 1.0));
}
return new LinearGradient(0f, 0f, 1f, 0f, true, CycleMethod.NO_CYCLE, stops);
}
示例14: createColorVariationGradient
public static final LinearGradient createColorVariationGradient(final Color COLOR, final int NO_OF_COLORS) {
List<Color> colorVariations = createColorVariations(COLOR, NO_OF_COLORS);
List<Stop> stops = new ArrayList<>(NO_OF_COLORS);
double step = 1.0 / NO_OF_COLORS;
for (int i = 0 ; i < NO_OF_COLORS ; i++) {
stops.add(new Stop(i * step, colorVariations.get(i)));
}
return new LinearGradient(0, 0, 1, 0, true, CycleMethod.NO_CYCLE, stops);
}
示例15: init
@Override public void init() {
List<YChartItem> item1 = new ArrayList<>(ELEMENTS);
List<YChartItem> item2 = new ArrayList<>(ELEMENTS);
List<YChartItem> item3 = new ArrayList<>(ELEMENTS);
for (int i = 0 ; i < ELEMENTS ; i++) {
YChartItem dataPoint;
dataPoint = new YChartItem(RND.nextDouble() * 100, "P" + i);
item1.add(dataPoint);
dataPoint = new YChartItem(RND.nextDouble() * 100, "P" + i);
item2.add(dataPoint);
dataPoint = new YChartItem(RND.nextDouble() * 100, "P" + i);
item3.add(dataPoint);
}
series1 = new YSeries(item3, CHART_TYPE, new RadialGradient(0, 0, 0, 0, 1, true, CycleMethod.NO_CYCLE, new Stop(0.0, Color.rgb(0, 255, 255, 0.25)), new Stop(0.5, Color.rgb(255, 255, 0, 0.5)), new Stop(1.0, Color.rgb(255, 0, 255, 0.75))), Color.TRANSPARENT);
series2 = new YSeries(item1, CHART_TYPE, new RadialGradient(0, 0, 0, 0, 1, true, CycleMethod.NO_CYCLE, new Stop(0.0, Color.rgb(255, 0, 0, 0.25)), new Stop(0.5, Color.rgb(255, 255, 0, 0.5)), new Stop(1.0, Color.rgb(0, 200, 0, 0.75))), Color.TRANSPARENT);
series3 = new YSeries(item2, CHART_TYPE, new RadialGradient(0, 0, 0, 0, 1, true, CycleMethod.NO_CYCLE, new Stop(0.0, Color.rgb(0, 255, 255, 0.25)), new Stop(0.5, Color.rgb(0, 255, 255, 0.5)), new Stop(1.0, Color.rgb(0, 0, 255, 0.75))), Color.TRANSPARENT);
chart = new YChart(new YPane(series1, series2, series3));
chart.setPrefSize(600, 600);
timeline = new Timeline();
lastTimerCall = System.nanoTime();
timer = new AnimationTimer() {
@Override public void handle(final long now) {
if (now > lastTimerCall + INTERVAL) {
animateData();
long delta = System.nanoTime() - now;
timeline.play();
lastTimerCall = now + delta;
}
}
};
registerListener();
}