[[BackLinksMenu]] [[TicketQuery(summary=FRAME_POSITION_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|)]] = 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 frame`s position is the position of its content`s 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. == Related == * [source:trunk/sophie2-platform/doc/spec-diagrams/FrameBounds.png] * [wiki:FRAME_PADDING_R0] * [wiki:FRAME_MARGINS_R0] * [wiki:FRAME_INSETS_R0] * [wiki:FRAME_BOUNDS_R0] * [wiki:FRAME_SIZE_R0] == 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: * Create locationToDo() property for the location of the frames default point in default mode. The name ends with "todo" because there is location 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 location(). * Create boundsTodo() Auto property computed by the locationTodo and sizeTodo so that they could be manipulated simultaneously * Create the method !ImmPoint getLocation(!BoundMode mode, Position pos). Using the !BoundMode and Position enums it should calculate the location of any of the interesting points of any of the bound modes rectangles. * Create the method setLocation(!BoundMode mode, Position pos, !ImmPoint newLocation). The arguments represent the location of any of the interesting points of any of the bound modes rectangles. Using the !BoundMode and !Position enums it should calculate the location of the default point in default mode. This is the location to be set in the Frame. * !TestBoundMode demonstrates the use of those frame bounds functionalities in different modes. [source:trunk/sophie2-platform/modules/org.sophie2.base.model.book/src/test/java/org/sophie2/base/model/book/TestFrameLocation.java?rev=992] = Implementation = [source: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.)