|
|
Re: Part+Visuals [message #1802119 is a reply to message #1795190] |
Fri, 01 February 2019 14:36 |
|
Hi Frank,
I believe your implementation should be fine so far :-)
1) Maybe the part abstraction is cumbersome here so you might want to implement a specific JavaFX visual instead. You could also provide a gesture if complicated interaction is desired (and troublesome to implement via clickdrag, and other default gestures).
Using a mix of content-parts and non-content-parts should be possible. However, I have no experience with such a setup, and the default synchronisation mechanism will only construct parts based-on content-children and content-anchorages.
2) Every JavaFX Parent can have children. Some parent nodes allow the addition and removal of children, e.g. Group or Pane, while other parent nodes maintain their children only internally.
Group is a good default. In some cases, I believe, Region/Pane can also be a very nice "base" visual due to CSS styling options.
W.r.t. two part classes: You can have a transformation between your actual model and the "content-children" and "content-anchorages" reported by the content-parts. Therefore, you can always "split" contents across multiple parts. This is done by Zest, for example, for the edge labels.
Best regards,
Matthias
|
|
|
|
|
Re: Part+Visuals [message #1802905 is a reply to message #1802276] |
Mon, 18 February 2019 18:55 |
|
Hi Joao,
the implementation of doCreateVisual() that you have given does look fine to me.
However, when your parent part should have children, then you need to implement doAddChildVisual() and doRemoveChildVisual() with logic similar to group.getChildren.add(...) and .remove(...). If you want to be able to create/delete via default CreationPolicy and DeletionPolicy, then you also need to implement doAddContentChild() and doRemoveContentChild(), respectively.
Moreover, the part needs to announce its content children via doGetContentChildren() so that controllers for these will be created during content-sync (same with anchorages, doAttachToAnchorageVisual(), doAttachToContentAnchorage(), etc.).
However, if you just want to have a complex visual that does not need to be split w.r.t. its controller(s), then you can simply create a complex visual with a single controller (part).
h2h,
Matthias
|
|
|
Powered by
FUDForum. Page generated in 0.03070 seconds