Version 31 (modified by mira, 16 years ago) (diff) |
---|
Analysis
Overview
The FrameBorder is the model for the outer field surrounding the frame content. It is placed between the margins and the content (see the picture). FrameBorders could differ for left, right, top or bottom border. The FrameBorder could have different width and color. It might be realized in different styles. (box, shadow, 3D, repetition of a certain picture, etc.)
Task requirements
- Frame borders should have width. It should be number equal or greater than 0.
- Frame borders should have color.
Task result
The result of this task is source code.
Implementation idea
- Create class FrameBorder extending ProObject with required properties.
- Add FrameBorder border property to the Frame
- Create enums for different property options if needed.
Related
- trunk/sophie2-platform/doc/spec-diagrams/FrameBounds.png
- FRAME_BOUNDS_R0
- FRAME_SIZE_R0
- FRAME_PADDING_R0
- FRAME_MARGINS_R0
How to demo
- Create and show Frames with different borders.
Design
- Add !Insets borderInsets() property for representing border insets into the Frame. They are used by the set/get Location and Size methods in the Frame.
- Add !java.awt.Color borderColor() property for representing border color into the Frame.
- In the SceneColor class add a constructor taking a java.awt.Color for argument and converting it to SceneColor.
- For the scene element creation create FrameBorderRectangle class extending the DefaultSceneElement and implementing the ShapeSceneElement. This class is going to be used for representation of the frame border rectangle and computing the rectangle to vertices so that it could be added to the frameSceneElement and drawn. This class would also override the color() property so that it is computed from the borderColor().
- Add FrameBorderRectangle borderRectangle property to the FrameViewToDo class.
- Add the borderRectangle to the frameSceneElement.
- All the functionality in this task is achieved by adding and compiling properties and there are no new methods or logic to be tested.
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.)