Tabnine Logo
Circle.getCenterY
Code IndexAdd Tabnine to your IDE (free)

How to use
getCenterY
method
in
javafx.scene.shape.Circle

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

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: ch.sahits.game/OpenPatricianDisplay

@Subscribe
public void handleShipLeavesCity(ShipLeavingPort event) {
  ICity city = event.getCity();
  final IShipOwner owner = event.getShip().getOwner();
  if (owner instanceof IHumanPlayer && owner.equals(viewState.getPlayer())) {
    List<INavigableVessel> ships = ((IHumanPlayer)owner).findShips(city);
    if (ships.isEmpty()) {
      double cityX = (int) Math.rint(city.getCoordinates().getX()) * scale.doubleValue();
      double cityY = (int) Math.rint(city.getCoordinates().getY()) * scale.doubleValue();
      for (Iterator<Node> iterator = shipCanvas.getChildren().iterator(); iterator.hasNext(); ) {
        Node node = iterator.next();
        if (node instanceof Circle) {
          Circle c = (Circle) node;
          if (c.getCenterX() == cityX && c.getCenterY() == cityY) {
            Platform.runLater(iterator::remove);
            break;
          }
        }
      }
    }
  }
}
origin: ch.sahits.game/OpenPatricianDisplay

@Subscribe
public void handleShipLeavesCity(ShipLeavingPort event) {
  ICity city = event.getCity();
  final IShipOwner owner = event.getShip().getOwner();
  if (owner instanceof IHumanPlayer && owner.equals(viewState.getPlayer())) {
    List<INavigableVessel> ships = ((IHumanPlayer)owner).findShips(city);
    if (ships.isEmpty()) {
      double cityX = (int) Math.rint(city.getCoordinates().getX()) * scale;
      double cityY = (int) Math.rint(city.getCoordinates().getY()) * scale;
      double viewportOffset = imgView.getViewport().getMinX() * scale;
      for (Iterator<Node> iterator = mapPane.getChildren().iterator(); iterator.hasNext(); ) {
        Node node = iterator.next();
        if (node instanceof Circle) {
          Circle c = (Circle) node;
          if (c.getCenterX() + viewportOffset == cityX && c.getCenterY() == cityY) {
            Platform.runLater(iterator::remove);
            break;
          }
        }
      }
    }
  }
}
@Subscribe
origin: com.jfoenix/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);
}
javafx.scene.shapeCirclegetCenterY

Popular methods of Circle

  • <init>
  • setFill
  • setCenterX
  • setCenterY
  • setRadius
  • fillProperty
  • getStyleClass
  • setStroke
  • setStrokeWidth
  • setTranslateX
  • getCenterX
  • getRadius
  • getCenterX,
  • getRadius,
  • radiusProperty,
  • setLayoutX,
  • setLayoutY,
  • setOnMouseDragged,
  • strokeProperty,
  • getFill,
  • minWidth

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Table (org.hibernate.mapping)
    A relational table
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now