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

Java StrokeType类代码示例

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

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



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

示例1: CycleView

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
public CycleView(final List<Node> nodes, final int cycleIndex, final double hueInterval) {
	Paint p = Color.hsb(cycleIndex * hueInterval, 0.75, 0.70, 0.25);
	setFill(p);
	setStroke(p);
	setStrokeWidth(20);
	setStrokeLineJoin(StrokeLineJoin.ROUND);
	setStrokeType(StrokeType.OUTSIDE);
	updateHull(nodes, HULL_ALGORITHM);
	final ChangeListener<Number> listener = (_0, _1, _2) -> {
		updateHull(nodes, HULL_ALGORITHM);
	};
	for (Node n : nodes) {
		n.translateXProperty().addListener(listener);
		n.translateYProperty().addListener(listener);
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:17,代码来源:CycleView.java


示例2: drawNode

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
@Override
public Node drawNode() {
    currentTestNode = this;
    StrokeTransition transition = new StrokeTransition(Duration.millis(typicalDuration), circle);
    Pane p = pre(transition);
    circle.setStrokeWidth(20);
    circle.setStrokeType(StrokeType.OUTSIDE);


    transition.setFromValue(dFrom);
    transition.setToValue(dTo);

    if (dFrom != transition.getFromValue()) {
        reportGetterFailure("getFrom()");
    }
    if (dTo != transition.getToValue()) {
        reportGetterFailure("getTo()");
    }

    transition.setCycleCount(2);
    transition.setAutoReverse(true);

    return p;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:25,代码来源:AnimationTransitionApp.java


示例3: createHandlers

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
private void createHandlers(GroupEntity rect) {
	// Rotate Handler
	rotateHandle.setStrokeWidth(1);
	rotateHandle.setStrokeType(StrokeType.INSIDE);
	rotateHandle.setStroke(Color.BLUE);
	// Move Handle
	moveHandle.setStrokeWidth(1);
	moveHandle.setStrokeType(StrokeType.OUTSIDE);
	moveHandle.setStroke(Color.WHITE);
	// Resize Handler Left-Width
	resizeHandleLeft.setStrokeWidth(1);
	resizeHandleLeft.setStrokeType(StrokeType.OUTSIDE);
	resizeHandleLeft.setStroke(Color.BLUE);
	// Resize Handler Right-Width
	resizeHandleRight.setStrokeWidth(1);
	resizeHandleRight.setStrokeType(StrokeType.OUTSIDE);
	resizeHandleRight.setStroke(Color.BLUE);
	// Resize Handler Top-Height
	resizeHandleTop.setStrokeWidth(1);
	resizeHandleTop.setStrokeType(StrokeType.OUTSIDE);
	resizeHandleTop.setStroke(Color.BLUE);
	// Resize Handler Bottom-Height
	resizeHandleBottom.setStrokeWidth(1);
	resizeHandleBottom.setStrokeType(StrokeType.OUTSIDE);
	resizeHandleBottom.setStroke(Color.BLUE);
}
 
开发者ID:pror21,项目名称:JFloor,代码行数:27,代码来源:HandlerAssigner.java


示例4: initGraphics

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
private void initGraphics() {
    gradient = new ConicalGradient(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, gradientLookup.getStops());

    double center = PREFERRED_WIDTH * 0.5;
    ring = Shape.subtract(new Circle(center, center, center),
                          new Circle(center, center, PREFERRED_WIDTH * 0.28813559));
    ring.setFill(gradient.getImagePattern(ring.getLayoutBounds()));

    mainCircle = new Circle();
    mainCircle.setStrokeType(StrokeType.INSIDE);
    mainCircle.setMouseTransparent(true);

    pane = new Pane(ring, mainCircle);

    getChildren().setAll(pane);
}
 
开发者ID:HanSolo,项目名称:ColorSelector,代码行数:17,代码来源:ColorSelector.java


示例5: BoardSquare

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
public BoardSquare(int x, int y) {
  super();

  this.x = x;
  this.y = y;

  setSize(width);
  setPadding(Insets.EMPTY);
  setAlignment(Pos.CENTER);

  // some defaults
  highLightCircle.setStrokeType(StrokeType.INSIDE);
  highLightCircle.setStrokeWidth(strokeWidth);

  init();
}
 
开发者ID:toomasr,项目名称:sgf4j-gui,代码行数:17,代码来源:BoardSquare.java


示例6: placeStone

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
public void placeStone(StoneState stoneState) {
  this.squareState = stoneState;

  stoneCircle.setRadius(width / RADIUS_MULTIPLIER);
  highLightCircle.setRadius(( width / HIGHLIGHT_MULTIPLIER ) - 1.5);

  stoneCircle.setStroke(Color.BLACK);
  stoneCircle.setStrokeType(StrokeType.OUTSIDE);
  stoneCircle.setStrokeWidth(strokeWidth);
  stoneCircle.setVisible(true);

  if (stoneState.equals(StoneState.WHITE)) {
    stoneCircle.setFill(Color.WHITE);
  }
  else {
    stoneCircle.setFill(Color.BLACK);
  }

  stoneCircle.setSmooth(true);

  if (!getChildren().contains(stoneCircle)) {
    getChildren().add(stoneCircle);
  }
}
 
开发者ID:toomasr,项目名称:sgf4j-gui,代码行数:25,代码来源:BoardSquare.java


示例7: init

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
@PostConstruct
public void init() {
    // Bind the port property to the UI label
    currentPortID.textProperty().bindBidirectional(appConfig.comPortProperty());

    // Dynamically create all alerts
    Map<String, GroovyObject> alerts = alterManager.getAlertClasses();
    for (String key : alerts.keySet()) {
        Circle alarm = new Circle(11.0, Color.web("green"));
        alarm.setRadius(11.0);
        alarm.setStrokeType(StrokeType.INSIDE);
        alarm.setStroke(Color.web("black"));
        Label label = new Label(key);
        alertVbox.getChildren().addAll(alarm, label);
        alertUiMap.put(key, alarm);
    }

    comGenerator.addObserver(this);
}
 
开发者ID:CowboyJim,项目名称:mm3Capture,代码行数:20,代码来源:MainAppController.java


示例8: updateChanges

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
@Override
public void updateChanges()
{
    super.updateChanges();
    if (dirty_size.checkAndClear())
    {
        jfx_node.setWidth(model_widget.propWidth().getValue());
        jfx_node.setHeight(model_widget.propHeight().getValue());
        jfx_node.setArcWidth(2 * model_widget.propCornerWidth().getValue());
        jfx_node.setArcHeight(2 * model_widget.propCornerHeight().getValue());
    }
    if (dirty_look.checkAndClear())
    {
        jfx_node.setMouseTransparent(ignore_mouse);
        jfx_node.setFill(background);
        jfx_node.setStroke(line_color);
        jfx_node.setStrokeWidth(model_widget.propLineWidth().getValue());
        jfx_node.setStrokeType(StrokeType.INSIDE);
    }
}
 
开发者ID:kasemir,项目名称:org.csstudio.display.builder,代码行数:21,代码来源:RectangleRepresentation.java


示例9: setRectangleSize

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
public void setRectangleSize(double x, double y, double width, double height) {
	Window w = RectangleBorder.this.getScene().getWindow();

	StrokeType st = RectangleBorder.this.getStrokeType();
	double strokeWidth = resizer.getThickBorderSize();

	double padding = 0;
	if (st.equals(StrokeType.CENTERED)) {
		padding = strokeWidth / 2;
	} else if (st.equals(StrokeType.OUTSIDE)) {
		padding = strokeWidth;
	}

	w.setWidth(width + 2 * padding);
	w.setHeight(height + 2 * padding);

	w.setX(x + -padding + w.getX());
	w.setY(y + -padding + w.getY());

	this.setWidth(width);
	this.setHeight(height);
	setX(padding);
	setY(padding);
}
 
开发者ID:JonSchram,项目名称:GoodiesLinkBot,代码行数:25,代码来源:RectangleBorder.java


示例10: create

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
private void create() {
	this.initStyle(StageStyle.TRANSPARENT);
	setWidth(100);
	setHeight(100);
	setAlwaysOnTop(true);

	Pane shapes = new Pane();
	scene = new Scene(shapes, getWidth(), getHeight(), null);
	scene.setFill(Color.TRANSPARENT);

	sizeRect = new RectangleBorder(0, 0, 100, 100);
	sizeRect.setStrokeType(StrokeType.OUTSIDE);
	sizeRect.setFill(null);
	sizeRect.setStroke(Color.RED);
	sizeRect.setStrokeWidth(3);
	sizeRect.setUnselectedStrokeWidth(3);
	sizeRect.setSelectedStrokeWidth(10);

	shapes.getChildren().add(sizeRect);

	setTitle("Rectangular select");
	setScene(scene);
	scene.getRoot().setStyle("-fx-background-color: transparent");

}
 
开发者ID:JonSchram,项目名称:GoodiesLinkBot,代码行数:26,代码来源:ScreenRegionSelect.java


示例11: setStrokeAlignment

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
/**
 * Sets the stroke alignment with a JavaFx stroke type
 * @param javaFxStrokeType 
 */
public void setStrokeAlignment(StrokeType javaFxStrokeType) {
	switch (javaFxStrokeType) {
	case CENTERED:
		setStrokeAlignment(SvgStrokeAlignment.CENTER);
		break;
	case INSIDE:
		setStrokeAlignment(SvgStrokeAlignment.INNER);
		break;
	case OUTSIDE:
		setStrokeAlignment(SvgStrokeAlignment.OUTER);
		break;
	default:
		String message = "The stroke type " + javaFxStrokeType + " is not known.";
		throw new IllegalArgumentException(message);
	}
}
 
开发者ID:stefaneidelloth,项目名称:JavaFxNodeToSvg,代码行数:21,代码来源:SvgNodeProperties.java


示例12: init

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
private void init()
{
    Group g = new Group();

    mCircle = new Circle(0,0,40);
    mCircle.setFill(Color.WHITE);
    mCircle.setStrokeWidth(3);
    mCircle.setStrokeMiterLimit(10);
    mCircle.setStrokeType(StrokeType.CENTERED);
    mCircle.setStroke(Color.valueOf("0x333333"));

    Circle inner = new Circle(0,0,8);
    inner.setFill(Color.valueOf("0xFFFFFF00"));
    inner.setStrokeWidth(4);
    inner.setStrokeMiterLimit(10);
    inner.setStrokeType(StrokeType.INSIDE);
    inner.setStroke(Color.valueOf("0x000000"));

    g.getChildren().addAll(mCircle, inner);
    setAlignment(g, Pos.CENTER);

    getChildren().add(g);
}
 
开发者ID:EyeTribe,项目名称:tet-java-client,代码行数:24,代码来源:CalibrationButton.java


示例13: setupZooming

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
/**
 * Convenience method for simple and default setup of zooming on an {@link XYChart} via a
 * {@link ChartZoomManager}. Wraps the chart in the components required to implement zooming. The
 * current implementation wraps the chart in a StackPane, which has the chart and a blue
 * translucent rectangle as children. Returns the top level of the created components.
 * <p>
 * If the chart already has a parent, that parent must be a {@link Pane}, and the chart is
 * replaced with the wrapping region, and the return value could be ignored. If the chart does
 * not have a parent, the same wrapping node is returned, which will need to be added to some
 * parent.
 * <p>
 * The chart's axes must both be a type of ValueAxis.
 * <p>
 * The wrapping logic does not seem to be perfect, in fact there is a special case to handle
 * {@link BorderPane}s. If it's not found to be reliable, then create the wrapping components
 * yourself (such as in the FXML), or setup zooming before adding it to a parent.
 *
 * @param mouseFilter EventHandler that consumes events that should not trigger a zoom action
 *
 * @return The top-level Region
 */
public static Region setupZooming( XYChart<?, ?> chart,
                                   EventHandler<? super MouseEvent> mouseFilter ) {
	StackPane chartPane = new StackPane();

	if ( chart.getParent() != null )
		JFXUtil.replaceComponent( chart, chartPane );

	Rectangle selectRect = new Rectangle( 0, 0, 0, 0 );
	selectRect.setFill( Color.DODGERBLUE );
	selectRect.setMouseTransparent( true );
	selectRect.setOpacity( 0.3 );
	selectRect.setStroke( Color.rgb( 0, 0x29, 0x66 ) );
	selectRect.setStrokeType( StrokeType.INSIDE );
	selectRect.setStrokeWidth( 3.0 );
	StackPane.setAlignment( selectRect, Pos.TOP_LEFT );

	chartPane.getChildren().addAll( chart, selectRect );

	ChartZoomManager zoomManager = new ChartZoomManager( chartPane, selectRect, chart );
	zoomManager.setMouseFilter( mouseFilter );
	zoomManager.start();
	return chartPane;
}
 
开发者ID:gillius,项目名称:jfxutils,代码行数:45,代码来源:JFXChartUtil.java


示例14: ZoomImageFrame

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
public ZoomImageFrame() {
    Group root = new Group();
    this.getChildren().add(root);
    
    iv = new ImageView();

    Rectangle bg = new Rectangle();
    bg.widthProperty().bind(this.widthProperty);
    bg.heightProperty().bind(this.heightProperty);
    bg.setFill(Color.rgb(240, 240, 240));
    bg.setStroke(Color.rgb(192, 192, 192));
    bg.setStrokeWidth(1);
    bg.setStrokeType(StrokeType.OUTSIDE);
    root.getChildren().add(bg);

    iv.fitWidthProperty().bind(widthProperty.subtract(10));
    iv.fitHeightProperty().bind(heightProperty.subtract(10));
    iv.setPreserveRatio(true);
    iv.setTranslateX(5);
    iv.setTranslateY(5);
    this.getChildren().add(iv);
    
    recalculateViewPort();

}
 
开发者ID:dipacs,项目名称:Viwib,代码行数:26,代码来源:ZoomImageFrame.java


示例15: SimpleHSBColorPicker

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
public SimpleHSBColorPicker() {
    getChildren().addAll(hsbRect,lightRect);
    lightRect.setStroke(Color.GRAY);
    lightRect.setStrokeType(StrokeType.OUTSIDE);
    EventHandler<MouseEvent> ml = new EventHandler<MouseEvent>() {
        @Override public void handle(MouseEvent e) {
            double w = getWidth();
            double h = getHeight();
            double x = Math.min(w, Math.max(0, e.getX()));
            double y = Math.min(h, Math.max(0, e.getY()));
            double hue = (360/w)*x;
            double vert = (1/h)*y;
            double sat = 0;
            double bright = 0;
            if (vert<0.5) {
                bright = 1;
                sat = vert * 2;
            } else {
                bright = sat = 1- ((vert-0.5)*2);
            }
            // convert back to color
            Color c =  Color.hsb((int)hue,sat,bright);
            color.set(c);
            e.consume();
        }
    };
    lightRect.setOnMouseDragged(ml);
    lightRect.setOnMouseClicked(ml);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:30,代码来源:SimpleHSBColorPicker.java


示例16: Anchor

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
/**
 * Instatiation of display of anchor.
 * @param color
 * @param x
 * @param y
 */
public Anchor(Color color, DoubleProperty x, DoubleProperty y) {
	super(x.get(), y.get(), RADIUS);
	setFill(color.deriveColor(1, 1, 1, FILL_CONST));
	setStroke(color);
	setStrokeWidth(STROKE_WIDTH);
	setStrokeType(StrokeType.OUTSIDE);

	x.bind(centerXProperty());
	y.bind(centerYProperty());
	enableDrag();
}
 
开发者ID:sjain28,项目名称:Game-Engine-Vooga,代码行数:18,代码来源:Anchor.java


示例17: Anchor

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
public Anchor(DoubleProperty x, DoubleProperty y, TransitionOrder order) {
	super(x.get(), y.get(), RADIUS);
	setFill(order.getColor().deriveColor(1, 1, 1, COLOR_FACTOR));
	setStroke(order.getColor());
	setStrokeWidth(CIRCLE_WIDTH);
	setStrokeType(StrokeType.OUTSIDE);

	x.bind(centerXProperty());
	y.bind(centerYProperty());
}
 
开发者ID:sjain28,项目名称:Game-Engine-Vooga,代码行数:11,代码来源:Anchor.java


示例18: resize

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
private void resize() {
    width  = getWidth() - getInsets().getLeft() - getInsets().getRight();
    height = getHeight() - getInsets().getTop() - getInsets().getBottom();
    size   = width < height ? width : height;

    if (width > 0 && height > 0) {
        pane.setMaxSize(size, size);
        pane.relocate((getWidth() - size) * 0.5, (getHeight() - size) * 0.5);

        ring.setCenterX(size * 0.5);
        ring.setCenterY(size * 0.5);
        ring.setRadius(size * 0.5);
        ring.setStrokeWidth(size * 0.025);
        ring.setStrokeType(StrokeType.INSIDE);

        mask.setCenterX(size * 0.5);
        mask.setCenterY(size * 0.5);
        mask.setRadius(size * 0.45);

        canvas.setWidth(size);
        canvas.setHeight(size);
        canvas.relocate(0, 0);

        text.setFont(Fonts.robotoMedium(size * 0.25));
        text.setY(size * 0.5);
        text.setX((size - text.getLayoutBounds().getWidth()) * 0.5);

        for( int i = 0 ; i < detail + 1 ; i++ ) {
            Point p = particles.get(i);
            p.x = size / (detail - 4) * (i - 2);
            p.y = size * (1d - gauge.getCurrentValue());

            p.originalX = p.x;
            p.originalY = p.y;
        }
    }
}
 
开发者ID:HanSolo,项目名称:medusademo,代码行数:38,代码来源:FunLevelGauge.java


示例19: createEllipse

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
/**
 * Returns a visualization of a graph segment
 */
public Ellipse createEllipse(int segmentId, double ellipseHeigth) {
	int contentLength = segmentdna.get(segmentId - 1).length();
	double xcoord = graphxcoords.get(segmentId - 1);
	double ycoord = graphycoords.get(segmentId - 1);
	double xradius = 30 + 2 * Math.log(contentLength);
	Ellipse node = new Ellipse(xcoord, ycoord, xradius, ellipseHeigth);
	node.setFill(Color.DODGERBLUE);
	node.setStroke(Color.BLACK);
	node.setStrokeType(StrokeType.INSIDE);
	return node;
}
 
开发者ID:ProgrammingLife2016,项目名称:PL3-2016,代码行数:15,代码来源:GraphView.java


示例20: resize

import javafx.scene.shape.StrokeType; //导入依赖的package包/类
@Override protected void resize() {
    double width  = gauge.getWidth() - gauge.getInsets().getLeft() - gauge.getInsets().getRight();
    double height = gauge.getHeight() - gauge.getInsets().getTop() - gauge.getInsets().getBottom();
    size          = width < height ? width : height;

    if (width > 0 && height > 0) {
        pane.setMaxSize(size, size);
        pane.relocate((width - size) * 0.5, (height - size) * 0.5);

        colorRing.setCenterX(size * 0.5);
        colorRing.setCenterY(size * 0.5);
        colorRing.setRadius(size * 0.5);
        colorRing.setStrokeWidth(size * 0.0075);
        colorRing.setStrokeType(StrokeType.INSIDE);

        bar.setCenterX(size * 0.5);
        bar.setCenterY(size * 0.5);
        bar.setRadiusX(size * 0.4135);
        bar.setRadiusY(size * 0.4135);
        bar.setStrokeWidth(size * 0.12);

        separator.setStartX(size * 0.5);
        separator.setStartY(size * 0.0275);
        separator.setEndX(size * 0.5);
        separator.setEndY(size * 0.145);

        resizeTitleText();
        resizeValueText();
        resizeUnitText();
    }
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:32,代码来源:FlatSkin.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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