Skip to content
Snippets Groups Projects
Select Git revision
  • 2dc6df6c1bae48894bd3488f17dd9adf00c740a9
  • main default protected
  • correction_video
  • going_further
  • ImprovedMouseInteraction
  • final2023
  • template
  • ModifGUI
8 results

Coordinate.java

  • Forked from YAGOUBI Rim / Game of life Template
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    DrawerContext.java 679 B
    package shape.Shape_TP5;
    
    import javafx.scene.input.MouseEvent;
    
    public class DrawerContext {
        private DrawerState currentState;
        private Drawer drawer;
    
        public DrawerContext(Drawer drawer) {
            this.drawer = drawer;
            this.currentState = new NullDrawerState();  // État initial
        }
        public void mousePressed(MouseEvent event) {
            currentState.mousePressed(this, event.getX(), event.getY());
        }
        public void mouseReleased(MouseEvent event) {
            currentState.mouseReleased(this, event.getX(), event.getY());
        }
        public void mouseMoved(MouseEvent event) {
            currentState.mouseMoved(this, event.getX(), event.getY());
        }
    }