Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void sprawdzenie(ObservableList<pktWielokata> pw) // za każdym razem jak się coś zmieni musi być wywołane
- {
- Polygon poly = new Polygon();
- double x, y;
- if (pw.size() > 2) {
- for (pktWielokata p : pw) {
- x = p.getcorX();
- y = p.getcorY();
- poly.getPoints().add(x);
- poly.getPoints().add(y);
- if(this.getcorX()==x && this.getcorY()==y)
- {
- Stan = new SimpleBooleanProperty(true);
- return;
- }
- }
- if (poly.contains(this.getcorX() < 0 ? this.getcorX():this.getcorX()-1, this.getcorY() < 0 ? this.getcorY():this.getcorY()-1)) {
- Stan = new SimpleBooleanProperty(true);
- } else {
- Stan = new SimpleBooleanProperty(false);
- }
- } else {
- Stan = new SimpleBooleanProperty(false);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement