Analysis
Overview
Frame`s location can be calculated relation to 9 different points of the frame - TOP_LEFT, TOP_MIDDLE, TOP_RIGHT, MIDDLE_LEFT, MIDDLE, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_MIDDLE, BOTTOM_RIGHT.
Task requirements
- Those 9 points should be represented by 9 radio buttons arranged in a square 3x3 in the frame properties hud.
- The default value should be TOP_LEFT. This means that the upper leftmost of the dots should be selected.
- When the user changes the special point from the hud the values for X and Y are recalculated as the coordinates of the new point.
- When the user changes the X and/or Y values in the hud, the frame is moved so that the chosen special point is placed to the designated coordinates.
Task result
The result of this task is source code.
Implementation idea
Create 9 radio buttons in the frame hud arranged accordingly. Auto compute the X and Y coordinates of the special point by the getLocation method in the Frame. It takes special point as argument. When the value of the X and Y boxes changes in the hud use the setLocation method in Frame to set the new frame coordinates. It takes special point as argument.
Related
How to demo
- Open the frame hud and move its special point demonstrating the recalculation of the X and Y observing the location of the chosen point.
- Move the frame by its bottom right most corner.
Design
Implementation
(Implementation results should be described and linked here (from the wiki or the repository))
Testing
Comments
(Write comments for this or later revisions here.)