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


Java ArcTo.setRadiusX方法代码示例

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


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

示例1: drawingAreaMouseClicked

import javafx.scene.shape.ArcTo; //导入方法依赖的package包/类
@FXML
private void drawingAreaMouseClicked(MouseEvent e)
{
   polyline.getPoints().addAll(e.getX(), e.getY());
   polygon.getPoints().addAll(e.getX(), e.getY());
 
   // if path is empty, move to first click position and close path
   if (path.getElements().isEmpty())
   {
      path.getElements().add(new MoveTo(e.getX(), e.getY()));
      path.getElements().add(new ClosePath());      
   }
   else // insert a new path segment before the ClosePath element
   {
      // create an arc segment and insert it in the path
      ArcTo arcTo = new ArcTo();
      arcTo.setX(e.getX());
      arcTo.setY(e.getY());
      arcTo.setRadiusX(100.0);
      arcTo.setRadiusY(100.0);
      arcTo.setSweepFlag(sweepFlag);
      sweepFlag = !sweepFlag;
      path.getElements().add(path.getElements().size() - 1, arcTo);
   }
}
 
开发者ID:cleitonferreira,项目名称:LivroJavaComoProgramar10Edicao,代码行数:26,代码来源:PolyShapesController.java

示例2: initializeHalfCircle

