[[BackLinksMenu]] [[TicketQuery(summary=HALOS_REDESIGN_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 is a list with some features that could be done: * Halos and huds become part of the scene * If halos and huds are part of the scene, they could be transparent, rotated and other effects could be applied to them. (Think if we need this now.) * Huds and HudHaloButtons * When the mouse is over a HudHaloButton, the hud appears. * When the mouse is clicked over a HudHaloButton, the hud is pinned. * The hud appears under the hud halo button it is connected to. * The halo menu can have not more than one active hud. When the user pins a second hud, the first one get unpinned and disappears. * Make extensible huds (just like in Sophie 1). When the extension button is clicked, extension of the hud appears/disappears. Extension of a hud is a part of the hud that has own visibility property. * The size of the hud depends on the size of its subcomponents. * The subhud should align with the sub hud button. * Change the hud halo button icon depending on hud visibility. * Change the hud halo button icon if mouse is pressed, rolled, if the halo is disabled. (selected or normal mode) * Improve frame rotation * Change rotation center * More intuitive == Task requirements == * Prioritize task from the list. * Decide which are needed to be done and which are optional. * Fix the tasks that needs to be done. == Task result == * The result of this task should be source code. == Implementation idea == * Halos and huds become part of the scene - optional. * When the mouse is over a HudHaloButton, the hud appears - optional. * When the mouse is clicked over a HudHaloButton, the hud is pinned - optional. * The hud appears under the hud halo button it is connected to - needed. * The halo menu can have not more than one active hud - needed. * Make extensible huds - needed. * The size of the hud depends on the size of its subcomponents - needed. * The subhud should align with the sub hud button - needed. * Change the hud halo button icon depending on hud visibility - needed. * Change the hud halo button icon if mouse is pressed, rolled, if the halo is disabled. (selected or normal mode) - optional. * Improve rotation - optional. == Related == * [wiki:GROUP_GUI_REDESIGN_R0] == How to demo == * Demonstrate the new features and source code. = Design = * LogicR3: * In {{{HaloButton}}} remove the method {{{userClick}}}. * Create enum {{{HaloEventIds}}}: * {{{HALO_CLICK}}}, * {{{HALO_MOUSE_OVER}}}, * {{{HALO_MOUSE_EXITED}}}. * In {{{HaloButton.swingComponent}}} replace the call to {{{userClick}}} with firing an R3 event {{{HALO_CLICK}}}. * Refactor all subclasses - move the logic in {{{userClick}}} to R3 logic enums. * In {{{HaloButton.swingComponent}}}, in the {{{create}}} method, add new mouse listener: * {{{mouseEntered}}} should fire {{{HALO_MOUSE_OVER}}} event, * {{{mouseExited}}} should fire {{{HALO_MOUSE_EXITED}}} event. * '''The hud appears under the hud halo button it is connected to:''' * Refactor {{{HudDialog.swingComponent}}}: * In the {{{setup}}} method: * Calculate the top left point of the hud - it should be exactly below the bottom left corner of the corresponding button (get the button with the parent property). * Call {{{res.setLocation}}}. * Be sure to test the hud location when the zoom level is not equal to 100%. * Remove the method {{{HaloMenu.syncHud}}} and all calls to it. * '''The halo menu can have not more than one active hud:''' * Create a property {{{RwProp activeHud}}} in {{{HaloMenu}}} that represents currently open hud dialog. * Its value is null, when no hud is open. * Add a resource property that sets the {{{shown}}} property in all huds that are related to {{{HudHaloButtons}}} in this menu: * {{{shown}}} should be true if and only if {{{activeHud}}} points to that hud. * '''Make extensible huds:''' * Extensions should be defined as different huds, whose {{{JPanel}}}s are attached to the parent hud. * Make a property {{{@Own Prop extensionHud}}} in {{{HudDialog}}}, analogical to {{{HudHaloButton.hud}}}. * Add a resource property {{{extensionShowButton}}} that defines a button that sets {{{shown}}} of the extension hud to be true. * Add a resource property {{{extensionHideButton}}} that defines a button that sets {{{shown}}} in this (not the extension) hud to be false. * Add a resource property {{{extensionShowHidePanel}}}: * If {{{extensionHud}}} is not null and the extension hud is not shown, add the Show button. * If this hud is an extension hud and {{{shown}}} is true, add the Hide button. * In {{{HudDialog.swingComponent}}}, {{{setupElements}}}, add the {{{extensionShowHidePanel}}}. * '''The size of the hud depends on the size of its subcomponents:''' * Remove the constant {{{HudDialog.HUD_SIZE_PROP_ID}}}. * In all huds remove the skin records with {{{HUD_SIZE_PROP_ID}}}. * In {{{HudDialog.computeSize}}} use the sizes of all swing components of the items in the {{{elements}}} list: * The height should be the sum of all heights, plus the gap from the layout for each item ({{{FlowLayout.getVGap}}}), plus 2*BORDER_SIZE. * Add the height of {{{extensionShowHidePanel}}} too. * The width should be the maximum width of all elements, plus 2*{{{FlowLayout.getHGap}}}, plus 2*BORDER_SIZE. * '''The subhud should align with the sub hud button:''' * After implementing previous bullets, huds are aligned with their parent element. That logic will be used here too. * '''Change the hud halo button icon depending on hud visibility:''' * Make {{{HudHaloButton}}} to extend {{{SwitchHaloButton}}}. * Remove the TODO comment in the Javadoc. * Override {{{SwitchHaloButton.computeState}}}. * It should return State.ON when {{{hud().get().shown().get()}}} is true and State.OFF otherwise. * In all subclasses of {{{HudHaloButton}}} replace the record {{{ICON_PROP_ID}}} with two skin records: * ICON_OFF_PROP_ID - the default icon. * ICON_ON_PROP_ID - the icon that will be used when the hud is visible. * Use the icons provided by Shift Global. * Source code: [source:/branches/private/mitex/halos-redesign-r0/] * Tests: [source:/branches/private/mitex/halos-redesign-r0/modules/org.sophie2.base.halos/src/test/java/org/sophie2/base/halos?order=date&desc=1] = Implementation = * The design was extended with the following: * In {{{BaseSwingVisualElement}}}: * Skin property-id {{{SIZE_PROP_ID = "size"}}} * {{{protected ImmSize computeSize() { return getSkinValue(SIZE_PROP_ID, ImmSize.class); } }}} - By default the size of the swing component is the size defined by the skin. This can be overridden. * Resource property {{{syncSize}}} that sets the size of the {{{swingComponent}}} to the return value of {{{computeSize}}}. * Source code: [source:/branches/private/mitex/halos-redesign-r0/] * Revisions: [4714], [4786], [4787], [4794], [4797], [4815], [4848], [4850], [4851] * Commited to trunk in 4922 = Testing = ^(Place the testing results here.)^ = Comments = * If the huds are part of the scene, they could not be drawn outside of the page work area (see [http://sophie2.org/trac/ticket/1715]) --mitex@2009-07-27. * dido: 2009-07-28 * Here is a list of things that you have to keep in mind while implementing this. * First of all if the hud appears on roll over some halo button, the area could become sensitive and a lot of undesired huds could start popping up. This could be partially avoided by adding some delay. My personal opinion is that this should be first developed as prototype and then take decision is this going to be the final behavior. Same applies for pinning, positioning and "only on visible hud". It may happen that the behavior we have at this point is more appropriate. Please focus on other topics first. * Those two '''Change the hud halo button icon depending on hud visibility.''' and '''Change the hud halo button icon if mouse is pressed, rolled, if the halo is disabled. (selected or normal mode)''' looks like the same for me. * '''Halos and huds become part of the scene''' - for this one please make sure that doesn't effect the performance of the application. * Related section is not finished please review and add following tasks * [wiki:GROUP_BASE_HALOS_AND_FRAME_POSITION_R1] * [wiki:BASE_HALOS_R1] * Peko and me are working on adding new skins for the entire application, please communicate with us and Deyan. Analysis Reviewed 3.5p (1h) * pap@2009-08-94 : There are issues with the hud extensions. These should be rethought as behavior and reimplemented.