Ticket #2307 (closed tweak: obsolete)

Opened 10 years ago

Last modified 8 years ago


Reported by: deyan Owned by: deni
Priority: major Milestone: X3
Component: uncategorized Version: 2.0
Keywords: Cc:
Category: unknown Effort:
Importance: 55 Ticket_group:
Estimated Number of Hours: 0 Add Hours to Ticket: 0
Billable?: yes Total Hours: 0
Analysis_owners: deyan Design_owners: deni
Imp._owners: deni Test_owners:
Analysis_reviewers: deni Changelog: Changelog
Design_reviewers: pap Imp._reviewers:
Test_reviewers: Analysis_score: 4
Design_score: 3 Imp._score: 3.5
Test_score: 0

Description (last modified by deyan) (diff)

Make a red mask with 50% opacity to appear when a template is about to be applied. See DragNDrop. Depends on #2308


dnd-visual-indication-templates.patch (17.7 KB) - added by deni 10 years ago.

Change History

comment:1 Changed 10 years ago by deyan

  • Description modified (diff)

Batch update from file 2401.csv

comment:2 Changed 10 years ago by dido

  • Category set to unknown
  • Analysis_score set to 0
  • Importance set to 55
  • Test_score set to 0
  • Design_score set to 0
  • Imp._score set to 0

comment:3 Changed 10 years ago by deni

  • Owner set to deni
  • Status changed from new to s1a_analysis_started

comment:4 Changed 10 years ago by deni

  • Status changed from s1a_analysis_started to s1b_analysis_finished

comment:5 Changed 10 years ago by deni

  • Status changed from s1b_analysis_finished to s1c_analysis_ok
  • Analysis_score changed from 0 to 4
  • We should discuss whether the same mask should be used when changing the main resource of a frame.

comment:6 Changed 10 years ago by deni

  • Status changed from s1c_analysis_ok to s2a_design_started

comment:7 Changed 10 years ago by deni

  • Design_owners set to deni
  • Status changed from s2a_design_started to s2b_design_finished
  • Imp._owners set to deni
  • Analysis_reviewers set to deni

General ideas:

  • We will use SophieDragDropHandler.TransferEventIds.DND_PRE_IMPORT not only to show whether the transferred data can be dropped or not, but also to add visual clues to what will happen when the data is dropped.
  • This means that we can no longer handle pre-import to the whole page work area in ScenePageLogic.ON_DND_PRE_IMPORT. This operation will be removed.
  • Instead, for each operation for DND_IMPORT we should add a corresponding operation for DND_PRE_IMPORT. It is advisable that they are in the same logic class, next to each other and with almost identical sort keys.
    • The sort keys are essential because sometimes more than one operation can handle an event and the operation with a better sortkey will be called first. It is very important that if ON_DND_IMPORT_1 is called before ON_DND_IMPORT_2, its corresponding ON_DND_PRE_IMPORT_1 is called before ON_DND_PRE_IMPORT_2.
  • The ON_DND_PRE_IMPORT operations will generally do the following:
    • Get the DndPreImport object from the event.
    • Call DndPreImport.setImportable(Class<? extends DndData>...) with arguments the DndDatas their corresponding import operations work with.
    • Use DndPreImport.getImportable() to check whether the event should be handled or not.
      • If the check whether to handle the event or not (in the import operation) is more complex than the type of the DndData, it should be repeated in the pre-import operation. I'm afraid this can make these operations too complex :-(
    • Set the appropriate visual indication (usually some properties in the views).
  • The actual visual indication will be a rectangular ShapeSceneElement in FrameView or MainPageView.
    • It cannot be a ColorEffect to the existing scene element of a frame or page, because the mask should be visible even when the background is transparent. Besides, it would be better if the mask is applied to the whole frame when applying a template, but only to the background (without the border) when changing the background.
    • There should be rw properties for controlling the color and the shape of the element.
      • In FrameView these can be ImmColor and BoundMode.
      • I'm not sure about MainPageView, but I'm thinking of ImmColor and ImmRect.
    • There should be a private AutoProperty constructing the scene element.
  • Each ON_DND_PRE_IMPORT operation will set the rw properties appropriately.
  • In order to remove the indication when no longer necessary:
    • There will be an operation that sets the color to transparent when the mouse leaves the frame or page.
      • We cannot use the current MOUSE_EXITED event, because it is not thrown at all.
      • SceneInteractionLogic.SCENE_DND_OPERATION should be modified to keep track of the mouse over element. When it changes it should fire the appropriate enter and leave events. I think that they should be different from MOUSE_ENTERED and MOUSE_EXITED. We can add DRAG_ENTER and DRAG_EXIT and throw them.
    • Each ON_DND_IMPORT operation will also clear the color.

Dnd indication for applying templates:

  • Adding visual indicators:
    • In LibraryTabLogic add the following operations:
      • ON_FRAME_TEMPLATE_DND_IMPORT_FRAME that handles pre-importing (dragging) a template over a FrameView.
      • ON_PAGE_TEMPLATE_PRE_IMPORT that handles pre-importing (dragging) a template over a PageView.
    • In PagePreviewPaletteLogic modify ON_DND_PRE_IMPORT to add the appropriate indication if a template will be applied.
      • The logic of deciding what to do with a template (apply it or create a new page) should be somehow extracted from ON_DND_APPLY_TEMPLATE
      • Please note, that the indication will be visible not only in the page thumbnail (as in ), but also in the page itself if it is current. We should discuss it with the experience team, but I think it is logical to be so and it will be ok with them.
    • In PageStructurePaletteLogic modify ON_DND_PRE_IMPORT to check whether the item over which we're dragging is a page or frame and if so, add the appropriate indication to its view.
  • Removing indications that are no longer necessary (not easy):
    • In LibraryTabLogic modify the following operations to remove the dnd indication color:
    • In PagePreviewPaletteLogic and PageStructurePaletteLogic:
      • Modify ON_DND_APPLY_TEMPLATE to remove the indication after applying a template or before creating a new page.
      • Modify ON_DND_PRE_IMPORT to remove the indication from the item above or under the current one (current meaning the one we're dragging over, not selected)
      • Add new operations to remove the indication on DRAG_EXITED (supposed that SophieDragDropHandler.dragExit(DropTargetEvent) throws a DRAG_EXITED event).
        • I have no idea how this operation will find the item from which to remove the indicators... this is not the selected item.

Changed 10 years ago by deni

comment:8 Changed 10 years ago by pap

  • Status changed from s2b_design_finished to s2c_design_ok
  • Design_score changed from 0 to 3
  • Design_reviewers set to pap
  • Changelog set to [wiki:Changelog]
  • First in order to avoid problems with synchronization of DND_PRE_IMPORT and DND_IMPORT events I think we should introduce DropHandler that is set during PRE_IMPORT. It should encapsulate the import logic and make sure it matches what was indicated to the user. Also this way we can reduce some code duplication.
  • DropHandler should be an interface with methods like handleDrop and handleReject.
  • Do you think we may need some additional types of DndDatas
  • The visual indication should rather be in ElementView.
  • Maybe we should make some base classes at least for element view highlighting related DropHandlers.

comment:9 Changed 10 years ago by deni

  • Status changed from s2c_design_ok to s3a_implementation_started

comment:10 Changed 10 years ago by deni

  • Status changed from s3a_implementation_started to s3b_implementation_finished
  • Done according to the design and design review
  • Source code: [8690] and [8697]

comment:11 Changed 10 years ago by meddle

  • Status changed from s3b_implementation_finished to s3c_implementation_ok
  • Imp._score changed from 0 to 3.5

See #2303.

comment:12 Changed 8 years ago by meddle

  • Status changed from s3c_implementation_ok to closed
  • Resolution set to obsolete

Closing all the tickets before M Y1

Note: See TracTickets for help on using tickets.