/** * When the user requests to draw a ellipse, we'll need to notify the data manager, since it * managers the shape in progress. It will update the gui as needed as well. * * @param ae The Event Object. */ @Override public void actionPerformed(ActionEvent ae) { // RELAY THE REQUEST TO THE DATA MANAGER Poseur singleton = Poseur.getPoseur(); PoseurStateManager poseurStateManager = singleton.getStateManager(); poseurStateManager.selectShapeToDraw(PoseurShapeType.ELLIPSE); }
/** * Entry point for the Poseur application, code starts its execution here. This method simply * inits the Poseur singleton and starts up the GUI. * * @param args Command line arguments are not used by this application. */ public static void main(String[] args) { // HERE IS THE CONSTRUCTION OF THE SINGLETON Poseur OBJECT, // SINCE THIS IS THE FIRST REFERENCE TO getPoseur. THE CONSTRUCTOR // WILL FULLY SETUP THE Poseur DATA AND GUI FOR USE. Poseur app = Poseur.getPoseur(); app.init(); // GET THE GUI AND START IT UP PoseurGUI window = app.getGUI(); window.setVisible(true); int a = 0; a++; }