KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > jclasslib > browser > detail > attributes > code > MiscDetailPane


1 /*
2     This library is free software; you can redistribute it and/or
3     modify it under the terms of the GNU General Public
4     License as published by the Free Software Foundation; either
5     version 2 of the license, or (at your option) any later version.
6 */

7
8 package org.gjt.jclasslib.browser.detail.attributes.code;
9
10 import org.gjt.jclasslib.browser.BrowserServices;
11 import org.gjt.jclasslib.browser.detail.FixedListDetailPane;
12 import org.gjt.jclasslib.structures.attributes.CodeAttribute;
13 import org.gjt.jclasslib.util.ExtendedJLabel;
14
15 import javax.swing.tree.TreePath JavaDoc;
16
17 /**
18     Detail pane showing miscellaneous information of a <tt>Code</tt> attribute
19     without substructure.
20  
21     @author <a HREF="mailto:jclasslib@ej-technologies.com">Ingo Kegel</a>
22     @version $Revision: 1.1 $ $Date: 2003/08/18 08:19:37 $
23 */

24 public class MiscDetailPane extends FixedListDetailPane {
25
26     // Visual components
27

28     private ExtendedJLabel lblMaxStack;
29     private ExtendedJLabel lblMaxLocals;
30     private ExtendedJLabel lblCodeLength;
31     
32     /**
33         Constructor.
34         @param services the associated browser services.
35      */

36     public MiscDetailPane(BrowserServices services) {
37         super(services);
38     }
39     
40     protected void setupLabels() {
41         
42         addDetailPaneEntry(normalLabel("Maximum stack depth:"),
43                            lblMaxStack = highlightLabel());
44
45         addDetailPaneEntry(normalLabel("Maximum local variables:"),
46                            lblMaxLocals = highlightLabel());
47
48         addDetailPaneEntry(normalLabel("Code length:"),
49                            lblCodeLength = highlightLabel());
50     }
51
52     public void show(TreePath JavaDoc treePath) {
53         
54         CodeAttribute attribute = (CodeAttribute)findAttribute(treePath);
55
56         lblMaxStack.setText(attribute.getMaxStack());
57         lblMaxLocals.setText(attribute.getMaxLocals());
58         lblCodeLength.setText(attribute.getCode().length);
59         
60         super.show(treePath);
61     }
62     
63 }
64
65
Popular Tags