[[BackLinksMenu]] [[TicketQuery(summary=BASE_HALOS_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|)]] = Analysis = == Overview == This task requires a base implementation of the Halos. The idea is to have a base hierarchy in a separate module that the actual implementation classes use. == Task requirements == * Create a module org.sophie2.base.halos * Extract the base hierarchy for Halos and put it in that module. (all halos are now in the org.sophie2.main.view module). * Create a UML diagram for the base classes. * Make the org.sophie2.view.main dependable on the org.sophie2.base.scene module. * Review currently implemented classes of halo buttons, menus, huds. * Provide a general explanation of how new halos should be implemented. * How should one create a HUD. * How should one create a Halo Button. * How should one create a Halo Menu. == Task result == * wiki content with the explanations. * diagrams * source code * new module in sopehie2-platform. == Implementation idea == * create the module. * fix the halos. * create other things described in Task Requirements section. == Related == * a similar things is already done by [wiki:BASE_LAYOUT_R0] * see org.sophie2.base.layout module and see how are things done there. * base halos should be done in a similar way. == How to demo == * open the corresponding wiki page given in the design or implementation section. * see if everything is clear. * diagrams * explanations * open eclipse * see if org.sophie2.base.halos exists * run the demo * run the tests * examine source code. = Design = * New things: * A module org.sophie2.base.halos will be created. * module org.sophie2.main.view will depend on the former. * the new module will provide the base hierarchy of halos. * Diagrams: * Hierarchy diagram for halo buttons and huds. They both have a visual representation - the !HaloSceneElement that has a JComponent. [[Image(source:/trunk/sophie2-platform/doc/uml-design-diagrams/HaloButtonAndHud-uml.png)]] * Here is the diagram for the !HaloMenu: [[Image(source:/trunk/sophie2-platform/doc/uml-design-diagrams/HaloMenu-uml.png)]] * it is responsible for: * displaying the buttons. * computing its size and location. * computing the container for the buttons in it. * Howtos: * in order to create a !HaloButton: * one should extend the corresponding button type. * override its abstract methods. * create an icon that should be with a png extension. Remember to put the extension with lowercase since linux and other OSes are case sensitive. The icon should be put in the org.sophie2.base's resource folder where the other icons reside. * in order to create a !HaloMenu: * one should decide which buttons are to be put in it. * extend the !HaloMenu class. * implement the methods that are abstract in the !HaloMenu. * For more information about how to do things, see the corresponding javadoc in the source code. * Demo: [source:/trunk/sophie2-platform/modules/org.sophie2.base.halos/src/test/java/org/sophie2/base/halos/HalosDemo.java HalosDemo] = Implementation = * done according to design. * unit tests added. * old tests refactored. * module created. * diagrams exported. * simple explanation of how things should be done. = Testing = = Comments = * Should be able to manage global layers for all halos. Currently the menu manages layers of the buttons. Should be able to manage layers also between menus, since now buttons between menus are incorrectly overlapped.