< prev index next >

agent/src/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java

Print this page




 292     }
 293     setLayout(new BorderLayout());
 294     setupScrollBar(addrValue, addrLow, addrHigh);
 295     add(scrollBar, BorderLayout.EAST);
 296     visibleAnnotations = new ArrayList();
 297     setBackground(Color.white);
 298     addHierarchyBoundsListener(new HierarchyBoundsListener() {
 299         public void ancestorMoved(HierarchyEvent e) {
 300         }
 301 
 302         public void ancestorResized(HierarchyEvent e) {
 303           // FIXME: should perform incremental layout
 304           //          System.err.println("Ancestor resized");
 305         }
 306       });
 307 
 308     if (font == null) {
 309       font = GraphicsUtilities.lookupFont("Courier");
 310     }
 311     if (font == null) {



 312       throw new RuntimeException("Error looking up monospace font Courier");
 313     }
 314     getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "PageDown");
 315     getActionMap().put("PageDown", new AbstractAction() {
 316         public void actionPerformed(ActionEvent e) {
 317           scrollBar.setValueHP(scrollBar.getValueHP().add(scrollBar.getBlockIncrementHP()));
 318         }
 319       });
 320     getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "PageUp");
 321     getActionMap().put("PageUp", new AbstractAction() {
 322         public void actionPerformed(ActionEvent e) {
 323           scrollBar.setValueHP(scrollBar.getValueHP().subtract(scrollBar.getBlockIncrementHP()));
 324         }
 325       });
 326     getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "Down");
 327     getActionMap().put("Down", new AbstractAction() {
 328         public void actionPerformed(ActionEvent e) {
 329           scrollBar.setValueHP(scrollBar.getValueHP().add(scrollBar.getUnitIncrementHP()));
 330         }
 331       });




 292     }
 293     setLayout(new BorderLayout());
 294     setupScrollBar(addrValue, addrLow, addrHigh);
 295     add(scrollBar, BorderLayout.EAST);
 296     visibleAnnotations = new ArrayList();
 297     setBackground(Color.white);
 298     addHierarchyBoundsListener(new HierarchyBoundsListener() {
 299         public void ancestorMoved(HierarchyEvent e) {
 300         }
 301 
 302         public void ancestorResized(HierarchyEvent e) {
 303           // FIXME: should perform incremental layout
 304           //          System.err.println("Ancestor resized");
 305         }
 306       });
 307 
 308     if (font == null) {
 309       font = GraphicsUtilities.lookupFont("Courier");
 310     }
 311     if (font == null) {
 312       font = GraphicsUtilities.lookupFont("DejaVu Sans Mono");
 313     }
 314     if (font == null) {
 315       throw new RuntimeException("Error looking up monospace font Courier");
 316     }
 317     getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "PageDown");
 318     getActionMap().put("PageDown", new AbstractAction() {
 319         public void actionPerformed(ActionEvent e) {
 320           scrollBar.setValueHP(scrollBar.getValueHP().add(scrollBar.getBlockIncrementHP()));
 321         }
 322       });
 323     getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "PageUp");
 324     getActionMap().put("PageUp", new AbstractAction() {
 325         public void actionPerformed(ActionEvent e) {
 326           scrollBar.setValueHP(scrollBar.getValueHP().subtract(scrollBar.getBlockIncrementHP()));
 327         }
 328       });
 329     getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "Down");
 330     getActionMap().put("Down", new AbstractAction() {
 331         public void actionPerformed(ActionEvent e) {
 332           scrollBar.setValueHP(scrollBar.getValueHP().add(scrollBar.getUnitIncrementHP()));
 333         }
 334       });


< prev index next >