Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1.  
  2. import net.useobjects.AbstractMovableGroup;
  3. import net.useobjects.Ellipse;
  4. import net.useobjects.Group;
  5. import net.useobjects.Rectangle;
  6. import net.useobjects.mouse.MouseEvent;
  7. import net.useobjects.mouse.MouseListener;
  8.  
  9.  
  10.  
  11.  
  12. /*
  13. * To change this license header, choose License Headers in Project Properties.
  14. * To change this template file, choose Tools | Templates
  15. * and open the template in the editor.
  16. */
  17. /**
  18. *
  19. * @author Papulka
  20. */
  21. public class Ponorka extends AbstractMovableGroup {
  22. private Rectangle vrch;
  23. private Ellipse trup;
  24. private boolean podMysou;
  25.  
  26. public Ponorka(Group skupina, int pozX, int pozY){
  27. super(skupina, pozX, pozY);
  28. vrch = new Rectangle (this, 0,0, 50, 40);
  29. trup = new Ellipse(this, 20, 20, 100, 20);
  30. podMysou = false;
  31. this.addMouseListener(new SledovacMysi());
  32. }
  33.  
  34. public boolean jePodMysou(){
  35. return podMysou;
  36. }
  37.  
  38. private class SledovacMysi implements MouseListener {
  39.  
  40.  
  41. @Override
  42. public void onMouseClicked(MouseEvent me) {
  43. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  44. }
  45.  
  46. @Override
  47. public void onMousePressed(MouseEvent me) {
  48. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  49. }
  50.  
  51. @Override
  52. public void onMouseReleased(MouseEvent me) {
  53. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  54. }
  55.  
  56. @Override
  57. public void onMouseEntered(MouseEvent me) {
  58. podMysou = true;
  59. System.out.println("entered");
  60. }
  61.  
  62. @Override
  63. public void onMouseExited(MouseEvent me) {
  64. podMysou = false;
  65. System.out.println("exited");
  66. }
  67.  
  68. @Override
  69. public void onMouseDragged(MouseEvent me) {
  70. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  71. }
  72.  
  73. @Override
  74. public void onMouseMoved(MouseEvent me) {
  75. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  76. }
  77.  
  78. @Override
  79. public void onMouseWheelMoved(MouseEvent me) {
  80. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  81. }
  82. }
  83.  
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement