Javafx Nodes only able to be in one Group? - javafx

I am not sure if this is a bug or not or just my JavaFX program but I am trying to add nodes to several Groups (only one of which is added to the scene) and encountering an oddity where the node will automatically remove itself from the previous group when I add it to another group.
I can't find any documentation on this talking about objects only being able to belong to one group, so was wondering whether its a bug or meant to be? I was hoping to use several groups to collect items in different groupings so that I can apply high level effects such as MouseTransparency, Opacity etc to whole groups on a on/off basis rather than iterate through items as a list where some child objects already have things like MouseTransparency disabled (therefore I don't want to turn it back on for items that originally did not have MouseTransparency - a feature that was handy by adding them to groups).
I note that you can add groups as a child to other groups. I have tried solving my problem by having this, groups nested under the main visually shown Group, but had to abandon that as I could not do a comparator sort on all the wholes if they are contained within sub-groups as I could then only sort either within a sub-group or sort the groups as groups within the main Group, rather than sorting all the nodes across all sub-groups.
Thanks

Refer to the Node documentation:
If a program adds a child node to a Parent (including Group, Region, etc) and that node is already a child of a different Parent or the root of a Scene, the node is automatically (and silently) removed from its former parent.

Related

How can I force vis.js edges in a rendered DAG to "jump" graph levels?

I have used vis.js to draw some DAGs using the hierarchical layout option. It works well, however for my use case there are often going to be edges that must "jump vertex generations," not certain if I am saying that properly. Essentially, one branch may have 10 levels, and then a sibling of the parent of the deep branch may want to connect to the deepest leaf node.
This "works" - vis.js draws it. But it screws up my layout, shifting a large portion of the preexisting graph, and it will not be useful for a user to look at the result. I have attached a picture of what I am trying to achieve and what the current results are, can anyone point me in the right direction?
Solution turned out to be very simple, I just overlooked it. Using the hierarchical layout, it is possible to assign each node a field called level. It is an all-or-nothing option: either you let vis.js take care of the levels, or you manually assign all your nodes a level. It respects the levels very well, and when adding edges to nodes whose levels have been manually defined, the nodes no longer jump around the layout.

WP Fieldmanager nested groups only sortable when Add More button is present

Trying to create an set number of groups nested in a larger group. Want to have the ability to sort the nested groups. This only works when Add More is present. Does anyone know how to make these groups sortable?

Changing QGraphicsScene Insertion Order Without Reloading

I'm working on a graphical shape editor that uses the QGraphicsScene/QGraphicsView as its basis. I have a lot of experience with the scene/view framework and understand it fairly well. The issue that I'm having is that QGraphicsScene::items always returns items in the insertion order (either ascending or descending) regardless of the Z-order or the use of QGraphicsItem::stackBefore call.
The issue is that, as with most graphics editors, I need to be able to move shapes forward or backward in the stacking order. At the end, to save the resulting data, I have to traverse the list of the items in the scene and save each item's data in whatever format I'm using.
The only way that I've found to do this is that I have to remove items from the scene and reinsert them in the desired stacking order. In this particular task, it's a small number of items and happens without noticeable delay, but in a related editor, it could be many thousands.
While the QGraphicsItem::zValue and QGraphicsItem::stackBefore allow me to influence the drawing order, neither of them changes the order that gets returned from QGraphicsScene::items. Since the data I ultimately save needs to reflect the drawing order, I have to remove and reinsert to get the correct ordering at the end.
Questions:
Have I've overlooked any other techniques for managing items within the scene that will influence the results of QGraphicsItem::items?
Or is there another method for traversing the items within the scene that will give me the drawing order?
I can confirm that QGraphicsScene::items() and items(sortOrder) return the item list in the original creation and stacking order, which does not at all agree with the docs.
However, I found that by using
QGraphicsScene::items( QGraphicsScene::itemsBoundingRect, Qt::IntersectsItemBoundingRect, sortOrder) I do get the items in the correct drawing order, so this function apparently takes calls to QGraphicsItem::stackBefore() into account.
i don't use the z-order feature so I can't comment on whether that works in this scenario or not.

Pentaho Report Grouping & Hide/Show Elements

I am using Pentaho Report Designer & BI server 5.0.1.
I'm having a report like,
I need to show insurance coverage details and risk details under that coverage for an insured( one insured can have many coverages and each coverage can have many risks).
We are having 20 different coverages and each having different elements and different risk details.
I thought of using three groups with
Insured at Group1
--> Coverage Details at Group2
--> Risk Details at Group3
my doubt is,
can we show different elements in Group2 based on coverage type?
can we done this using groups or do we need to use sub reports for each coverage type? not sure what will be suitable for my requirement?
I need to conditionally hide/show columns, but 'invisibleConsumesSpace' property is not working in PRD 5.0.1. need some alternative for that.
The invisible consumes space property must be set on the band that contains the element. It governs how the band interprets the visible flag of its clients.
If all your data is contained in one result-set, then the normal way of showing different record types is via using a conditional visibility function to show/hide the appropriate elements.
You can find an example of that in "Income statement" sample, but here is the general approach:
(1) Set your details- and other band that should display multiple record types to layout "block".
(2) Add a sub-band for each record type.
(3) On each subband, add a formula (green plus on the styles) to the "visible" style element that returns true if the record should be shown, and false otherwise.
Then simply fill in your elements for each band.
Note that this method does not easily allow you to change the grouping within this structure. If you need different group configuration based on the record type, you might find it easier to use subreport.

DevExpress custom grouping: groups also have columns, groups and independent rows exist simultaneously

I need to display message groups and messages inside a DevExpress grid.
Requirements:
message groups and messages have the same columns
groups have a special column with a '+'/'-' sign which specifies if the group is closed or open
when a group is closed its messages do not appear in the grid
when a group is opened by clicking the '+' sign its messages need to appear in the same grid underneath the group
the grid can have both groups and simple messages
The grid also needs to allow sorting, filtering and paging.
Is there a simple way to achieve this using DevExpress features?
NOTE: I've seen the DevExpress grouping demo, but this is different from my requirements because:
in the demo only the grouping value is displayed whereas in my grid I need to see all the columns of the message group
all rows are grouped (groups and messages can not exist at the same time)
EDIT: I have eventually abandoned this idea as it seemed to much trouble. What I did instead was add a column with a clickable link for groups; when the user clicks the link a popup appears with the children; it was much easier and more intuitive for the user
DevExpress has a tree.
Each Group can be a root level node and each message a node within its group, or a message could be another root level node (IE not within a group).
All nodes share the same columns. Each group that has messages will have a '+/-'

Resources