src/share/classes/sun/tools/jconsole/OverviewTab.java

Print this page




   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.tools.jconsole;
  27 
  28 import java.awt.*;
  29 import java.lang.reflect.InvocationTargetException;
  30 import java.util.ArrayList;
  31 
  32 import javax.swing.*;
  33 import javax.swing.border.*;
  34 
  35 import static sun.tools.jconsole.JConsole.*;
  36 import static sun.tools.jconsole.Resources.*;
  37 
  38 
  39 @SuppressWarnings("serial")
  40 class OverviewTab extends Tab {
  41     JPanel gridPanel;
  42     TimeComboBox timeComboBox;
  43 
  44     public static String getTabName() {
  45         return getText("Overview");
  46     }
  47 
  48     public OverviewTab(VMPanel vmPanel) {
  49         super(vmPanel, getTabName());
  50 
  51         setBorder(new EmptyBorder(4, 4, 3, 4));
  52         setLayout(new BorderLayout());
  53 
  54         JPanel topPanel     = new JPanel(new BorderLayout());
  55         add(topPanel, BorderLayout.NORTH);
  56 
  57         JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 20, 5));
  58         topPanel.add(controlPanel, BorderLayout.CENTER);
  59 
  60         timeComboBox = new TimeComboBox();
  61         LabeledComponent lc = new LabeledComponent(Resources.getText("Time Range:"),
  62                                                    getMnemonicInt("Time Range:"),
  63                                                    timeComboBox);
  64         controlPanel.add(lc);
  65 
  66         gridPanel = new JPanel(new AutoGridLayout(10, 6));
  67         gridPanel.setBorder(null);
  68         JScrollPane sp = new JScrollPane(gridPanel);
  69         sp.setBorder(null);
  70         sp.setViewportBorder(null);
  71         add(sp, BorderLayout.CENTER);
  72 
  73         // Note that panels are added on first update
  74     }
  75 
  76 
  77     public SwingWorker<?, ?> newSwingWorker() {
  78         return new SwingWorker<Object, Object>() {
  79             public Object doInBackground() {
  80                 return null;
  81             }
  82 




   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.tools.jconsole;
  27 
  28 import java.awt.*;

  29 import java.util.ArrayList;
  30 
  31 import javax.swing.*;
  32 import javax.swing.border.*;
  33 
  34 import sun.tools.jconsole.resources.Messages;


  35 
  36 @SuppressWarnings("serial")
  37 class OverviewTab extends Tab {
  38     JPanel gridPanel;
  39     TimeComboBox timeComboBox;
  40 
  41     public static String getTabName() {
  42         return Messages.OVERVIEW;
  43     }
  44 
  45     public OverviewTab(VMPanel vmPanel) {
  46         super(vmPanel, getTabName());
  47 
  48         setBorder(new EmptyBorder(4, 4, 3, 4));
  49         setLayout(new BorderLayout());
  50 
  51         JPanel topPanel     = new JPanel(new BorderLayout());
  52         add(topPanel, BorderLayout.NORTH);
  53 
  54         JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 20, 5));
  55         topPanel.add(controlPanel, BorderLayout.CENTER);
  56 
  57         timeComboBox = new TimeComboBox();
  58         LabeledComponent lc = new LabeledComponent(Messages.TIME_RANGE_COLON,
  59                 Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
  60                                                    timeComboBox);
  61         controlPanel.add(lc);
  62 
  63         gridPanel = new JPanel(new AutoGridLayout(10, 6));
  64         gridPanel.setBorder(null);
  65         JScrollPane sp = new JScrollPane(gridPanel);
  66         sp.setBorder(null);
  67         sp.setViewportBorder(null);
  68         add(sp, BorderLayout.CENTER);
  69 
  70         // Note that panels are added on first update
  71     }
  72 
  73 
  74     public SwingWorker<?, ?> newSwingWorker() {
  75         return new SwingWorker<Object, Object>() {
  76             public Object doInBackground() {
  77                 return null;
  78             }
  79