jdk/src/share/classes/sun/tools/jconsole/ClassTab.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2004-2007 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.tools.jconsole;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.lang.management.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.lang.reflect.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import javax.swing.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import javax.swing.border.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import javax.swing.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import javax.swing.text.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import java.util.List;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import java.util.concurrent.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import sun.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import static sun.tools.jconsole.Formatter.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
import static sun.tools.jconsole.Resources.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
import static sun.tools.jconsole.Utilities.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
@SuppressWarnings("serial")
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
class ClassTab extends Tab implements ActionListener {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    PlotterPanel loadedClassesMeter;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    TimeComboBox timeComboBox;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    private JCheckBox verboseCheckBox;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    private HTMLPane details;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    private ClassOverviewPanel overviewPanel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    private boolean plotterListening = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    private static final String loadedPlotterKey        = "loaded";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    private static final String totalLoadedPlotterKey   = "totalLoaded";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    private static final String loadedPlotterName       = Resources.getText("Loaded");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    private static final String totalLoadedPlotterName  = Resources.getText("Total Loaded");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    private static final Color  loadedPlotterColor      = Plotter.defaultColor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    private static final Color  totalLoadedPlotterColor = Color.red;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    private static final String infoLabelFormat = "ClassTab.infoLabelFormat";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
      Hierarchy of panels and layouts for this tab:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        ClassTab (BorderLayout)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            North:  topPanel (BorderLayout)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                        Center: controlPanel (FlowLayout)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                                    timeComboBox
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
                        East:   topRightPanel (FlowLayout)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
                                    verboseCheckBox
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
            Center: plotterPanel (BorderLayout)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                        Center: plotter
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
            South:  bottomPanel (BorderLayout)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                        Center: details
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    public static String getTabName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        return Resources.getText("Classes");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    public ClassTab(VMPanel vmPanel) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        super(vmPanel, getTabName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        setLayout(new BorderLayout(0, 0));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        setBorder(new EmptyBorder(4, 4, 3, 4));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        JPanel topPanel     = new JPanel(new BorderLayout());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        JPanel plotterPanel = new JPanel(new BorderLayout());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        JPanel bottomPanel  = new JPanel(new BorderLayout());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        add(topPanel,     BorderLayout.NORTH);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        add(plotterPanel, BorderLayout.CENTER);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        add(bottomPanel,  BorderLayout.SOUTH);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 20, 5));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        topPanel.add(controlPanel, BorderLayout.CENTER);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        verboseCheckBox = new JCheckBox(Resources.getText("Verbose Output"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        verboseCheckBox.addActionListener(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        verboseCheckBox.setToolTipText(getText("Verbose Output.toolTip"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        JPanel topRightPanel = new JPanel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        topRightPanel.setBorder(new EmptyBorder(0, 65-8, 0, 70));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        topRightPanel.add(verboseCheckBox);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        topPanel.add(topRightPanel, BorderLayout.AFTER_LINE_ENDS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        loadedClassesMeter = new PlotterPanel(Resources.getText("Number of Loaded Classes"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                                              Plotter.Unit.NONE, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        loadedClassesMeter.plotter.createSequence(loadedPlotterKey,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                                                  loadedPlotterName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                                                  loadedPlotterColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                                                  true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        loadedClassesMeter.plotter.createSequence(totalLoadedPlotterKey,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                                                  totalLoadedPlotterName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                                                  totalLoadedPlotterColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                                                  true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        setAccessibleName(loadedClassesMeter.plotter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                          getText("ClassTab.loadedClassesPlotter.accessibleName"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        plotterPanel.add(loadedClassesMeter);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        timeComboBox = new TimeComboBox(loadedClassesMeter.plotter);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        controlPanel.add(new LabeledComponent(Resources.getText("Time Range:"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
                                              getMnemonicInt("Time Range:"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
                                              timeComboBox));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        LabeledComponent.layout(plotterPanel);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        bottomPanel.setBorder(new CompoundBorder(new TitledBorder(Resources.getText("Details")),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
                                                  new EmptyBorder(10, 10, 10, 10)));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        details = new HTMLPane();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        setAccessibleName(details, getText("Details"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        JScrollPane scrollPane = new JScrollPane(details);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        scrollPane.setPreferredSize(new Dimension(0, 150));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        bottomPanel.add(scrollPane, BorderLayout.SOUTH);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    public void actionPerformed(ActionEvent ev) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        final boolean b = verboseCheckBox.isSelected();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        workerAdd(new Runnable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            public void run() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
                ProxyClient proxyClient = vmPanel.getProxyClient();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
                    proxyClient.getClassLoadingMXBean().setVerbose(b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
                } catch (UndeclaredThrowableException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
                    proxyClient.markAsDead();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
                } catch (IOException ex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
                    // Ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    public SwingWorker<?, ?> newSwingWorker() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        final ProxyClient proxyClient = vmPanel.getProxyClient();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        if (!plotterListening) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            proxyClient.addWeakPropertyChangeListener(loadedClassesMeter.plotter);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
            plotterListening = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        return new SwingWorker<Boolean, Object>() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
            private long clCount, cuCount, ctCount;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            private boolean isVerbose;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            private String detailsStr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            private long timeStamp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            public Boolean doInBackground() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                    ClassLoadingMXBean classLoadingMBean = proxyClient.getClassLoadingMXBean();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                    clCount = classLoadingMBean.getLoadedClassCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                    cuCount = classLoadingMBean.getUnloadedClassCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                    ctCount = classLoadingMBean.getTotalLoadedClassCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                    isVerbose = classLoadingMBean.isVerbose();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                    detailsStr = formatDetails();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                    timeStamp = System.currentTimeMillis();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                    return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                } catch (UndeclaredThrowableException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
                    proxyClient.markAsDead();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                    return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
                } catch (IOException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
                    return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
            protected void done() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
                    if (get()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
                        loadedClassesMeter.plotter.addValues(timeStamp, clCount, ctCount);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                        if (overviewPanel != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                            overviewPanel.updateClassInfo(ctCount, clCount);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                            overviewPanel.getPlotter().addValues(timeStamp, clCount);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
                        loadedClassesMeter.setValueLabel(clCount + "");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
                        verboseCheckBox.setSelected(isVerbose);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                        details.setText(detailsStr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                } catch (InterruptedException ex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                } catch (ExecutionException ex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                    if (JConsole.isDebug()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                        ex.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
            private String formatDetails() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                String text = "<table cellspacing=0 cellpadding=0>";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                long time = System.currentTimeMillis();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                String timeStamp = formatDateTime(time);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                text += newRow(Resources.getText("Time"), timeStamp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                text += newRow(Resources.getText("Current classes loaded"), justify(clCount, 5));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                text += newRow(Resources.getText("Total classes loaded"),   justify(ctCount, 5));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
                text += newRow(Resources.getText("Total classes unloaded"), justify(cuCount, 5));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                return text;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    OverviewPanel[] getOverviewPanels() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        if (overviewPanel == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
            overviewPanel = new ClassOverviewPanel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        return new OverviewPanel[] { overviewPanel };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    private static class ClassOverviewPanel extends OverviewPanel {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        ClassOverviewPanel() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
            super(getText("Classes"), loadedPlotterKey, loadedPlotterName, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
        private void updateClassInfo(long total, long loaded) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
            long unloaded = (total - loaded);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
            getInfoLabel().setText(getText(infoLabelFormat, loaded, unloaded, total));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
}