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
- Move the SceneColor to org.sophie2.base.util and rename it to ImmColor. Add a constructor which takes java.awt.Color for argument.
- Add two properties to the ShapeSceneElement
- lineStyle() - the style to apply when drawing the shape`s outline. Also create LineStyle enum representing the different styles that can be drawn.
- isFilled() - if it is true the shape should be filled with color.
- Add drawShapeElement method to the SimpleSceneEngine for the shape elements drawing. It should draw them applying the outline and filling properties.
- For the border scene element creation create BorderSceneElement class extending the DefaultSceneElement and implementing the ShapeSceneElement. This class is going to be used for representation of the frame border and computing the border to vertices. They will be represented like a filled polygon and without any outline. This class would override the color() property so that the shape element color is computed from the borderColor().
- For the scene element representing the middle of the border create FrameMidBorderRectangle class extending the DefaultSceneElement and implementing the ShapeSceneElement. This class is going to compute the rectangle to vertices so that it could be added to the frameSceneElement and drawn. It should be drawn with a dashed black outline, non filling.
- Add BorderSceneElement border property to the FrameViewToDo class.
- Add FrameMidBorderRectangle midBorder property to the FrameViewToDo class.
- Add the border and the midBorder to the composite frameSceneElement. The midBorder rectangle will be added to the frame scene element to be drown only if the option showFrameBorders() in the PageViewToDo is true. In R0 it is always true.
Implementation
[1302]
[1304]
[1307]
[1308]
[1309]
Testing
User documentation
ITERATION_04/Release/UserDocumentation/04_WorkingWithFrames/02_SettingBordersAndFills
Release documentation
In Release 2, the user can set borders on frames and change the width and color of the border.
Manual tests
Main tests
Related tests
(none so far)
Reported bugs
(none so far)
Comments
This test will need to be revised when there are border styles (not solid lines) available.