Last modified 16 years ago
Last modified on 07/10/09 19:44:42
Analysis
Overview
Frame position can be now set by changing values in a HUD or by dragging the frame move halo. The frame move halo should be replaced with a frame title bar which is draggable and moves the frame around.
- The title bar should be at the top of the frame
- Height - the title bar height is equal to halo height + title bar padding. Title bar height doesn't need to be recalculated
- Width - the title bar should contain all needed halos + frame (group) title. This means that minimum witdth is equal to number of halos + space between them + title bar padding + frame name. For selections, the title bar should not be shorter than halos + space between them + padding + amount of pixels (for example - 10)
- Color - the title bar should be semi transparent and should allow changing opacity (and color) on mouse over and mouse pressed.
Task requirements
Create the frame title bar
- This is generally a draggable halo that stays behind the other halos
- Cover the functionalities from the overview
- Height
- Width
- Color
- The position of the title bar depends on upper halo menu position - title bar is behind other halos.
- When the frame is small, the halos should appear the following way:
- Introduce another rectangle, relative to the minimal size needed for the title bar.
- Optional - include frame (group) name in the frame title bar. Selections do not need to have titles.
- Implement halo aligning (left and right at the same time for top halo menu)
Task result
Source
Implementation idea
Implement with BASE_HALOS_R1
Related
FRAME_POSITION_R0 BASE_HALOS_R1
How to demo
- Insert a frame
- Move the frame
- Make the frame tiny (1x1px)
- Move the frame again
- Deselect the frame
Design
- Remove FrameMoveHaloMenu class.
- Make MainHaloMenu a parent of FrameRemoveHaloButton.
- FrameMoveHaloButton is replaced by a new class MainTitleBar extending AbstractHalo having the following functionalities.
- Mouse click and movement handling from FrameMoveHaloButton.
- Override parent(), computeTitle(), computeSize() and computeVisible() methods.
- The MainHaloMenu is the parent
- The size of the title bar is calculated as specified
- The height is equal to the biggest height of all halo buttons + padding
- The width is the maximal value between the width of the frame and the cumulative width of the halos + side padding + halo spacing + frame (group) name length calculated with default font.
- MainTitleBar will be attached to MainHaloMenu in a custom way (can not be done automatically like halo buttons).
- MainHaloMenu.titleBar() will be added with @Own annotation.
- MainTitleBar's swingComponent will be added to MainHaloMenu after all halo buttons (thus having highest z-order) so that it is drawn first.
- HaloMenu class is changed.
- locationSync() method modified to consider right alignment of buttons on the menu (needed for FrameRemoveHaloButton).
- HaloMenu.computeSize() protected method added.
- HaloButton.alignment() added to specify the needed alignment of the halo button on its parent.
- MainTitleBar.color() added to specify the color of the title bar (including opacity) which may change on mouse enter and mouse exit.
- Color is internal and customization will not be allowed for now. It could be added to the skin later, but not other user interaction is expected.
- Modify FrameRotateHaloMenu.computeLocation() to move rotate halo menu to the bottom right point of the frame.
- Testing
- Existing unit tests in org.sophie2.base.halos.
- Demo test
- Start HalosDemo.
- Select a frame
- There should be no frame move menu.
- There should be no move frame halo button.
- The remove frame halo button should be right aligned.
- Frame movement should be possible when dragging the title bar.
- Prototype committed to:
Implementation
(Describe and link the implementation results here (from the wiki or the repository).)
Testing
(Place the testing results here.)
Comments
(Write comments for this or later revisions here.)
Attachments
- frame2.jpg (45.8 KB) - added by deyan 16 years ago.
- smallframe.png (3.7 KB) - added by deyan 16 years ago.
- rotatedframe.png (4.2 KB) - added by deyan 16 years ago.