[[BackLinksMenu]] [[TicketQuery(summary=ANNOTATIONS_STICKIES_R1, 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 == The goal of this revision is to add more interactivity to stickies - text editing and dragging. == Task requirements == * The default background color should be yellow, semitransparent (red=100%, green=100%, blue=20%, alpha=75%). * The text color of stickies should be non-transparent and: * Black - if the brightness (see below) of the background is more than 50% * White - otherwise (optional, if HotText allows it). * The brightness is the luma, the Y component of the color in YUV color space. * Add Hot Text to stickies so they can be edited. * Only plain text editing functionality is required. * When removing a sticky, confirmation dialog should be displayed only for non-empty stickies. * Create a halo button for moving stickies with the mouse. * Use the same button as the frame move button. * Place the button to the left of the remove button. * In later revisions a title bar like frame's future title bar will be needed. * (optional) Create a halo button for changing sticky's background color. The alpha value should not be changed (75%). * Reuse as much as possible of the code for the same functionality for frames. == Task result == Source code. == Implementation idea == * The halo button should be of type {{{MoveHaloButton}}}. * Add it to {{{StickyHaloMenu}}}. * In {{{StickyRemoveButton}}} change the condition to {{{if (sticky.text().get().length() > 0)}}}. == Related == * [wiki:GROUP_ANNOTATIONS_R0] == How to demo == * Run Sophie and create a new book (if no book is available). * Go to the Stickies palette. * Create a new sticky. * Type some text in it. * Drag the move halo button to move the sticky. = Design = * Rename the classes {{{SceneStickyView}}} and {{{SceneAudioAnnotationView}}} to {{{StickyView}}} and {{{AudioAnnotationView}}}, respectively. [[Image(source:/branches/private/mitex/annotations-r1/sophie2-platform/doc/uml-design-diagrams/PageElementMoveHalo.png)]] * Create a class {{{org.sophie2.main.app.halos.pageelement.PageElementMoveHaloButton}}} which extends {{{MoveHaloButton}}}. * method {{{protected ImmRect translateRect(ImmRect bounds, int newX, int newY)}}} that translates a rectangle. * pull up the property {{{workArea}}} (from {{{FrameMoveHaloButton}}}). * Create a class {{{StickyMoveHaloButton}}}. * {{{FrameMoveHaloButton}}} and {{{StickyMoveHaloButton}}} should extend {{{PageElementMoveButton}}}. * Add {{{StickyMoveHaloButton}}} to {{{StickyHaloMenu}}}. * In StickyRemoveButton change the condition to {{{if (sticky.text().get().length() > 0)}}}. * HotText: ........... * Text color: * Create {{{textColor}}} auto property of type ImmColor in {{{StickyView}}}. * Return color according to the analysis requirements above. * Use the following formula for the brightness: * Y = 0.2126 R + 0.7152 G + 0.0722 B. * Apply that color to the sticky's title. * Source code: [source:/branches/private/mitex/annotations-r1/] = 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.)