wiki:GROUP_FILLING_R0
Last modified 11 years ago Last modified on 05/28/09 22:33:39

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

Error: Macro TicketQuery(summary=GROUP_FILLING_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

In the end of this task Sophie 2.0 will provide functionality for filling the page/frame with various backgrounds. There will be solid, image, pattern and gradient backgrounds which can be choosen by Sophie user.

Task requirements

  • The frame/page could be filled with GRADIENT of two colors. The gradient could be two types - linear and radial. There should be two different option of frame filling - LINEAR GRADIENT and RADIAL GRADIENT.
    • If the RADIAL GRADIENT filling is chosen, frame/page should be filled with radial gradient of the two filling colors.
    • If the LINEAR GRADIENT filling is chosen, frame/page should be filled with radial gradient of the two filling colors.
    • Every time the user chooses different first or second filling color from the hud the filling changes.
    • The default colors for GRADIENT are white and black.
    • The gradient should be persistable.
  • The frame/page could be filled with one SOLID color chosen by a color picker in the frame/page appearance hud.
    • If the STRONG filling is chosen, frame/page should be filled with the filling color.
    • Every time the user chooses filling color from the hud the frames filling changes.
    • The default option for filling is NONE.
    • If the user chooses the NONE filling type it should behave as STRONG filling with white color, opacity 1. This should not affect the first color in the frame model.
  • The frame/page could be filled with a single image.
    • If the user chooses the IMAGE filling type a image square should be shown instead of a color picker on the right.
    • Initially it is white. The user can choose a image for the filling by drag and drop one from the resources palette.
    • The frame/page should be filled with this image. Initially the frames size and shape are changed to fit the picture best.
    • If the frames/pages size property is locked or the user changes the size of a frame/page after a image is already added to it the image is stretched to fit the frame.
  • The frame appearance hud should be refactored to fulfill the upper requirements.

Task result

source code with visible result

Implementation idea

  • The scene elements color should be auto calculated from the filling color in the frame model. Use the java.awt.Graphics2D methods to setPaint and fill the frame.
  • For the gradient add a second color to the shape scene elements. When creating the scene shape element compute its filling type and colors from the model. Use the java.awt.Graphics2D methods to setPaint and fill the scene element according to its type and color.

SCENE_COMMONS_R0
SCENE_COMMONS_R1
PAGE_HALO_AND_HUD_R0

How to demo

  • Show the new filling using page/frame halo and hud.

Design

  • Research is made for the gradient - the fastest way to do this task is to use the dialog JXGradientChooser again. This is from swinglabs library - add it in the dependency sections and in nexus server if needed.
    • Note: JXGradientChooser has method showDialog which return the true MultipleGradientPaint. The method getGradient don't return it.
  • Create ImmGradient class which has to wrap the MultipleGradientPaint(this is from batik library). It has to be immutable and not to exposure anything from MultipleGradientPaint. It should have method which returns the MultipleGradientPaint object created by the ImmGradient fields.
  • Create interface with name ImmFilling and with method fill with Graphics2d and shape arguments. Create method void transform(ImmColor immColor) which will transform the filling object with the given immutable color so that the transparency can be implemented easily. It will be implemented by ImmColor, ImmImage and ImmGradient - these will be the filling types of the ShapeElements.
    • For the ImmImage use drawImage method and shape coordinates to fit the image in the frame correctly.
  • In the ShapeSceneElement add new "filling" property which will represent the shape filling and will contain a Filling object.
  • In the ShapeElementHelper implement drawContent - the fill method should be called from there for each Filling object.
  • To keep the transparency active for now(for release purposes for example) check the filling instance - if it is color getEffectiveColor has to be called to make the color transparent(this should be improved for the other revisions).
  • In FrameView and PageWorkArea in the backgroundElement you have to switch between background types and set the filling property depending on that.
  • Implement this task in parallel with GROUP_PAGE_PROPERTIES_R0 so it can be demonstrated as it is described in how to demo section.
  • Make sure that all functionality run through true author main launcher.
  • Because the task was timeboxed the pattern filling will be implemented in next revisions.

Test for ImmGradient: 2608.

Design related code merged to the trunk in [2626].

Implementation

The implementation is done with the following changes:

  • MultipleGradientPaint is not wrapped - ImmGradient is just compatible with it.
  • The transparency is kept - for every filling object there is transform method in the Filling interface which multiplies the color and create transparency effect.
  • Group page properties is totally overlaped by this task.

. Revisions are: [2612], [2613], [2614], [2635], [2714], [2898], [2912], [2922]

Testing

(Place the testing results here.)

Comments

(Write comments for this or later revisions here.)

Attachments