public void moveToLocation(Position position) { OrbitView view = (OrbitView) this.getWWd().getView(); Globe globe = this.getWWd().getModel().getGlobe(); if (globe != null && view != null) { ((OrbitViewInputHandler) view.getViewInputHandler()) .addPanToAnimator(position, Angle.ZERO, Angle.ZERO, position.elevation, true); } }
public IvusFrame(World world) { OrbitView view = (world != null) ? new OrbitView(world) : new OrbitView(); view.setAxesOrientation(AxesOrientation.XRIGHT_YOUT_ZDOWN); ViewCanvas canvas = new ViewCanvas(view); canvas.setView(view); ModeManager mm = new ModeManager(); mm.add(canvas); OrbitViewMode ovm = new OrbitViewMode(mm); SelectDragMode sdm = new SelectDragMode(mm); JPopupMenu.setDefaultLightWeightPopupEnabled(false); ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); JMenu fileMenu = new JMenu("File"); fileMenu.setMnemonic('F'); Action exitAction = new AbstractAction("Exit") { private static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent event) { System.exit(0); } }; JMenuItem exitItem = fileMenu.add(exitAction); exitItem.setMnemonic('x'); JMenu modeMenu = new JMenu("Mode"); modeMenu.setMnemonic('M'); JMenuItem ovmItem = new ModeMenuItem(ovm); modeMenu.add(ovmItem); JMenuItem sdmItem = new ModeMenuItem(sdm); modeMenu.add(sdmItem); JMenuBar menuBar = new JMenuBar(); menuBar.add(fileMenu); menuBar.add(modeMenu); JToolBar toolBar = new JToolBar(SwingConstants.VERTICAL); toolBar.setRollover(true); JToggleButton ovmButton = new ModeToggleButton(ovm); toolBar.add(ovmButton); JToggleButton sdmButton = new ModeToggleButton(sdm); toolBar.add(sdmButton); ovm.setActive(true); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setSize(new Dimension(SIZE, SIZE)); this.add(canvas, BorderLayout.CENTER); this.add(toolBar, BorderLayout.WEST); this.setJMenuBar(menuBar); }