use of org.scijava.java3d.Canvas3D in project TrakEM2 by trakem2.
the class Display3DGUI method init.
public ImageWindow3D init() {
// Extract the Canvas3D from the ImageWindow3D
final ImageWindow3D frame = new ImageWindow3D("TrakEM2 3D Display", this.univ);
frame.getContentPane().removeAll();
// New layout
final JPanel all = new JPanel();
all.setBackground(Color.white);
all.setPreferredSize(new Dimension(768, 512));
final GridBagConstraints c = new GridBagConstraints();
final GridBagLayout gb = new GridBagLayout();
all.setLayout(gb);
// Add Canvas3D
final Canvas3D canvas = this.univ.getCanvas();
c.anchor = GridBagConstraints.NORTHWEST;
c.fill = GridBagConstraints.BOTH;
c.weightx = 1;
c.weighty = 1;
c.gridheight = 4;
gb.setConstraints(canvas, c);
all.add(canvas);
// 1. Panel to edit color and assign random colors
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 0;
c.weighty = 0;
c.gridheight = 1;
c.gridx = 1;
final JPanel p1 = newPanelColors(this.univ);
gb.setConstraints(p1, c);
all.add(p1);
// 2. Panel to delete all whose name matches a regex
c.gridy = 1;
c.insets = new Insets(10, 0, 0, 0);
final JPanel p2 = newPanelRemoveContents(this.univ);
gb.setConstraints(p2, c);
all.add(p2);
// 3. Filterable selection list
c.gridy = 2;
c.weighty = 1;
c.fill = GridBagConstraints.BOTH;
final JPanel p3 = newPanelFilterableTable(this.univ);
gb.setConstraints(p3, c);
all.add(p3);
frame.getContentPane().add(all);
return frame;
}
Aggregations