import javafx.scene.shape.ArcTo; //导入方法依赖的package包/类
private Path initializeHalfCircle() {
    final Path halfCircle = new Path();

    halfCircle.setStroke(Color.BLACK);
    MoveTo p1 = new MoveTo();
    ArcTo p2 = new ArcTo();

    p1.xProperty().bind(xProperty().add(CIRCLE_RADIUS));
    p1.yProperty().bind(yProperty());

    p2.xProperty().bind(xProperty().subtract(CIRCLE_RADIUS));
    p2.yProperty().bind(yProperty());
    p2.setRadiusX(CIRCLE_RADIUS);
    p2.setRadiusY(CIRCLE_RADIUS);

    halfCircle.getElements().add(p1);
    halfCircle.getElements().add(p2);

    return halfCircle;
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:21,代码来源:HandshakeChannelSenderArrowHead.java

示例3: initializeLargeCircle

import javafx.scene.shape.ArcTo; //导入方法依赖的package包/类
private Path initializeLargeCircle() {
    final Path largeCircle = new Path();

    largeCircle.setStroke(Color.BLACK);
    MoveTo p1 = new MoveTo();
    ArcTo p2 = new ArcTo();

    p1.xProperty().bind(xProperty().add(LARGE_CIRCLE_RADIUS));
    p1.yProperty().bind(yProperty());

    p2.xProperty().bind(xProperty().subtract(LARGE_CIRCLE_RADIUS));
    p2.yProperty().bind(yProperty());
    p2.setRadiusX(LARGE_CIRCLE_RADIUS);
    p2.setRadiusY(LARGE_CIRCLE_RADIUS);

    largeCircle.getElements().add(p1);
    largeCircle.getElements().add(p2);

    return largeCircle;
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:21,代码来源:BroadcastChannelSenderArrowHead.java

示例4: initializeMediumCircle

import javafx.scene.shape.ArcTo; //导入方法依赖的package包/类
private Path initializeMediumCircle() {
    final Path mediumCircle = new Path();

    mediumCircle.setStroke(Color.BLACK);
    MoveTo p1 = new MoveTo();
    ArcTo p2 = new ArcTo();

    p1.xProperty().bind(xProperty().add(MEDIUM_CIRCLE_RADIUS));
    p1.yProperty().bind(yProperty());

    p2.xProperty().bind(xProperty().subtract(MEDIUM_CIRCLE_RADIUS));
    p2.yProperty().bind(yProperty());
    p2.setRadiusX(MEDIUM_CIRCLE_RADIUS);
    p2.setRadiusY(MEDIUM_CIRCLE_RADIUS);

    mediumCircle.getElements().add(p1);
    mediumCircle.getElements().add(p2);

    return mediumCircle;
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:21,代码来源:BroadcastChannelSenderArrowHead.java

示例5: initializeSmallCircle

import javafx.scene.shape.ArcTo; //导入方法依赖的package包/类
private Path initializeSmallCircle() {
    final Path smallCircle = new Path();

    smallCircle.setStroke(Color.BLACK);
    MoveTo p1 = new MoveTo();
    ArcTo p2 = new ArcTo();

    p1.xProperty().bind(xProperty().add(SMALL_CIRCLE_RADIUS));
    p1.yProperty().bind(yProperty());

    p2.xProperty().bind(xProperty().subtract(SMALL_CIRCLE_RADIUS));
    p2.yProperty().bind(yProperty());
    p2.setRadiusX(SMALL_CIRCLE_RADIUS);
    p2.setRadiusY(SMALL_CIRCLE_RADIUS);

    smallCircle.getElements().add(p1);
    smallCircle.getElements().add(p2);

    return smallCircle;
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:21,代码来源:BroadcastChannelSenderArrowHead.java

示例6: draw

import javafx.scene.shape.ArcTo; //导入方法依赖的package包/类
/**
 * Draws the arrow-head for its current size and position values.
 */
public void draw() {

    getElements().clear();

    getElements().add(new MoveTo(x, y + length / 2));
    getElements().add(new LineTo(x + width / 2, y - length / 2));

    if (radius > 0) {
        final ArcTo arcTo = new ArcTo();
        arcTo.setX(x - width / 2);
        arcTo.setY(y - length / 2);
        arcTo.setRadiusX(radius);
        arcTo.setRadiusY(radius);
        arcTo.setSweepFlag(true);
        getElements().add(arcTo);
    } else {
        getElements().add(new LineTo(x - width / 2, y - length / 2));
    }

    getElements().add(new ClosePath());
}
 
开发者ID:Heverton,项目名称:grapheditor,代码行数:25,代码来源:ArrowHead.java

示例7: addArcTo

import javafx.scene.shape.ArcTo; //导入方法依赖的package包/类
/**
 * Adds a circular detour arc to the path, to the given position.
 *
 * @param x the final x position of the arc
 * @param y the final y position of the arc
 */
private void addArcTo(final double x, final double y) {

    final ArcTo arcTo = new ArcTo();

    arcTo.setRadiusX(DETOUR_RADIUS);
    arcTo.setRadiusY(DETOUR_RADIUS);
    arcTo.setSweepFlag(sign > 0);
    arcTo.setX(GeometryUtils.moveOffPixel(x));
    arcTo.setY(GeometryUtils.moveOffPixel(y));

    getPathElements().add(arcTo);
}
 
开发者ID:Heverton,项目名称:grapheditor,代码行数:19,代码来源:DetouredConnectionSegment.java

示例8: start

import javafx.scene.shape.ArcTo; //导入方法依赖的package包/类
@Override
public void start(Stage palco) throws Exception {
	StackPane painelEmpilhador = new StackPane();
	Rectangle retangulo = new Rectangle(220, 120);
	retangulo.setFill(Color.GREEN);

	Polygon losango = new Polygon();
	losango.getPoints().addAll(new Double[]{
	     50.0, 50.0,
	     150.0, 0.0,
	     250.0, 50.0,
	     150.0, 100.0,
	     50.0, 50.0 });
	losango.setFill(Color.YELLOW);
	Path arco = new Path();
	MoveTo moveTo = new MoveTo();
	moveTo.setX(0.0);
	moveTo.setY(0.0);

	ArcTo arcTo = new ArcTo();
	arcTo.setX(55.0);
	arcTo.setY(0.0);
	arcTo.setRadiusX(50.0);
	arcTo.setRadiusY(50.0);

	arco.getElements().add(moveTo);
	arco.getElements().add(arcTo);
	arco.setStroke(Color.WHITE);

	arco.setRotate(180);
	arco.setStrokeWidth(5);

	Circle circulo = new Circle(30, Color.BLUE);
	  
	painelEmpilhador.getChildren().addAll(retangulo, losango, circulo, arco);
	
	Scene cena = new Scene(painelEmpilhador, 250, 100); 
	palco.setTitle("Testando StackPane"); 
	palco.setScene(cena); 
	palco.show(); 
}
 
开发者ID:jesuino,项目名称:livro-javafx-pratico,代码行数:42,代码来源:PraticaStackPane.java

示例9: createArc

import javafx.scene.shape.ArcTo; //导入方法依赖的package包/类
/**
 * Creates an {@link ArcTo} with the specified parameters.
 *
 * Coordinates of the end point of the arc are given in polar form relative
 * to the center of the arcs.
 *
 * @param radius
 *            The radius of the arc.
 * @param center
 *            The center coordinates of the arc.
 * @param angle
 *            The angle of the end point.
 * @param sweep
 *            The draw direction of the arc.
 * @param largeArc
 *            if true draw an arc larger than 180 degrees.
 * @return an ArcTo with the specified parameters.
 */
private ArcTo createArc(final double radius, final Point2D center,
        final double angle, final boolean sweep, final boolean largeArc) {
    // calculate the end point of the arc
    double endX = center.getX() + radius * Math.sin(angle);
    double endY = center.getY() - radius * Math.cos(angle);

    // create the arc
    ArcTo result = new ArcTo();
    result.setRadiusX(radius);
    result.setRadiusY(radius);
    result.setX(endX);
    result.setY(endY);
    result.setSweepFlag(sweep);
    result.setLargeArcFlag(largeArc);

    return result;
}
 
开发者ID:ProgrammingLife2015,项目名称:LifeTiles,代码行数:36,代码来源:SunburstRingSegment.java

示例10: createOuterCircleSegments

import javafx.scene.shape.ArcTo; //导入方法依赖的package包/类
/**
    * computes the circular ring segments specified by segmentCount 
    * through translation of vector coordinates into local coordinate-space at
    * application runtime <br>
    * Each segment and its associated symbol will be added to a 
    * group-node which will be put into an ObservableList of type Group: segments <br>
    * @see {@link segments}, {@link getSegments}, {@link setSegments}
    */
   private void createOuterCircleSegments()
   {
double segmentRadians = 360/segmentCount*Math.PI/180;

for(int i = 2; i <= segmentCount+1; i++)
{
    Group g = new Group();
    
    Path p = new Path();
    p.setFill(fillColor);
    p.setStroke(strokeColor);
    p.setFillRule(FillRule.EVEN_ODD);
    
    MoveTo firstPoint = new MoveTo();
    firstPoint.setX(centerX + innerRadius*Math.cos(segmentRadians*(i-1)));
    firstPoint.setY(centerY + innerRadius*Math.sin(segmentRadians*(i-1)));
    
    p.getElements().add(firstPoint);
    
    LineTo nextLine = new LineTo();
    nextLine.setX(centerX + outerRadius*Math.cos(segmentRadians*(i-1)));
    nextLine.setY(centerY + outerRadius*Math.sin(segmentRadians*(i-1)));
    
    ArcTo outerArc = new ArcTo();
    outerArc.setSweepFlag(true);
    outerArc.setAbsolute(true);
    outerArc.setX(centerX + outerRadius*Math.cos(2*Math.PI + segmentRadians*i));
    outerArc.setY(centerY + outerRadius*Math.sin(2*Math.PI + segmentRadians*i));
    outerArc.setRadiusX(outerRadius);
    outerArc.setRadiusY(outerRadius);

    LineTo line2 = new LineTo();
    line2.setX(centerX + innerRadius*Math.cos(segmentRadians*(i)));
    line2.setY(centerY + innerRadius*Math.sin(segmentRadians*(i)));
    
    ArcTo innerArc = new ArcTo();
    innerArc.setSweepFlag(false);
    innerArc.setAbsolute(true);
    innerArc.setX(centerX + innerRadius*Math.cos(2*Math.PI + segmentRadians*(i-1)));
    innerArc.setY(centerY + innerRadius*Math.sin(2*Math.PI + segmentRadians*(i-1)));
    innerArc.setRadiusX(innerRadius);
    innerArc.setRadiusY(innerRadius);
    
    MoveTo end = new MoveTo();
    end.setX(centerX + innerRadius*Math.cos(segmentRadians*(i)));
    end.setY(centerY + innerRadius*Math.sin(segmentRadians*(i)));
    
    p.getElements().add(nextLine);
    p.getElements().add(outerArc);
    p.getElements().add(line2);
    p.getElements().add(innerArc);
    p.getElements().add(end);
    
    g.getChildren().add(p);
    
    
    // temporary: for button layout injection
    Rectangle rect = new Rectangle();
    rect.setX(centerX-((outerRadius-innerRadius)*0.35) + (innerRadius + (outerRadius - innerRadius)/2)*Math.cos(segmentRadians*(i-.5)));
    rect.setY(centerY-((outerRadius-innerRadius)*0.35) + (innerRadius + (outerRadius - innerRadius)/2)*Math.sin(segmentRadians*(i-.5)));
    rect.setWidth(((outerRadius-innerRadius)*0.7));
    rect.setHeight(((outerRadius-innerRadius)*0.7));
    rect.setRotate(Math.toDegrees(segmentRadians*(i-.5)));
    rect.setFill(Color.RED);
    
    g.getChildren().add(rect);
    
    segments.add(g);
}

   }
 
开发者ID:nballmann,项目名称:RadialMenuFX,代码行数:80,代码来源:RadialMenu.java


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