public void actionPerformed(ActionEvent e) {
uncluster();
}});
JComboBox layoutTypeComboBox = new JComboBox(layoutClasses);
layoutTypeComboBox.setRenderer(new DefaultListCellRenderer() {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
String valueString = value.toString();
valueString = valueString.substring(valueString.lastIndexOf('.')+1);
return super.getListCellRendererComponent(list, valueString, index, isSelected,
cellHasFocus);
}
});
layoutTypeComboBox.setSelectedItem(FRLayout.class);
layoutTypeComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange() == ItemEvent.SELECTED) {
Class clazz = (Class)e.getItem();
try {
Layout<String,Number> layout = getLayoutFor(clazz, graph);
layout.setInitializer(vv.getGraphLayout());
clusteringLayout.setDelegate(layout);
vv.setGraphLayout(clusteringLayout);
} catch(Exception ex) {
ex.printStackTrace();
}
}
}});
JComboBox subLayoutTypeComboBox = new JComboBox(layoutClasses);
subLayoutTypeComboBox.setRenderer(new DefaultListCellRenderer() {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
String valueString = value.toString();
valueString = valueString.substring(valueString.lastIndexOf('.')+1);
return super.getListCellRendererComponent(list, valueString, index, isSelected,
cellHasFocus);
}
});
subLayoutTypeComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange() == ItemEvent.SELECTED) {
subLayoutType = (Class)e.getItem();
}
}});
JComboBox subLayoutDimensionComboBox =
new JComboBox(new Dimension[]{
new Dimension(75,75),
new Dimension(100,100),
new Dimension(150,150),
new Dimension(200,200),
new Dimension(250,250),
new Dimension(300,300)
}
);
subLayoutDimensionComboBox.setRenderer(new DefaultListCellRenderer() {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
String valueString = value.toString();
valueString = valueString.substring(valueString.lastIndexOf('['));
valueString = valueString.replaceAll("idth", "");
valueString = valueString.replaceAll("eight","");