Codota Logo
javafx.scene.shape
Code IndexAdd Codota to your IDE (free)

How to use javafx.scene.shape

Best Java code snippets using javafx.scene.shape (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: jfoenixadmin/JFoenix

private void updateArcLayout(double radius, double arcSize) {
  arc.setRadiusX(radius);
  arc.setRadiusY(radius);
  arc.setCenterX(arcSize / 2);
  arc.setCenterY(arcSize / 2);
  track.setRadiusX(radius);
  track.setRadiusY(radius);
  track.setCenterX(arcSize / 2);
  track.setCenterY(arcSize / 2);
  track.setStrokeWidth(arc.getStrokeWidth());
}
origin: jfoenixadmin/JFoenix

/**
 * update the size of error container and its clip
 *
 * @param w
 * @param errorContainerHeight
 */
private void updateErrorContainerSize(double w, double errorContainerHeight) {
  errorContainerClip.setWidth(w);
  errorContainerClip.setHeight(errorContainerHeight);
  resize(w, errorContainerHeight);
}
origin: jfoenixadmin/JFoenix

@Override
protected Node getMask() {
  double radius = ripplerPane.getWidth() / 2;
  return new Circle(radius, radius, radius);
}
origin: jfoenixadmin/JFoenix

/**
 * creates empty drawers stack
 */
public JFXDrawersStack() {
  final Rectangle clip = new Rectangle();
  clip.widthProperty().bind(this.widthProperty());
  clip.heightProperty().bind(this.heightProperty());
  this.setClip(clip);
}
origin: jfoenixadmin/JFoenix

private void addTabContentHolder(Tab tab) {
  // create new content place holder
  TabContentHolder tabContentHolder = new TabContentHolder(tab);
  tabContentHolder.setClip(new Rectangle());
  tabContentHolders.add(tabContentHolder);
  // always add tab content holder below its header
  tabsContainer.getChildren().add(0, tabContentHolder);
}
origin: jfoenixadmin/JFoenix

public void layoutLines(double x, double y, double w, double h, double controlHeight, double translateY) {
  this.contentHeight = translateY;
  clip.setY(-contentHeight);
  clip.setHeight(controlHeight + contentHeight);
  focusedLine.resizeRelocate(x, controlHeight, w, focusedLine.prefHeight(-1));
  line.resizeRelocate(x, controlHeight, w, line.prefHeight(-1));
  promptContainer.resizeRelocate(x, y, w, h);
  scale.setPivotX(w / 2);
}
origin: jfoenixadmin/JFoenix

private void updateClipHeight(double newHeight) {
  clip.setHeight(newHeight - getGap());
}
origin: jfoenixadmin/JFoenix

public void layoutPane(final double x, final double y, final double w, final double h) {
  relocate(x, y);
  // resize error container if animation is disabled
  if (control.isDisableAnimation() || isErrorVisible()) {
    resize(w, computeErrorHeight(computeErrorWidth(w)));
    errorContainerClip.setWidth(w);
  }
}
origin: stackoverflow.com

 public void moveCircle(Circle circle, Scene scene) {
  Timer timer = new Timer();
  timer.scheduleAtFixedRate(new TimerTask() {
    @Override
    public void run() {
      Platform.runLater(() -> {
        circle.setCenterX(random((int) scene.getX()));
        circle.setCenterY(random((int) scene.getY()));
      });
    }
  }, 1000, 1000);
}
origin: jfoenixadmin/JFoenix

private Point2D makeControlPoint(final double endX, final double endY, final Circle circle, final int numSegments, int direction) {
  final double controlPointDistance = (4.0 / 3.0) * Math.tan(Math.PI / (2 * numSegments)) * circle.getRadius();
  final Point2D center = new Point2D(circle.getCenterX(), circle.getCenterY());
  final Point2D end = new Point2D(endX, endY);
  Point2D perp = rotate(center, end, direction * Math.PI / 2.);
  Point2D diff = perp.subtract(end);
  diff = diff.normalize();
  diff = scale(diff, controlPointDistance);
  return end.add(diff);
}
origin: jfoenixadmin/JFoenix

  public void selectColor(KeyEvent event) {
    if (rectangle.getFill() != null) {
      if (rectangle.getFill() instanceof Color) {
        colorPicker.setValue((Color) rectangle.getFill());
        colorPicker.fireEvent(new ActionEvent());
      }
      event.consume();
    }
    colorPicker.hide();
  }
}
origin: jfoenixadmin/JFoenix

private void initialize() {
  if (getSkinnable().isIndeterminate()) {
    if (timeline == null) {
      createTransition();
      if (getSkinnable().impl_isTreeVisible()) {
        timeline.play();
      }
    }
  } else {
    clearAnimation();
    arc.setStartAngle(90);
    updateProgress();
  }
}
origin: jfoenixadmin/JFoenix

@Override
protected double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) {
  if (Region.USE_COMPUTED_SIZE == control.getRadius()) {
    return super.computeMaxHeight(width, topInset, rightInset, bottomInset, leftInset);
  } else {
    return control.getRadius() * 2 + arc.getStrokeWidth() * 2;
  }
}
origin: jfoenixadmin/JFoenix

@Override
protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {
  return super.computePrefWidth(height,
    topInset,
    rightInset,
    bottomInset,
    leftInset) + snapSize(radio.prefWidth(-1)) + padding / 3;
}
origin: jfoenixadmin/JFoenix

@Override
protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {
  return super.computeMinWidth(height,
    topInset,
    rightInset,
    bottomInset,
    leftInset) + snapSize(radio.minWidth(-1)) + padding / 3;
}
origin: jfoenixadmin/JFoenix

private double computeTranslation(double circleRadius, Line line) {
  return (getSkinnable().isSelected() ? 1 : -1) * ((line.getLayoutBounds().getWidth() / 2) - circleRadius + 2);
}
origin: jfoenixadmin/JFoenix

@Override
protected void setOverLayBounds(Rectangle overlay) {
  overlay.setWidth(ripplerPane.getWidth());
  overlay.setHeight(ripplerPane.getHeight());
}
origin: jfoenixadmin/JFoenix

@Override
protected double computeMaxWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {
  if (Region.USE_COMPUTED_SIZE == control.getRadius()) {
    return super.computeMaxHeight(height, topInset, rightInset, bottomInset, leftInset);
  } else {
    return control.getRadius() * 2 + arc.getStrokeWidth() * 2;
  }
}
origin: jfoenixadmin/JFoenix

protected void setOverLayBounds(Rectangle overlay){
  overlay.setWidth(control.getLayoutBounds().getWidth());
  overlay.setHeight(control.getLayoutBounds().getHeight());
}
origin: jfoenixadmin/JFoenix

public void invalid(double w) {
  final ValidatorBase activeValidator = control.getActiveValidator();
  if (activeValidator != null) {
    showError(activeValidator);
    final double errorContainerWidth = w - errorIcon.prefWidth(-1);
    setOpacity(1);
    resize(w, computeErrorHeight(errorContainerWidth));
    errorContainerClip.setWidth(w);
    errorContainerClip.setHeight(getHeight());
    errorClipScale.setY(1);
  }
}
javafx.scene.shape

Most used classes

  • Rectangle
  • Circle
  • MeshView
  • Line
  • MoveTo
  • CubicCurveTo,
  • LineTo,
  • Shape,
  • Box,
  • Polygon,
  • Sphere,
  • ObservableFaceArray,
  • TriangleMesh,
  • Arc,
  • ArcTo,
  • ClosePath,
  • HLineTo,
  • QuadCurveTo,
  • SVGPath
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now