package ds.ihm.gui.render;
import java.awt.Dimension;
import javax.media.j3d.Canvas3D;
import javax.swing.JPanel;
import com.sun.j3d.utils.universe.SimpleUniverse;
@SuppressWarnings("serial")
public class PanelConduite extends JPanel {
private static final int PANEL_WIDTH = 800;
private static final int PANEL_HEIGHT = 600;
private JPanel panelCanvas = new JPanel();
/*private Canvas3D c3d;*/
private PanelTableauBord tableauBord;
public PanelConduite(){
super();
}
public Canvas3D init(){
this.setLayout(null);
//BorderLayout layout = new BorderLayout();
//this.setLayout(layout);
this.setFocusable(true);
this.requestFocus();
Canvas3D c3d = new Canvas3D(SimpleUniverse.getPreferredConfiguration());
c3d.setSize(PANEL_WIDTH, (2*PANEL_HEIGHT)/3);
panelCanvas.add(c3d);
panelCanvas.setOpaque(false);
panelCanvas.setPreferredSize(new Dimension(PANEL_WIDTH, (2*PANEL_HEIGHT)/3));
panelCanvas.setFocusable(false);
panelCanvas.setBounds(0, 0, PANEL_WIDTH, (2*PANEL_HEIGHT)/3);
this.add(panelCanvas);
tableauBord = new PanelTableauBord();
tableauBord.init(PANEL_HEIGHT/3, PANEL_WIDTH);
tableauBord.setFocusable(false);
tableauBord.setBounds(0, (2*PANEL_HEIGHT)/3, PANEL_WIDTH, PANEL_HEIGHT/3);
this.add(tableauBord);
this.setVisible(true);
this.setPreferredSize(new Dimension(PANEL_WIDTH, PANEL_HEIGHT));
return c3d;
}
/*public Canvas3D getCanvas(){
return c3d;
}*/
public PanelTableauBord getTableauBord(){
return tableauBord;
}
}