graph.readUnlock();
//Level links
for (int i = 0; i < levelSize.length; i++) {
JXHyperlink link = new JXHyperlink();
link.setClickedColor(new java.awt.Color(0, 51, 255));
link.setText(levelStr + " " + i + " (" + levelSize[i] + " " + nodesStr + ")");
link.setHorizontalAlignment(javax.swing.SwingConstants.LEADING);
final int lvl = i;
link.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GraphModel model = Lookup.getDefault().lookup(GraphController.class).getModel();
HierarchicalGraph graph = model.getHierarchicalGraphVisible();
graph.resetViewToLevel(lvl);
}
});
GridBagConstraints gdc = new GridBagConstraints(0, i, 1, 1, 1, 0, GridBagConstraints.PAGE_START, GridBagConstraints.HORIZONTAL, new Insets(0, 4, 0, 0), 0, 0);
levelViewPanel.add(link, gdc);
}
//Leaves
JXHyperlink link = new JXHyperlink();
link.setClickedColor(new java.awt.Color(0, 51, 255));
link.setText(leavesStr);
link.setHorizontalAlignment(javax.swing.SwingConstants.LEADING);
link.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GraphModel model = Lookup.getDefault().lookup(GraphController.class).getModel();
HierarchicalGraph graph = model.getHierarchicalGraphVisible();
graph.resetViewToLeaves();