Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. COThe way I have the tools currently set up is pretty similar to that actually. The CanvasController has an 'activeTool', that implements an interface containing methods like 'onClick', 'onMouseMove', etc... and on such events the active tool's methods are called. The part I'm struggling with is how the tool services add new drawn entities. Since the each part of the Canvas MVC triad has it's own collection of entities (e.g. CanvasController has a list of WidgetControllers, CanvasView has a list of WidgetViews). Does the tool service create all 3 of the widget MVC classes and add them?
      singulars
    2. COI'm not entirely certain if I follow the question... but let me see. I would think the best result on this is that the 'active tool' is actually the service for that tool. You can strip down some of the MVC in this case. There is no need for a controller here - because the service already has those methods ( from the interface ) that you described. Your canvas controller is already calling them, so there should be no "child" controller. As for the associated view, I've never been too sure - I generally invoke the "magical" (heh) "helper class" which automagically interprets view creation.
      singulars
    3. COI updated my original question to include a pseudo-codish example. The CircleTool doesn't have it's own completely separate MVC if that's what you were referring to. I may end up just using some kind of "magical" helper class haha... Hoping to find some kind of approach that feels better though.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload