wiki:FRAME_SIZE_R0

Version 6 (modified by mira, 16 years ago) (diff)

--

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=FRAME_SIZE_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

Overview

The frames size is the width and hight of the frame. In default mode they are the measurements of the frame content. The frame should be able to calculate its size in different modes (including paddings, border and/or margins). A frame could even be bigger than the page. In that case the frames parts which are outside the page`s range will be clipped out and wont be seen in reader mode. In author mode however all frames should be seen in whole.

Task requirements

  • The frame should have properties describing width and hight.
  • Those properties should be equal or grater than 0.
  • The frame should be able to set and get its size in all modes.

Task result

The result of this task is source code.

Implementation idea

  • Create width and hight value properties in the Frame.
  • Create enums for modes if needed.

How to demo

  • Create frame with concrete width and height and check if they are correct.

Design

In the Frame class:

  • Create sizeToDo() property for the size of the frames rectangle in default mode. This is the contents size. The name ends with "todo" because there is size property used by the FrameView to visualize the frame with JComponents. In later revisions (when the JComponents are no longer used and the view is only creating scene elements) it should be changed to just size().
  • There should be Create boundsTodo() Auto property computed by the locationTodo and sizeTodo so that they could be manipulated simultaneously. If it is not created, create it, too.

  • Create the method ImmSize getSize(BoundMode mode). Using the BoundMode enum it should calculate the size of any of the bound modes rectangles.

  • Create the method setSize(BoundMode mode, ImmSize size). The arguments represent the size of any of the bound modes rectangles. Using the BoundMode enum it should calculate the size of the default rectangular. This is the size of the frame content.
  • It uses the BoundMode.getSize method to calculate the size of frame
  • rectangular in the given mode
  • It uses the BoundMode.setSize method to calculate the size to set
  • according to the mode in which it is given.
  • 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/TestFrameSize.java?rev=992

Implementation

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

Testing

Comments

(Write comments for this or later revisions here.)