Search in sources :

Example 1 with Canvas3D

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;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) Canvas3D(org.scijava.java3d.Canvas3D) Dimension(java.awt.Dimension) ImageWindow3D(ij3d.ImageWindow3D)

Aggregations

ImageWindow3D (ij3d.ImageWindow3D)1 Dimension (java.awt.Dimension)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 JPanel (javax.swing.JPanel)1 Canvas3D (org.scijava.java3d.Canvas3D)1