本文整理汇总了Java中javafx.scene.shape.Circle.setStrokeWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Circle.setStrokeWidth方法的具体用法?Java Circle.setStrokeWidth怎么用?Java Circle.setStrokeWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Circle
的用法示例。
在下文中一共展示了Circle.setStrokeWidth方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderPoints
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private void renderPoints(){
for(int i = 0; i<points.size(); i++){
Circle c = new Circle(points.get(i).getX(), points.get(i).getY(),circleStyle.getRadius(), circleStyle.getFill());
c.setStroke(circleStyle.getStroke());
c.setStrokeWidth(circleStyle.getStrokeWidth());
c.setStrokeType(circleStyle.getStrokeType());
c.setStrokeLineJoin(circleStyle.getStrokeLineJoin());
c.setStrokeLineCap(circleStyle.getStrokeLineCap());
c.setStyle(circleStyle.getStyle());
pointDots.getChildren().add(c);
}
}
示例2: configureBackground
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private void configureBackground() {
ImageView imageView = new ImageView();
Image image = loadImage();
imageView.setImage(image);
Circle circle1 = new Circle();
circle1.setCenterX(140);
circle1.setCenterY(140);
circle1.setRadius(120);
circle1.setFill(Color.TRANSPARENT);
circle1.setStroke(Color.web("#0A0A0A"));
circle1.setStrokeWidth(0.3);
Circle circle2 = new Circle();
circle2.setCenterX(140);
circle2.setCenterY(140);
circle2.setRadius(118);
circle2.setFill(Color.TRANSPARENT);
circle2.setStroke(Color.web("#0A0A0A"));
circle2.setStrokeWidth(0.3);
Circle circle3 = new Circle();
circle3.setCenterX(140);
circle3.setCenterY(140);
circle3.setRadius(140);
circle3.setFill(Color.TRANSPARENT);
circle3.setStroke(Color.web("#818a89"));
circle3.setStrokeWidth(1);
Ellipse ellipse = new Ellipse(140, 95, 180, 95);
Circle ellipseClip = new Circle(140, 140, 140);
ellipse.setFill(Color.web("#535450"));
ellipse.setStrokeWidth(0);
GaussianBlur ellipseEffect = new GaussianBlur();
ellipseEffect.setRadius(10);
ellipse.setEffect(ellipseEffect);
ellipse.setOpacity(0.1);
ellipse.setClip(ellipseClip);
background.getChildren().addAll(imageView, circle1, circle2, circle3, ellipse);
}
示例3: createIconContent
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public static Node createIconContent() {
Circle circle = new Circle(57,57,40);
circle.setStroke(Color.web("#b9c0c5"));
circle.setStrokeWidth(5);
circle.getStrokeDashArray().addAll(15d,15d);
circle.setFill(null);
javafx.scene.effect.InnerShadow effect = new javafx.scene.effect.InnerShadow();
effect.setOffsetX(1);
effect.setOffsetY(1);
effect.setRadius(3);
effect.setColor(Color.rgb(0,0,0,0.6));
circle.setEffect(effect);
return circle;
}
示例4: InteractiveWayPointDot
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public InteractiveWayPointDot(int x, int y) throws FlightZoneException{
wayPointDot = new Circle();
wayPointDot.setRadius(radius);;
wayPointDot.setCenterX(x);
wayPointDot.setCenterY(y);
wayPointDot.setFill(Color.LIGHTSTEELBLUE);
wayPointDot.setStroke(Color.BLACK);
wayPointDot.setStrokeWidth(1);
longitude = DecimalDegreesToXYConverter.getInstance().ConvertXCoordsToDecimalDegrees(x);
latitude = DecimalDegreesToXYConverter.getInstance().ConvertYCoordsToDecimalDegrees(y);
this.x = x;
this.y = y;
}
示例5: DroneBase
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
/**
* Constructor
* @param baseName Unique basename
* @param latitude of base
* @param longitude of base
* @param altitude of base
* @throws FlightZoneException
*/
public DroneBase(String baseName, long lat, long lon, int alt, int radius) throws FlightZoneException{
basePosition = new Coordinates(lat,lon,alt);
coordTransform = DecimalDegreesToXYConverter.getInstance();
this.baseName = baseName;
circle = new Circle();
circle.setRadius(radius);
Point point = coordTransform.getPoint(lat, lon);
circle.setCenterX(point.getX()+radius*.6);
circle.setCenterY(point.getY()+radius*.6);
circle.setFill(Color.LIGHTYELLOW);
circle.setStroke(Color.BLACK);
circle.setStrokeWidth(1);
}
示例6: createIOButton
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
/**
* Sets the appearance of an IO button.
* @return Returns an I/O button.
*/
public Circle createIOButton(){
Circle channel = new Circle(5.0f);
channel.setFill(Paint.valueOf(BACKGROUND_COLOR));
channel.setStroke(Paint.valueOf(FOREGROUND_COLOR));
channel.setStrokeWidth(2.0f);
channel.setLayoutY(getMinHeight()/2);
channel.setEffect( new DropShadow() );
return channel;
}
示例7: start
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
Group root = new Group();
Line seeSaw = new Line (60,340,340,140);
seeSaw.setStroke(Color.BLACK);
seeSaw.setStrokeWidth(15);
Circle circle = new Circle(70,280,40);
circle.setStroke(Color.GREENYELLOW);
circle.setFill(Color.ORANGE);
circle.setStrokeWidth(5);
Rectangle rect = new Rectangle(240,90,80,70);
rect.setStroke(Color.MEDIUMPURPLE);
rect.setStrokeWidth(5);
rect.setFill(Color.MEDIUMPURPLE);
Line left = new Line (200,240,160,340);
left.setStrokeWidth(5);
Line right = new Line(200,240,240,340);
right.setStrokeWidth(5);
root.getChildren().addAll(seeSaw,rect,circle,left,right);
Scene scene = new Scene(root, 400, 400,Color.WHITE);
primaryStage.setTitle("SeeSaw");
primaryStage.setScene(scene);
primaryStage.show();
}
示例8: createPiece
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public Node createPiece(int piece, int column, int row) {
Group group = new Group();
// A quick hack to ensure all have equal size.
Rectangle transparent = new Rectangle(0, 0, 160, 160);
transparent.setFill(Color.TRANSPARENT);
group.getChildren().add(transparent);
switch (piece) {
case 0:
Line line1 = new Line(30, 30, 130, 130);
line1.setStrokeWidth(5);
Line line2 = new Line(30, 130, 130, 30);
line2.setStrokeWidth(5);
group.getChildren().addAll(line1, line2);
break;
case 1:
Circle white = new Circle(80, 80, 60);
white.setStroke(Color.BLACK);
white.setStrokeWidth(5);
white.setFill(Color.TRANSPARENT);
group.getChildren().add(white);
break;
}
return group;
}
示例9: createPiece
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public Node createPiece(int piece, int column, int row) {
StackPane pane = new StackPane();
Rectangle background = new Rectangle(0, 0, 60, 60);
background.setFill(((column + row) % 2) == 0 ? Color.WHITE : Color.GRAY);
pane.getChildren().add(background);
if (piece >=0 && piece < 8) {
Circle circle = new Circle(30, 30, 25);
if (piece / 4 == 1) {
circle.setStrokeWidth(3);
} else {
circle.setStrokeWidth(0);
}
if ((piece % 4) / 2 == 0) {
circle.setFill(Color.WHITE);
circle.setStroke(Color.BLACK);
} else {
circle.setFill(Color.BLACK);
circle.setStroke(Color.WHITE);
}
pane.getChildren().add(circle);
if ((piece % 4) % 2 == 1) {
Text text = new Text("♔");
text.setFont(new Font(32));
text.setFill(((piece % 4) / 2 == 0) ? Color.BLACK : Color.WHITE);
text.setBoundsType(TextBoundsType.VISUAL);
pane.getChildren().add(text);
}
}
return pane;
}
示例10: createCircle
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
/**
* Ritorna il cerchio che racchiuderà l'indice del nodo
* @return cerchio che indicherà il nodo.
*/
private Circle createCircle() {
Circle c = new Circle();
c.setFill((Color) currentPane.getBackground().getFills().get(0).getFill());
c.setStroke(Color.BLACK);
c.setStrokeWidth(3);
c.setRadius(Singleton.NODE_RADIUS);
return c;
}
示例11: start
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
if (stage == null) {
return;
}
Rectangle clipRect1 = new Rectangle(-130, -130, 115, 115);
Rectangle clipRect2 = new Rectangle(15, -130, 115, 115);
Rectangle clipRect3 = new Rectangle(-130, 15, 115, 115);
Rectangle clipRect4 = new Rectangle(15, 15, 115, 115);
Group clip = new Group(clipRect1, clipRect2, clipRect3, clipRect4);
Circle spinnanCircle = new Circle(100);
spinnanCircle.setFill(null);
spinnanCircle.setStrokeWidth(30);
spinnanCircle.setStroke(LTTNG_PURPLE);
spinnanCircle.setClip(clip);
Circle magCircle = new Circle(60);
magCircle.setFill(null);
magCircle.setStrokeWidth(25);
magCircle.setStroke(LTTNG_LIGHT_BLUE);
Rectangle magHandle = new Rectangle(-12.5, 60, 25, 110);
magHandle.setFill(LTTNG_LIGHT_BLUE);
Group mag = new Group(magCircle, magHandle);
Group root = new Group(spinnanCircle, mag);
root.setRotate(30);
root.relocate(0, 0);
Pane pane = new Pane(root);
pane.setStyle(BACKGROUND_STYLE);
RotateTransition spinnan = new RotateTransition(Duration.seconds(4), spinnanCircle);
spinnan.setByAngle(360);
spinnan.setCycleCount(Animation.INDEFINITE);
spinnan.setInterpolator(Interpolator.LINEAR);
Scene scene = new Scene(pane);
stage.setScene(scene);
stage.show();
spinnan.play();
}
示例12: initialize
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
@Override
public void initialize(URL location, ResourceBundle resources) {
backgroundImageView.setMouseTransparent(true);
movieList.setCellFactory(c -> new MovieListCell());
movieList.setItems(model.getMovies());
movieList.setCacheHint(CacheHint.SPEED);
model.selectedMovieProperty().bind(movieList.getSelectionModel().selectedItemProperty());
model.selectedMovieProperty().addListener((obs, oldVal, newVal) -> updateDetailArea());
detailView.visibleProperty().bind(model.selectedMovieProperty().isNotNull());
maximizeAppIconView.setOnMouseClicked(e -> ((Stage) rootPane.getScene().getWindow()).setFullScreen(!((Stage) rootPane.getScene().getWindow()).isFullScreen()));
closeAppIconView.setOnMouseClicked(e -> rootPane.getScene().getWindow().hide());
moviePosterWrapper.setRotationAxis(new Point3D(0, 1, 0));
moviePosterWrapper.setCache(true);
moviePosterWrapper.setCacheShape(true);
moviePosterWrapper.setCacheHint(CacheHint.SPEED);
posterImageView.setCache(true);
posterImageView.setCacheHint(CacheHint.SPEED);
Util.installWindowDragListener(rootPane);
final ChangeListener backgroundImageResizeListener = (obs, oldVal, newVal) -> {
final Image image = backgroundImageView.getImage();
if (backgroundImageView.getImage() != null) {
Dimension2D backgroundDimension = shouldFitIn(image.getWidth(), image.getHeight(), rootPane.getWidth(), rootPane.getHeight());
backgroundImageView.setFitWidth(backgroundDimension.getWidth());
backgroundImageView.setFitHeight(backgroundDimension.getHeight());
}
};
rootPane.widthProperty().addListener(backgroundImageResizeListener);
rootPane.heightProperty().addListener(backgroundImageResizeListener);
backgroundImageView.imageProperty().addListener(backgroundImageResizeListener);
addFeatureSupport();
updateDetailArea();
watchTrailerButton.setOnAction(e -> playTrailer());
mediaView.fitWidthProperty().bind(rootPane.widthProperty().subtract(64.0));
mediaStateIcon = new AnimatedIcon();
mediaStateIcon.setOpacity(0.6);
mediaStateIcon.setScaleX(4.0);
mediaStateIcon.setScaleY(4.0);
mediaStateIcon.setMouseTransparent(true);
mediaStateIcon.toPause();
Circle circle = new Circle();
circle.setMouseTransparent(true);
circle.setRadius(76);
circle.setStroke(Color.ORANGE);
circle.setStrokeWidth(8);
circle.setOpacity(0.6);
StackPane mediaControl = new StackPane(circle, mediaStateIcon);
mediaControl.setMouseTransparent(true);
mediaControl.setMinWidth(USE_PREF_SIZE);
mediaControl.setMinHeight(USE_PREF_SIZE);
mediaControl.setMaxWidth(USE_PREF_SIZE);
mediaControl.setMaxHeight(USE_PREF_SIZE);
mediaControl.setVisible(false);
mediaPane.getChildren().addAll(mediaControl);
//TODO: Animation
mediaView.setOnMouseEntered(e -> mediaControl.setVisible(true));
mediaView.setOnMouseExited(e -> mediaControl.setVisible(false));
movieList.getSelectionModel().select(0);
rootPane.setOnKeyPressed(evt -> {
if (evt.getCode().equals(KeyCode.ESCAPE)) {
stopTrailer();
}
});
}