wiki:FRAME_BOUNDS_R0
Last modified 6 years ago Last modified on 01/07/09 13:15:22

Ticket Summary Owner Status Type Component Priority Effort Importance
#739 FRAME_BOUNDS_R0 mira closed planned_task FRAME_PROPERTIES 3 0.5 15

Reported by Astea, 6 years ago.

Description

wiki page: FRAME_BOUNDS_R0 - effort: 0.5d

Analysis_owners

mira

Analysis_reviewers

tanya

Analysis_score

3

Design_owners

mira

Design_reviewers

-meddle, tanya, tanya

Design_score

3.5

Imp._owners

mira

Imp._reviewers

tanya, jani

Imp._score

3

Test_score

0

Analysis

Overview

The frame bounds are the frame size, position and Z order. There are 5 modes in which frame`s bounds could be calculated - Margins mode, Out-Border mode, Mid-Border mode, Padding mode (which is the same as In-Border mode) and Context mode. See trunk/sophie2-platform/doc/spec-diagrams/FrameBounds.png. Those modes determine the rectangular all coordinates are related to. The default mode is the Content mode. There are also 9 special points that could be observed when calculating frame coordinates - TOP_LEFT, TOP_MIDDLE, TOP_RIGHT, MIDDLE_LEFT, MIDDLE, MIDDLE_RIGHT,BOTTOM_LEFT, BOTTOM_MIDDLE, BOTTOM_RIGHT. The default one is the TOP_LEFT. For example in Padding mode and for TOP_RIGHT special point, the frames position is the position of the upper right point of the padding rectangular and the frame size is calculated including the paddings.

Task requirements

  • There should be representation of those modes and points.
  • There should be options for setting and getting the bounds in all modes and relating to all special points.

Task result

The result of this task is source code.

Implementation idea

  • Create needed enums representing the needed modes and points.

How to demo

  • Demonstrate calculating the bounds of a frame using different modes and points.

Design

  • Create enum BoundMode:

MARGINS, OUT_BORDER, MID_BORDER, IN_BORDER, CONTENT;

  • Create method setSize(ImmSize sizeToSet). It should take as argument the size in the current mode and calculate and return the size in default mode. This is the size of the frame content to be set.

  • Create method ImmSize getSize(). It should calculate and return the size of the rectangle in the current mode.
  • Create method setLocation(ImmPoint locationToSet). It should take as argument coordinates of the current mode rectangle. It should calculate and return the location in default mode. This is the location of the frame content to be set.

  • Create method ImmPoint getLocation(). It should calculate and return he location of of the rectangular in the current mode.
  • There should also be getRect(ImmRect contentRect) and ImmRect setRect() methods using the above for getting and setting a Rectangular in current mode.
  • TestBoundMode demonstrates the use of those frame bounds functionalities in different modes.

trunk/sophie2-platform/modules//org.sophie2.base.model.book/src/test/java/org/sophie2/base/model/book/TestBoundMode.java?rev=991

Implementation

Testing

Comments

(Write comments for this or later revisions here.)