circular01Button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
fd = new CircularLayoutAlgorithm(400);
if (fd instanceof RootNodeLayout) {
RootNodeLayout temp = (RootNodeLayout) fd;
temp.setRootNodes(currentSelection);
}
gp.getNanoGraph().setLayout(fd);
}
});
topPanel.add(circular01Button, FlowLayout.LEFT);
JButton circularButton = new JButton("Circular Layout");
circularButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
fd = new CircularLayout(gp);
if (fd instanceof RootNodeLayout) {
RootNodeLayout temp = (RootNodeLayout) fd;
temp.setRootNodes(currentSelection);
}
gp.getNanoGraph().setLayout(fd);
}
});
topPanel.add(circularButton, FlowLayout.LEFT);
JButton treeButton = new JButton("Tree Layout");
treeButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
fd = new TreeLayout(gp);
if (fd instanceof RootNodeLayout) {
RootNodeLayout temp = (RootNodeLayout) fd;
temp.setRootNodes(currentSelection);
}
gp.getNanoGraph().setLayout(fd);
}
});