< prev index next >

src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.java

Print this page


   1 /*
   2  * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 272         button = new JToggleButton(panModeAction);
 273         button.setSelected(true);
 274         interactionButtons.add(button);
 275         toolBar.add(button);
 276         panModeAction.addPropertyChangeListener(this);
 277 
 278         selectionModeAction = new SelectionModeAction();
 279         button = new JToggleButton(selectionModeAction);
 280         interactionButtons.add(button);
 281         toolBar.add(button);
 282         selectionModeAction.addPropertyChangeListener(this);
 283 
 284         toolBar.add(Box.createHorizontalGlue());
 285         Action action = Utilities.actionsForPath("QuickSearchShadow").get(0);
 286         Component quicksearch = ((Presenter.Toolbar) action).getToolbarPresenter();
 287         try {
 288             // (aw) workaround for disappearing search bar due to reparenting one shared component instance.
 289             quicksearch = (Component) quicksearch.getClass().getConstructor(KeyStroke.class).newInstance(new Object[]{null});
 290         } catch (ReflectiveOperationException | IllegalArgumentException | SecurityException e) {
 291         }
 292         quicksearch.setMinimumSize(quicksearch.getPreferredSize()); // necessary for GTK LAF



 293         toolBar.add(quicksearch);
 294 
 295         centerPanel = new JPanel();
 296         this.add(centerPanel, BorderLayout.CENTER);
 297         cardLayout = new CardLayout();
 298         centerPanel.setLayout(cardLayout);
 299         centerPanel.add(SCENE_STRING, scene.getComponent());
 300         centerPanel.setBackground(Color.WHITE);
 301         satelliteComponent = scene.createSatelliteView();
 302         satelliteComponent.setSize(200, 200);
 303         centerPanel.add(SATELLITE_STRING, satelliteComponent);
 304 
 305         // TODO: Fix the hot key for entering the satellite view
 306         this.addKeyListener(keyListener);
 307 
 308         scene.getComponent().addHierarchyBoundsListener(new HierarchyBoundsListener() {
 309 
 310             @Override
 311             public void ancestorMoved(HierarchyEvent e) {
 312             }


   1 /*
   2  * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 272         button = new JToggleButton(panModeAction);
 273         button.setSelected(true);
 274         interactionButtons.add(button);
 275         toolBar.add(button);
 276         panModeAction.addPropertyChangeListener(this);
 277 
 278         selectionModeAction = new SelectionModeAction();
 279         button = new JToggleButton(selectionModeAction);
 280         interactionButtons.add(button);
 281         toolBar.add(button);
 282         selectionModeAction.addPropertyChangeListener(this);
 283 
 284         toolBar.add(Box.createHorizontalGlue());
 285         Action action = Utilities.actionsForPath("QuickSearchShadow").get(0);
 286         Component quicksearch = ((Presenter.Toolbar) action).getToolbarPresenter();
 287         try {
 288             // (aw) workaround for disappearing search bar due to reparenting one shared component instance.
 289             quicksearch = (Component) quicksearch.getClass().getConstructor(KeyStroke.class).newInstance(new Object[]{null});
 290         } catch (ReflectiveOperationException | IllegalArgumentException | SecurityException e) {
 291         }
 292         Dimension preferredSize = quicksearch.getPreferredSize();
 293         preferredSize = new Dimension((int) preferredSize.getWidth() * 2, (int) preferredSize.getHeight());
 294         quicksearch.setMinimumSize(preferredSize); // necessary for GTK LAF
 295         quicksearch.setPreferredSize(preferredSize);
 296         toolBar.add(quicksearch);
 297 
 298         centerPanel = new JPanel();
 299         this.add(centerPanel, BorderLayout.CENTER);
 300         cardLayout = new CardLayout();
 301         centerPanel.setLayout(cardLayout);
 302         centerPanel.add(SCENE_STRING, scene.getComponent());
 303         centerPanel.setBackground(Color.WHITE);
 304         satelliteComponent = scene.createSatelliteView();
 305         satelliteComponent.setSize(200, 200);
 306         centerPanel.add(SATELLITE_STRING, satelliteComponent);
 307 
 308         // TODO: Fix the hot key for entering the satellite view
 309         this.addKeyListener(keyListener);
 310 
 311         scene.getComponent().addHierarchyBoundsListener(new HierarchyBoundsListener() {
 312 
 313             @Override
 314             public void ancestorMoved(HierarchyEvent e) {
 315             }


< prev index next >