Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. public void sprawdzenie(ObservableList<pktWielokata> pw) // za każdym razem jak się coś zmieni musi być wywołane
  2. {
  3.  
  4. Polygon poly = new Polygon();
  5. double x, y;
  6. if (pw.size() > 2) {
  7. for (pktWielokata p : pw) {
  8.  
  9. x = p.getcorX();
  10. y = p.getcorY();
  11. poly.getPoints().add(x);
  12. poly.getPoints().add(y);
  13. if(this.getcorX()==x && this.getcorY()==y)
  14. {
  15. Stan = new SimpleBooleanProperty(true);
  16. return;
  17. }
  18. }
  19. if (poly.contains(this.getcorX() < 0 ? this.getcorX():this.getcorX()-1, this.getcorY() < 0 ? this.getcorY():this.getcorY()-1)) {
  20. Stan = new SimpleBooleanProperty(true);
  21. } else {
  22. Stan = new SimpleBooleanProperty(false);
  23.  
  24. }
  25. } else {
  26. Stan = new SimpleBooleanProperty(false);
  27. }
  28.  
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement