use of maspack.widgets.ViewerToolBar in project artisynth_core by artisynth.
the class Main method createViewerFrame.
public GLViewerFrame createViewerFrame() {
GLViewerFrame frame = new GLViewerFrame(myViewer, PROJECT_NAME, 400, 400);
GLViewer viewer = frame.getViewer();
// ViewerToolBar toolBar = new ViewerToolBar(viewer, this);
AxisAngle REW = getDefaultViewOrientation(getRootModel());
myViewerManager.addViewer(viewer);
ViewerToolBar toolBar = new ViewerToolBar(viewer, /*addGridPanel=*/
true);
frame.getContentPane().add(toolBar, BorderLayout.PAGE_START);
viewer.setDefaultAxialView(AxisAlignedRotation.getNearest(new RotationMatrix3d(REW)));
initializeViewer(viewer, REW);
frame.setVisible(true);
return frame;
}
use of maspack.widgets.ViewerToolBar in project artisynth_core by artisynth.
the class MenuBarHandler method attachViewerToolbar.
/**
* author: andreio create a camera toolbar to control the view of the camera
* on the GlViewer
*/
public void attachViewerToolbar(JPanel panel) {
if (myViewerToolBar == null) {
myViewerToolBar = new ViewerToolBar(getMainViewer(), /*allowGridDisplay=*/
false);
}
myViewerToolBar.setOrientation(JToolBar.VERTICAL);
panel.add(myViewerToolBar, BorderLayout.SOUTH);
panel.revalidate();
panel.repaint();
myViewerToolBar.setVisible(true);
}
use of maspack.widgets.ViewerToolBar in project artisynth_core by artisynth.
the class MeshViewer method createToolBars.
private void createToolBars() {
myToolBar = new JPanel();
myToolBar.setLayout(new BoxLayout(myToolBar, BoxLayout.LINE_AXIS));
myToolBar.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
myMeshLabel = new JLabel(" ");
myToolBar.add(myMeshLabel);
// add glue to separate label from grid display
myToolBar.add(Box.createHorizontalGlue());
myGridDisplayIndex = myToolBar.getComponentCount();
// add a place-holder component for the grid display
myToolBar.add(GridDisplay.createPlaceHolder());
getContentPane().add(myToolBar, BorderLayout.NORTH);
JPanel leftPanel = new JPanel(new BorderLayout());
ViewerToolBar viewerToolBar = new ViewerToolBar(viewer, /*addGridPanel=*/
false);
viewerToolBar.setOrientation(JToolBar.VERTICAL);
leftPanel.add(viewerToolBar, BorderLayout.SOUTH);
getContentPane().add(leftPanel, BorderLayout.WEST);
}
Aggregations