Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for multiple rows of node states, reordering nodes #26

Open
emichael opened this issue Apr 3, 2022 · 0 comments
Open

Allow for multiple rows of node states, reordering nodes #26

emichael opened this issue Apr 3, 2022 · 0 comments
Labels
component:visualizer Issues and PRs relating to the new visualization tool enhancement New feature or request

Comments

@emichael
Copy link
Owner

emichael commented Apr 3, 2022

Right now, all nodes are laid out in a single row. On very wide screens, this is fine. On smaller screens, trying to view more than 4 nodes at once is difficult. Nodes usually don't need the entire vertical height of the screen. There is quite a lot of white space in the node state box, and scrolling through the message inbox/timer queue above a node is preferable to scrolling horizontally when space is tight.

It would be nice to be able to layout SingleNodePanels in multiple rows. I attempted a quick and dirty version where there were either one or two rows, and when there were two rows, they were separated by a JSplitPane. This ran into some bizarre issues. I think the "right" way is to use multiple JXMultiSplitPanes, one in vertical mode to hold the rows, and others in horizontal mode to hold each row, and use this trick to display only one row.

// XXX: Disgusting hack to show only 1 leaf node
if (numShown == 1) {
Leaf l = new Leaf("DUMMY-LEAF-1");
l.setWeight(0.0);
layoutNodes.add(new Divider());
layoutNodes.add(l);
}
split.setChildren(layoutNodes);
splitPane.setModel(split);
for (Address a : addresses) {
if (!nodesActive.get(a).isSelected()) {
continue;
}
splitPane.add(statePanels.get(a), a.toString());
}
if (numShown == 1) {
splitPane.add(new JPanel(), "DUMMY-LEAF-1");
layout.displayNode("DUMMY-LEAF-1", false);
}

The other piece that would be nice is a way for users to reorder nodes. This could be as simple as replacing the "Show/hide nodes" panel in the sidebar with a reorderable list of checkboxes. This tutorial might be helpful: http://www.java2s.com/Tutorial/Java/0240__Swing/Usedraganddroptoreorderalist.htm The best version of that feature would be the ability to drag and drop SingleNodePanels by dragging the node name, but that seems very difficult.

@emichael emichael added enhancement New feature or request component:visualizer Issues and PRs relating to the new visualization tool labels Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:visualizer Issues and PRs relating to the new visualization tool enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant