wiki:FRAME_POSITION_R0
Last modified 3 years ago Last modified on 02/03/09 15:35:46

Pages linking to FRAME_POSITION_R0:
FRAME_BOUNDS_R0
TASK_INDEX
FRAME_TEMPLATES_R0

Ticket Summary Owner Status Type Component Priority Effort Importance
#749 FRAME_POSITION_R0 mira closed planned_task FRAME_PROPERTIES 3 1 10

Reported by Astea, 4 years ago.

Description

wiki page: FRAME_POSITION_R0 - effort: 1d

Analysis_owners

mira

Analysis_reviewers

orliin,boyan

Analysis_score

3

Design_owners

mira

Design_reviewers

meddle, tanya, tanya

Design_score

3

Imp._owners

mira

Imp._reviewers

tanya, jani

Imp._score

3.5

Test_owners

danvisel

Test_reviewers

deyan

Test_score

3.5

Analysis

Overview

Frames coordinates are calculated in relation to the upper left angle of the page which has coordinates (0,0). In default mode the frames position is the position of its contents upper left point, however a frame should be able to set and get its position in all modes(including borders, margins, etc.) and for different special points (middle, right angle, etc). A rotation will be kept in the model only by the angle, so the position should change when rotating also. Frames could overlap and/or not fit into the page. Even when some frames or frame parts are outside the page`s range they are still a part of the working area and should be seen in author mode. They however should be clipped out in reader mode so that the reader stays unaware of them.

Task requirements

  • The frame should have only properties defining its position (x, y for example) in default mode.
  • A frame should have get and set methods for position in all modes and for all special points.

Task result

The result of this task is source code.

Implementation idea

  • Add position() property to the Frame for the default coordinates.
  • Add methods with mode and special point arguments for setting and getting this position.

How to demo

  • Create frame with concrete coordinates and check if they are correct.
  • Change the frames coordinates in different modes and relative to different points and check that its position is updated correctly.

Design

In the Frame class:

  • Rename the location() property which is used for the location of the frame content`s upper left corner to contentLocation() for more clearance.
  • Create the method ImmPoint getLocation(BoundMode mode, Position pos). It uses the BoundMode.getRect() method to get the frame rectangular in the given mode and the Position.getPoint() method to get the location of the given position of this rectangular.

  • Create the method setLocation(BoundMode mode, Position pos, ImmPoint newLocation). The method uses the Position.setPoint to calculate the location to be set according to the given location and the BoundMode.setLocation method to calculate the location to be set according given mode.
  • TestFrameLocation demonstrates getting and setting frame positions in different modes ad according to different positions.

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

Implementation

trunk/sophie2-platform/modules//org.sophie2.base.model.book/src/main/java/org/sophie2/base/model/book/Frame.java?rev=1164

Testing

User documentation

ITERATION_04/Release/UserDocumentation/04_WorkingWithFrames/01_ChangingTheSizeAndPositionOfAFrame

Release documentation

In this release, the user should be able to move the frame both by the move halo and the frame size/position HUD. Moving via frame size/position HUD is relative to upper left corner of the frame.

Manual tests

Testlink test ids: 765

Main tests

Testlink test ids: 765

Related tests

(none so far)

Reported bugs

(none so far)

Comments

(Write comments for this or later revisions here.)