Version 3 (modified by pap, 15 years ago) (diff) |
---|
Analysis
Overview
The goal of this task is to make the managing of the links easier. For this reason remove the "add" button inside the links hud, instead of it add "New Rule" item inside the rule combo box. Here is how the entire hud behaves:
- Case the user selects element that has no links:
- When the Links hud is opened, rule combo box is enabled and has only one element - "New Rule". "Trigger" combo box is enabled as well (everything else is disabled at this point) and the selected item is "choose trigger".
- When the user select some trigger
- New item is added inside the "Rule" combo box and it is selected. This item is the current link that is attached with the selected trigger.
- "choose trigger" item is removed from "Trigger" combo box
- "Action" combo box becomes enabled and the default selected item is "choose action" (represent empty action).
- When the user select action
- "choose action" item is removed from the "Actions" combo box.
- User can now set different parameters for this link. The color boxes became editable. If the action has some parameters that are needed, appropriate controls appear with default values typed/selected.
- Case the user selects item that has links:
- The last added rule for this item is selected and all its parameters are editable.
- If the user selects "New Rule" the hud starts to behave in same manner as in the first case.
Note: If the user add trigger and close the hud, no link will appear under preview mode. However if after a several operations he select the same element and opens the links hud, the hud should be in his previous state (the previous selected trigger should appear, and there is a rule item associated with it).
Task requirements
- Create the described behavior
Task result
- The result should be code
Implementation idea
- described in the overview section
Related
How to demo
- Create a link via hud links
Design
- Create several special items for selecting a trigger, an action and for creating a new rule. These are used to display the appropriate text and also in some logics.
- Create a value property wantedRule that is used to set the rule that is currently being edited.
- Make the currentdRule RwProp a read-only AutoProperty that considers the value of wantedRule and if it is not set returns the last rule of the current link.
- Make the special items skinnable through the skins of the corrensponding controls and the LinksHud.
- Remove the AddLink button and place its logic in the logic handlin trigger selection. It should be executed if the currentRule property is the same as the special EMPTY_RULE item.
- Pending problems
- TextLinksHud's CurrentRule is not updated propely when another interval is selected. This is because the LinkHolder doesn't change. Maybe some method that makes properties update should be added.
- The special "choose action" item is not removed when an action is selected due to the mechanism of updating bound controls.
- See the attached patch. Have in mind that some skinnig and other works needs to be done.
Implementation
- Added skinning to all special items.
- I think that titles may be improved as they seem a bit inconsistent in the sense of small/capital letters.
- The "choose action" item problem was fixed by adding a special "actionUpdateForcer" property that the logic sets with SwingUtilities.invokeLater.
- The TextLinksHud issue resolved by itself :)
- The result is in the attached file named "linksHud-implementation.patch".
Testing
(Place the testing results here.)
Comments
(Write comments for this or later revisions here.)
Attachments
-
linksHud.patch
(16.7 KB) -
added by pap 15 years ago.
Design patch
- linksHud-implementation.patch (21.3 KB) - added by pap 15 years ago.