Skip to content
Snippets Groups Projects
DrawerContext.java 696 B
Newer Older
  • Learn to ignore specific revisions
  • BasileCouetoux's avatar
    BasileCouetoux committed
    package state;
    
    
    import javafx.scene.input.KeyEvent;
    import javafx.scene.input.MouseEvent;
    
    public class DrawerContext {
    
        Drawer drawer;
        DrawerState currentState;
    
        public DrawerContext(Drawer drawer) {
            this.drawer = drawer;
        }
    
        void mousePressed(MouseEvent event){
            currentState.mousePressed(this,event.getX(),event.getY());
    
        }
    
        void mouseReleased(MouseEvent event){
            currentState.mouseReleased(this,event.getX(),event.getY());
        }
    
        void mouseMoved(MouseEvent event){}
    
    
    COUETOUX Basile's avatar
    COUETOUX Basile committed
        public void keyPressed(KeyEvent event) {
    
    BasileCouetoux's avatar
    BasileCouetoux committed
            switch (event.getText()) {
                case "c":
                    currentState = new StateCircle0();
            }
        }
    }