jconsole

16:37:20.657 INFO  jd.cli.Main - Decompiling jconsole.jar
package sun.tools.jconsole;

import java.awt.Color;
import java.awt.Graphics;
import javax.swing.Icon;
import javax.swing.JLabel;

class AboutDialog$1
  extends JLabel
{
  AboutDialog$1(AboutDialog paramAboutDialog, Icon paramIcon)
  {
    super(paramIcon);
  }
  
  public void paint(Graphics paramGraphics)
  {
    super.paint(paramGraphics);
    
    Color localColor = paramGraphics.getColor();
    paramGraphics.setColor(new Color(192, 192, 192));
    paramGraphics.drawLine(0, getHeight() - 1, getWidth(), getHeight() - 1);
    paramGraphics.setColor(null);
  }
}

/* Location:
 * Qualified Name:     sun.tools.jconsole.AboutDialog.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.jconsole;

import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkEvent.EventType;
import javax.swing.event.HyperlinkListener;

class AboutDialog$2
  implements HyperlinkListener
{
  AboutDialog$2(AboutDialog paramAboutDialog) {}
  
  public void hyperlinkUpdate(HyperlinkEvent paramHyperlinkEvent)
  {
    if (paramHyperlinkEvent.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
      this$0.browse(paramHyperlinkEvent.getDescription());
    }
  }
}

/* Location:
 * Qualified Name:     sun.tools.jconsole.AboutDialog.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.jconsole;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JLabel;

class AboutDialog$3
  extends AbstractAction
{
  AboutDialog$3(AboutDialog paramAboutDialog, String paramString)
  {
    super(paramString);
  }
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    this$0.setVisible(false);
    AboutDialog.access$000(this$0).setText("");
  }
}

/* Location:
 * Qualified Name:     sun.tools.jconsole.AboutDialog.3
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.jconsole;

import java.awt.BorderLayout;
import javax.swing.JPanel;

class AboutDialog$TPanel
  extends JPanel
{
  AboutDialog$TPanel(int paramInt1, int paramInt2)
  {
    super(new BorderLayout(paramInt1, paramInt2));
    setOpaque(false);
  }
}

/* Location:
 * Qualified Name:     sun.tools.jconsole.AboutDialog.TPanel
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.jconsole;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Desktop;
import java.awt.Desktop.Action;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.beans.PropertyVetoException;
import java.net.URI;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JEditorPane;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkEvent.EventType;
import javax.swing.event.HyperlinkListener;

public class AboutDialog
  extends InternalDialog
{
  private static final Color textColor = new Color(87, 88, 89);
  private static final Color bgColor = Color.white;
  private static final Color borderColor = Color.black;
  private Icon mastheadIcon = new InternalDialog.MastheadIcon(this, Resources.getText("Help.AboutDialog.masthead.title", new Object[0]));
  private static AboutDialog aboutDialog;
  private JLabel statusBar;
  private Action closeAction;
  
  public AboutDialog(JConsole paramJConsole)
  {
    super(paramJConsole, Resources.getText("Help.AboutDialog.title", new Object[0]), false);
    
    Utilities.setAccessibleDescription(this, Resources.getText("Help.AboutDialog.accessibleDescription", new Object[0]));
    
    setDefaultCloseOperation(1);
    setResizable(false);
    JComponent localJComponent = (JComponent)getContentPane();
    
    createActions();
    
    JLabel local1 = new JLabel(mastheadIcon)
    {
      public void paint(Graphics paramAnonymousGraphics)
      {
        super.paint(paramAnonymousGraphics);
        
        Color localColor = paramAnonymousGraphics.getColor();
        paramAnonymousGraphics.setColor(new Color(192, 192, 192));
        paramAnonymousGraphics.drawLine(0, getHeight() - 1, getWidth(), getHeight() - 1);
        paramAnonymousGraphics.setColor(null);
      }
    };
    Utilities.setAccessibleName(local1, Resources.getText("Help.AboutDialog.masthead.accessibleName", new Object[0]));
    
    TPanel localTPanel1 = new TPanel(0, 0);
    localTPanel1.add(local1, "North");
    
    String str1 = Version.getVersion();
    String str2 = System.getProperty("java.vm.name");
    String str3 = System.getProperty("java.vm.version");
    String str4 = Resources.getText("Help.AboutDialog.userGuideLink.linkText", new Object[0]);
    String str5 = Resources.getText("Help.AboutDialog.userGuideLink.url", new Object[0]);
    if (isBrowseSupported()) {
      str5 = "<a style='color:#FF0000; text-decoration:none; font-weight:bold' href=\"" + str5 + "\">" + str4 + "</a>";
    }
    JPanel localJPanel1 = new JPanel(new BorderLayout(10, 10));
    localJPanel1.setBackground(bgColor);
    
    String str6 = String.format("%06x", new Object[] { Integer.valueOf(textColor.getRGB() & 0xFFFFFF) });
    JEditorPane localJEditorPane = new JEditorPane("text/html", "<html><font color=#" + str6 + ">" + Resources.getText("Help.AboutDialog.jConsoleVersion", new Object[] { str1 }) + "<p>" + Resources.getText("Help.AboutDialog.javaVersion", new Object[] { str2 + ", " + str3 }) + (isBrowseSupported() ? "<p>" + str5 : new StringBuilder().append("<p>").append(Resources.getText("Help.AboutDialog.userGuideLink", new Object[] { str5 })).toString()) + "</html>");
    
    localJEditorPane.setOpaque(false);
    localJEditorPane.setEditable(false);
    localJEditorPane.setForeground(textColor);
    localTPanel1.setBorder(BorderFactory.createLineBorder(borderColor));
    localJPanel1.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    localJEditorPane.addHyperlinkListener(new HyperlinkListener()
    {
      public void hyperlinkUpdate(HyperlinkEvent paramAnonymousHyperlinkEvent)
      {
        if (paramAnonymousHyperlinkEvent.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
          browse(paramAnonymousHyperlinkEvent.getDescription());
        }
      }
    });
    localJPanel1.add(localJEditorPane, "North");
    
    ImageIcon localImageIcon = new ImageIcon(getClass().getResource("resources/about-OracleLogo.png"));
    JLabel localJLabel = new JLabel(localImageIcon, 10);
    
    JButton localJButton = new JButton(closeAction);
    
    TPanel localTPanel2 = new TPanel(0, 0);
    JPanel localJPanel2 = new JPanel(new FlowLayout(4));
    localJPanel2.setOpaque(false);
    
    localTPanel1.add(localJPanel1, "Center");
    localJComponent.add(localTPanel2, "South");
    
    localJPanel1.add(localJLabel, "South");
    
    localJPanel2.setBorder(new EmptyBorder(2, 12, 2, 12));
    localJPanel2.add(localJButton);
    localTPanel2.add(localJPanel2, "North");
    
    statusBar = new JLabel(" ");
    localTPanel2.add(statusBar, "South");
    
    localJComponent.add(localTPanel1, "North");
    
    pack();
    setLocationRelativeTo(paramJConsole);
    Utilities.updateTransparency(this);
  }
  
  public void showDialog()
  {
    statusBar.setText(" ");
    setVisible(true);
    try
    {
      setSelected(true);
    }
    catch (PropertyVetoException localPropertyVetoException) {}
  }
  
  private static AboutDialog getAboutDialog(JConsole paramJConsole)
  {
    if (aboutDialog == null) {
      aboutDialog = new AboutDialog(paramJConsole);
    }
    return aboutDialog;
  }
  
  static void showAboutDialog(JConsole paramJConsole)
  {
    getAboutDialog(paramJConsole).showDialog();
  }
  
  static void browseUserGuide(JConsole paramJConsole)
  {
    getAboutDialog(paramJConsole).browse(Resources.getText("Help.AboutDialog.userGuideLink.url", new Object[0]));
  }
  
  static boolean isBrowseSupported()
  {
    return (Desktop.isDesktopSupported()) && (Desktop.getDesktop().isSupported(Desktop.Action.BROWSE));
  }
  
  void browse(String paramString)
  {
    try
    {
      Desktop.getDesktop().browse(new URI(paramString));
    }
    catch (Exception localException)
    {
      showDialog();
      statusBar.setText(localException.getLocalizedMessage());
      if (JConsole.isDebug()) {
        localException.printStackTrace();
      }
    }
  }
  
  private void createActions()
  {
    closeAction = new AbstractAction(Resources.getText("Close", new Object[0]))
    {
      public void actionPerformed(ActionEvent paramAnonymousActionEvent)
      {
        setVisible(false);
        statusBar.setText("");
      }
    };
  }
  
  private static class TPanel
    extends JPanel
  {
    TPanel(int paramInt1, int paramInt2)
    {
      super();
      setOpaque(false);
    }
  }
}

/* Location:
 * Qualified Name:     sun.tools.jconsole.AboutDialog
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.jconsole;

import java.awt.Dimension;
import java.awt.LayoutManager;
import javax.swing.JLabel;
import javax.swing.JPanel;

class BorderedComponent$1
  extends JPanel
{
  BorderedComponent$1(BorderedComponent paramBorderedComponent, LayoutManager paramLayoutManager, JLabel paramJLabel)
  {
    super(paramLayoutManager);
  }
  
  public int getBaseline(int paramInt1, int paramInt2)
  {
    Dimension localDimension = val$textLabel.getPreferredSize();
    return val$textLabel.getBaseline(width, height) + val$textLabel.getY();
  }
}

/* Location:
 * Qualified Name:     sun.tools.jconsole.BorderedComponent.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.jconsole;

import java.awt.Component;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Polygon;
import javax.swing.Icon;
import javax.swing.JLabel;

class BorderedComponent$ArrowIcon
  implements Icon
{
  private int direction;
  private JLabel textLabel;
  
  public BorderedComponent$ArrowIcon(int paramInt, JLabel paramJLabel)
  {
    direction = paramInt;
    textLabel = paramJLabel;
  }
  
  public void paintIcon(Component paramComponent, Graphics paramGraphics, int paramInt1, int paramInt2)
  {
    int i = getIconWidth();
    int j = i;
    Polygon localPolygon = new Polygon();
    switch (direction)
    {
    case 3: 
      localPolygon.addPoint(paramInt1 + 2, paramInt2);
      localPolygon.addPoint(paramInt1 + i - 2, paramInt2 + j / 2);
      localPolygon.addPoint(paramInt1 + 2, paramInt2 + j - 1);
      break;
    case 5: 
      localPolygon.addPoint(paramInt1, paramInt2 + 2);
      localPolygon.addPoint(paramInt1 + i / 2, paramInt2 + j - 2);
      localPolygon.addPoint(paramInt1 + i - 1, paramInt2 + 2);
    }
    paramGraphics.fillPolygon(localPolygon);
  }
  
  public int getIconWidth()
  {
    return getIconHeight();
  }
  
  public int getIconHeight()
  {
    Graphics localGraphics = textLabel.getGraphics();
    if (localGraphics != null)
    {
      int i = localGraphics.getFontMetrics(textLabel.getFont()).getAscent() * 6 / 10;
      if (i % 2 == 0) {
        i++;
      }
      return i;
    }
    return 7;
  }
}

/* Location:
 * Qualified Name:     sun.tools.jconsole.BorderedComponent.ArrowIcon
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.jconsole;

import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.UIManager;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.basic.BasicGraphicsUtils;

public class BorderedComponent$FocusBorder
  extends AbstractBorder
  implements FocusListener
{
  private Component comp;
  private Color focusColor;
  private boolean focusLostTemporarily = false;
  
  public BorderedComponent$FocusBorder(Component paramComponent)
  {
    comp = paramComponent;
    
    paramComponent.addFocusListener(this);
    
    focusColor = UIManager.getColor("TabbedPane.focus");
  }
  
  public void paintBorder(Component paramComponent, Graphics paramGraphics, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    if ((comp.hasFocus()) || (focusLostTemporarily))
    {
      Color localColor = paramGraphics.getColor();
      paramGraphics.setColor(focusColor);
      BasicGraphicsUtils.drawDashedRect(paramGraphics, paramInt1, paramInt2, paramInt3, paramInt4);
      paramGraphics.setColor(localColor);
    }
  }
  
  public Insets getBorderInsets(Component paramComponent)
  {
    return getBorderInsets(paramComponent, new Insets(0, 0, 0, 0));
  }
  
  public Insets getBorderInsets(Component paramComponent, Insets paramInsets)
  {
    left = (top = right = bottom = 2);
    return paramInsets;
  }
  
  public void focusGained(FocusEvent paramFocusEvent)
  {
    comp.repaint();
  }
  
  public void focusLost(FocusEvent paramFocusEvent)
  {
    focusLostTemporarily = paramFocusEvent.isTemporary();
    if (!focusLostTemporarily) {
      comp.repaint();
    }
  }
}

/* Location:
 * Qualified Name:     sun.tools.jconsole.BorderedComponent.FocusBorder
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.jconsole;

import java.awt.Component;
import java.awt.ComponentOrientation;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.border.AbstractBorder;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import javax.swing.plaf.ColorUIResource;

public class BorderedComponent$LabeledBorder
  extends TitledBorder
{
  protected JComponent label;
  private Point compLoc = new Point();
  
  public BorderedComponent$LabeledBorder(JComponent paramJComponent)
  {
    this(null, paramJComponent);
  }
  
  public BorderedComponent$LabeledBorder(Border paramBorder)
  {
    this(paramBorder, null);
  }
  
  public BorderedComponent$LabeledBorder(Border paramBorder, JComponent paramJComponent)
  {
    super(paramBorder);
    
    label = paramJComponent;
    if (((paramJComponent instanceof JLabel)) && ((paramJComponent.getForeground() instanceof ColorUIResource))) {
      paramJComponent.setForeground(getTitleColor());
    }
  }
  
  public void paintBorder(Component paramComponent, Graphics paramGraphics, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    Border localBorder = getBorder();
    if (label == null)
    {
      if (localBorder != null) {
        localBorder.paintBorder(paramComponent, paramGraphics, paramInt1, paramInt2, paramInt3, paramInt4);
      }
      return;
    }
    Rectangle localRectangle1 = new Rectangle(paramInt1 + 2, paramInt2 + 2, paramInt3 - 4, paramInt4 - 4);
    
    Dimension localDimension = label.getPreferredSize();
    int i = label.getBaseline(width, height);
    int j = Math.max(0, i);
    int k = height - j;
    Insets localInsets;
    if (localBorder != null) {
      localInsets = localBorder.getBorderInsets(paramComponent);
    } else {
      localInsets = new Insets(0, 0, 0, 0);
    }
    int m = Math.max(0, j / 2 + 2 - 2);
    y += m;
    height -= m;
    compLoc.y = (y + top / 2 - (j + k) / 2 - 1);
    int n;
    if (paramComponent.getComponentOrientation().isLeftToRight()) {
      n = 1;
    } else {
      n = 3;
    }
    switch (n)
    {
    case 1: 
      compLoc.x = (x + 5 + left);
      break;
    case 3: 
      compLoc.x = (x + width - (width + 5 + right));
    }
    if (localBorder != null)
    {
      if (y > compLoc.y - j)
      {
        Rectangle localRectangle2 = new Rectangle();
        
        Rectangle localRectangle3 = paramGraphics.getClipBounds();
        
        localRectangle2.setBounds(localRectangle3);
        if (computeIntersection(localRectangle2, paramInt1, paramInt2, compLoc.x - 1 - paramInt1, paramInt4))
        {
          paramGraphics.setClip(localRectangle2);
          localBorder.paintBorder(paramComponent, paramGraphics, x, y, width, height);
        }
        localRectangle2.setBounds(localRectangle3);
        if (computeIntersection(localRectangle2, compLoc.x + width + 1, paramInt2, paramInt1 + paramInt3 - (compLoc.x + width + 1), paramInt4))
        {
          paramGraphics.setClip(localRectangle2);
          localBorder.paintBorder(paramComponent, paramGraphics, x, y, width, height);
        }
        localRectangle2.setBounds(localRectangle3);
        if (computeIntersection(localRectangle2, compLoc.x - 1, compLoc.y + j + k, width + 2, paramInt2 + paramInt4 - compLoc.y - j - k))
        {
          paramGraphics.setClip(localRectangle2);
          localBorder.paintBorder(paramComponent, paramGraphics, x, y, width, height);
        }
        paramGraphics.setClip(localRectangle3);
      }
      else
      {
        localBorder.paintBorder(paramComponent, paramGraphics, x, y, width, height);
      }
      label.setLocation(compLoc);
      label.setSize(localDimension);
    }
  }
  
  public Insets getBorderInsets(Component paramComponent, Insets paramInsets)
  {
    int i = 16;
    
    Border localBorder = getBorder();
    if (localBorder != null)
    {
      if ((localBorder instanceof AbstractBorder))
      {
        ((AbstractBorder)localBorder).getBorderInsets(paramComponent, paramInsets);
      }
      else
      {
        Insets localInsets = localBorder.getBorderInsets(paramComponent);
        top = top;
        right = right;
        bottom = bottom;
        left = left;
      }
    }
    else {
      left = (top = right = bottom = 0);
    }
    left += 4;
    right += 4;
    top += 4;
    bottom += 4;
    if ((paramComponent == null) || (label == null)) {
      return paramInsets;
    }
    top += label.getHeight();
    
    return paramInsets;
  }
  
  public JComponent getLabel()
  {
    return label;
  }
  
  public void setLabel(JComponent paramJComponent)
  {
    label = paramJComponent;
  }
  
  public Dimension getMinimumSize(Component paramComponent)
  {
    Insets localInsets = getBorderInsets(paramComponent);
    Dimension localDimension = new Dimension(right + left, top + bottom);
    
    width += label.getWidth();
    
    return localDimension;
  }
  
  private static boolean computeIntersection(Rectangle paramRectangle, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    int i = Math.max(paramInt1, x);
    int j = Math.min(paramInt1 + paramInt3, x + width);
    int k = Math.max(paramInt2, y);
    int m = Math.min(paramInt2 + paramInt4, y + height);
    x = i;
    y = k;
    width = (j - i);
    height = (m - k);
    if ((width <= 0) || (height <= 0)) {
      return false;
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     sun.tools.jconsole.BorderedComponent.LabeledBorder
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.jconsole;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.ComponentOrientation;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.awt.Point;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.UIManager;
import javax.swing.border.AbstractBorder;
import javax.swing.border.Border;
import javax.swing.border.CompoundBorder;
import javax.swing.border.TitledBorder;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.basic.BasicGraphicsUtils;

public class BorderedComponent
  extends JPanel
  implements ActionListener
{
  JButton moreOrLessButton;
  String valueLabelStr;
  JLabel label;
  JComponent comp;
  boolean collapsed = false;
  private JPopupMenu popupMenu;
  private Icon collapseIcon;
  private Icon expandIcon;
  
  private static Image getImage(String paramString)
  {
    Toolkit localToolkit = Toolkit.getDefaultToolkit();
    paramString = "resources/" + paramString + ".png";
    return localToolkit.getImage(BorderedComponent.class.getResource(paramString));
  }
  
  public BorderedComponent(String paramString)
  {
    this(paramString, null, false);
  }
  
  public BorderedComponent(String paramString, JComponent paramJComponent)
  {
    this(paramString, paramJComponent, false);
  }
  
  public BorderedComponent(String paramString, JComponent paramJComponent, boolean paramBoolean)
  {
    super(null);
    
    comp = paramJComponent;
    if (paramString != null)
    {
      Object localObject;
      if (paramBoolean)
      {
        final JLabel localJLabel = new JLabel(paramString);
        JPanel local1 = new JPanel(new FlowLayout(0, 2, 0))
        {
          public int getBaseline(int paramAnonymousInt1, int paramAnonymousInt2)
          {
            Dimension localDimension = localJLabel.getPreferredSize();
            return localJLabel.getBaseline(width, height) + localJLabel.getY();
          }
        };
        local1.add(localJLabel);
        localObject = new LabeledBorder(local1);
        localJLabel.setForeground(((TitledBorder)localObject).getTitleColor());
        if (JConsole.IS_WIN)
        {
          collapseIcon = new ImageIcon(getImage("collapse-winlf"));
          expandIcon = new ImageIcon(getImage("expand-winlf"));
        }
        else
        {
          collapseIcon = new ArrowIcon(5, localJLabel);
          expandIcon = new ArrowIcon(3, localJLabel);
        }
        moreOrLessButton = new JButton(collapseIcon);
        moreOrLessButton.setContentAreaFilled(false);
        moreOrLessButton.setBorderPainted(false);
        moreOrLessButton.setMargin(new Insets(0, 0, 0, 0));
        moreOrLessButton.addActionListener(this);
        String str = Resources.getText("BorderedComponent.moreOrLessButton.toolTip", new Object[0]);
        
        moreOrLessButton.setToolTipText(str);
        local1.add(moreOrLessButton);
        local1.setSize(local1.getPreferredSize());
        add(local1);
      }
      else
      {
        localObject = new TitledBorder(paramString);
      }
      setBorder(new CompoundBorder(new FocusBorder(this), (Border)localObject));
    }
    else
    {
      setBorder(new FocusBorder(this));
    }
    if (paramJComponent != null) {
      add(paramJComponent);
    }
  }
  
  public void setComponent(JComponent paramJComponent)
  {
    if (comp != null) {
      remove(comp);
    }
    comp = paramJComponent;
    if (!collapsed)
    {
      LayoutManager localLayoutManager = getLayout();
      if ((localLayoutManager instanceof BorderLayout)) {
        add(paramJComponent, "Center");
      } else {
        add(paramJComponent);
      }
    }
    revalidate();
  }
  
  public void setValueLabel(String paramString)
  {
    valueLabelStr = paramString;
    if (label != null) {
      label.setText(Resources.getText("Current value", new Object[] { valueLabelStr }));
    }
  }
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    if (collapsed)
    {
      if (label != null) {
        remove(label);
      }
      add(comp);
      moreOrLessButton.setIcon(collapseIcon);
    }
    else
    {
      remove(comp);
      if (valueLabelStr != null)
      {
        if (label == null) {
          label = new JLabel(Resources.getText("Current value", new Object[] { valueLabelStr }));
        }
        add(label);
      }
      moreOrLessButton.setIcon(expandIcon);
    }
    collapsed = (!collapsed);
    
    JComponent localJComponent = (JComponent)getParent();
    if ((localJComponent != null) && ((localJComponent.getLayout() instanceof VariableGridLayout)))
    {
      ((VariableGridLayout)localJComponent.getLayout()).setFillRow(this, !collapsed);
      localJComponent.revalidate();
    }
  }
  
  public Dimension getMinimumSize()
  {
    if (getLayout() != null) {
      return super.getMinimumSize();
    }
    if (moreOrLessButton != null)
    {
      Dimension localDimension = moreOrLessButton.getMinimumSize();
      Insets localInsets = getInsets();
      width += left + right;
      height += top + bottom;
      return localDimension;
    }
    return super.getMinimumSize();
  }
  
  public void doLayout()
  {
    if (getLayout() != null)
    {
      super.doLayout();
      return;
    }
    Dimension localDimension1 = getSize();
    Insets localInsets = getInsets();
    if (collapsed)
    {
      if (label != null)
      {
        Dimension localDimension2 = label.getPreferredSize();
        label.setBounds(left, top + (height - top - bottom - height) / 2, width, height);
      }
    }
    else if (comp != null) {
      comp.setBounds(left, top, width - left - right, height - top - bottom);
    }
  }
  
  private static class ArrowIcon
    implements Icon
  {
    private int direction;
    private JLabel textLabel;
    
    public ArrowIcon(int paramInt, JLabel paramJLabel)
    {
      direction = paramInt;
      textLabel = paramJLabel;
    }
    
    public void paintIcon(Component paramComponent, Graphics paramGraphics, int paramInt1, int paramInt2)
    {
      int i = getIconWidth();
      int j = i;
      Polygon localPolygon = new Polygon();
      switch (direction)
      {
      case 3: 
        localPolygon.addPoint(paramInt1 + 2, paramInt2);
        localPolygon.addPoint(paramInt1 + i - 2, paramInt2 + j / 2);
        localPolygon.addPoint(paramInt1 + 2, paramInt2 + j - 1);
        break;
      case 5: 
        localPolygon.addPoint(paramInt1, paramInt2 + 2);
        localPolygon.addPoint(paramInt1 + i / 2, paramInt2 + j - 2);
        localPolygon.addPoint(paramInt1 + i - 1, paramInt2 + 2);
      }
      paramGraphics.fillPolygon(localPolygon);
    }
    
    public int getIconWidth()
    {
      return getIconHeight();
    }
    
    public int getIconHeight()
    {
      Graphics localGraphics = textLabel.getGraphics();
      if (localGraphics != null)
      {
        int i = localGraphics.getFontMetrics(textLabel.getFont()).getAscent() * 6 / 10;
        if (i % 2 == 0) {
          i++;
        }
        return i;
      }
      return 7;
    }
  }
  
  protected static class LabeledBorder
    extends TitledBorder
  {
    protected JComponent label;
    private Point compLoc = new Point();
    
    public LabeledBorder(JComponent paramJComponent)
    {
      this(null, paramJComponent);
    }
    
    public LabeledBorder(Border paramBorder)
    {
      this(paramBorder, null);
    }
    
    public LabeledBorder(Border paramBorder, JComponent paramJComponent)
    {
      super();
      
      label = paramJComponent;
      if (((paramJComponent instanceof JLabel)) && ((paramJComponent.getForeground() instanceof ColorUIResource))) {
        paramJComponent.setForeground(getTitleColor());
      }
    }
    
    public void paintBorder(Component paramComponent, Graphics paramGraphics, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
    {
      Border localBorder = getBorder();
      if (label == null)
      {
        if (localBorder != null) {
          localBorder.paintBorder(paramComponent, paramGraphics, paramInt1, paramInt2, paramInt3, paramInt4);
        }
        return;
      }
      Rectangle localRectangle1 = new Rectangle(paramInt1 + 2, paramInt2 + 2, paramInt3 - 4, paramInt4 - 4);
      
      Dimension localDimension = label.getPreferredSize();
      int i = label.getBaseline(width, height);
      int j = Math.max(0, i);
      int k = height - j;
      Insets localInsets;
      if (localBorder != null) {
        localInsets = localBorder.getBorderInsets(paramComponent);
      } else {
        localInsets = new Insets(0, 0, 0, 0);
      }
      int m = Math.max(0, j / 2 + 2 - 2);
      y += m;
      height -= m;
      compLoc.y = (y + top / 2 - (j + k) / 2 - 1);
      int n;
      if (paramComponent.getComponentOrientation().isLeftToRight()) {
        n = 1;
      } else {
        n = 3;
      }
      switch (n)
      {
      case 1: 
        compLoc.x = (x + 5 + left);
        break;
      case 3: 
        compLoc.x = (x + width - (width + 5 + right));
      }
      if (localBorder != null)
      {
        if (y > compLoc.y - j)
        {
          Rectangle localRectangle2 = new Rectangle();
          
          Rectangle localRectangle3 = paramGraphics.getClipBounds();
          
          localRectangle2.setBounds(localRectangle3);
          if (computeIntersection(localRectangle2, paramInt1, paramInt2, compLoc.x - 1 - paramInt1, paramInt4))
          {
            paramGraphics.setClip(localRectangle2);
            localBorder.paintBorder(paramComponent, paramGraphics, x, y, width, height);
          }
          localRectangle2.setBounds(localRectangle3);
          if (computeIntersection(localRectangle2, compLoc.x + width + 1, paramInt2, paramInt1 + paramInt3 - (compLoc.x + width + 1), paramInt4))
          {
            paramGraphics.setClip(localRectangle2);
            localBorder.paintBorder(paramComponent, paramGraphics, x, y, width, height);
          }
          localRectangle2.setBounds(localRectangle3);
          if (computeIntersection(localRectangle2, compLoc.x - 1, compLoc.y + j + k, width + 2, paramInt2 + paramInt4 - compLoc.y - j - k))
          {
            paramGraphics.setClip(localRectangle2);
            localBorder.paintBorder(paramComponent, paramGraphics, x, y, width, height);
          }
          paramGraphics.setClip(localRectangle3);
        }
        else
        {
          localBorder.paintBorder(paramComponent, paramGraphics, x, y, width, height);
        }
        label.setLocation(compLoc);
        label.setSize(localDimension);
      }
    }
    
    public Insets getBorderInsets(Component paramComponent, Insets paramInsets)
    {
      int i = 16;
      
      Border localBorder = getBorder();
      if (localBorder != null)
      {
        if ((localBorder instanceof AbstractBorder))
        {
          ((AbstractBorder)localBorder).getBorderInsets(paramComponent, paramInsets);
        }
        else
        {
          Insets localInsets = localBorder.getBorderInsets(paramComponent);
          top = top;
          right = right;
          bottom = bottom;
          left = left;
        }
      }
      else {
        left = (top = right = bottom = 0);
      }
      left += 4;
      right += 4;
      top += 4;
      bottom += 4;
      if ((paramComponent == null) || (label == null)) {
        return paramInsets;
      }
      top += label.getHeight();
      
      return paramInsets;
    }
    
    public JComponent getLabel()
    {
      return label;
    }
    
    public void setLabel(JComponent paramJComponent)
    {
      label = paramJComponent;
    }
    
    public Dimension getMinimumSize(Component paramComponent)
    {
      Insets localInsets = getBorderInsets(paramComponent);
      Dimension localDimension = new Dimension(right + left, top + bottom);
      
      width += label.getWidth();
      
      return localDimension;
    }
    
    private static boolean computeIntersection(Rectangle paramRectangle, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
    {
      int i = Math.max(paramInt1, x);
      int j = Math.min(paramInt1 + paramInt3, x + width);
      int k = Math.max(paramInt2, y);
      int m = Math.min(paramInt2 + paramInt4, y + height);
      x = i;
      y = k;
      width = (j - i);
      height = (m - k);
      if ((width <= 0) || (height <= 0)) {
        return false;
      }
      return true;
    }
  }
  
  protected static class FocusBorder
    extends AbstractBorder
    implements FocusListener
  {
    private Component comp;
    private Color focusColor;
    private boolean focusLostTemporarily = false;
    
    public FocusBorder(Component paramComponent)
    {
      comp = paramComponent;
      
      paramComponent.addFocusListener(this);
      
      focusColor = UIManager.getColor("TabbedPane.focus");
    }
    
    public void paintBorder(Component paramComponent, Graphics paramGraphics, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
    {
      if ((comp.hasFocus()) || (focusLostTemporarily))
      {
        Color localColor = paramGraphics.getColor();
        paramGraphics.setColor(focusColor);
        BasicGraphicsUtils.drawDashedRect(paramGraphics, paramInt1, paramInt2, paramInt3, paramInt4);
        paramGraphics.setColor(localColor);
      }
    }
    
    public Insets getBorderInsets(Component paramComponent)
    {
      return getBorderInsets(paramComponent, new Insets(0, 0, 0, 0));
    }
    
    public Insets getBorderInsets(Component paramComponent, Insets paramInsets)
    {
      left = (top = right = bottom = 2);
      return paramInsets;
    }
    
    public void focusGained(FocusEvent paramFocusEvent)
    {
      comp.repaint();
    }
    
    public void focusLost(FocusEvent paramFocusEvent)
    {
      focusLostTemporarily = paramFocusEvent.isTemporary();
      if (!focusLostTemporarily) {
        comp.repaint();
      }
    }
  }
}

/* Location:
 * Qualified Name:     sun.tools.jconsole.BorderedComponent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.jconsole;

import java.io.IOException;
import java.lang.management.ClassLoadingMXBean;
import java.lang.reflect.UndeclaredThrowableException;

class ClassTab$1
  implements Runnable
{
  ClassTab$1(ClassTab paramClassTab, boolean paramBoolean) {}
  
  public void run()
  {
    ProxyClient localProxyClient = this$0.vmPanel.getProxyClient();
    try
    {
      localProxyClient.getClassLoadingMXBean().setVerbose(val$b);
    }
    catch (UndeclaredThrowableException localUndeclaredThrowableException)
    {
      localProxyClient.markAsDead();
    }
    catch (IOException localIOException) {}
  }
}

/* Location:
 * Qualified Name:     sun.tools.jconsole.ClassTab.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.jconsole;

import java.io.IOException;
import java.lang.management.ClassLoadingMXBean;
import java.lang.reflect.UndeclaredThrowableException;
import java.util.concurrent.ExecutionException;
import javax.swing.JCheckBox;
import javax.swing.SwingWorker;

class ClassTab$2
  extends SwingWorker<Boolean, Object>
{
  private long clCount;
  private long cuCount;
  private long ctCount;
  private boolean isVerbose;
  private String detailsStr;
  private long timeStamp;
  
  ClassTab$2(ClassTab paramClassTab, ProxyClient paramProxyClient) {}
  
  public Boolean doInBackground()
  {
    try
    {
      ClassLoadingMXBean localClassLoadingMXBean = val$proxyClient.getClassLoadingMXBean();
      
      clCount = localClassLoadingMXBean.getLoadedClassCount();
      cuCount = localClassLoadingMXBean.getUnloadedClassCount();
      ctCount = localClassLoadingMXBean.getTotalLoadedClassCount();
      isVerbose = localClassLoadingMXBean.isVerbose();
      detailsStr = formatDetails();
      timeStamp = System.currentTimeMillis();
      
      return Boolean.valueOf(true);
    }
    catch (UndeclaredThrowableException localUndeclaredThrowableException)
    {
      val$proxyClient.markAsDead();
      return Boolean.valueOf(false);
    }
    catch (IOException localIOException) {}
    return Boolean.valueOf(false);
  }
  
  protected void done()
  {
    try
    {
      if (((Boolean)get()).booleanValue())
      {
        this$0.loadedClassesMeter.plotter.addValues(timeStamp, new long[] { clCount, ctCount });
        if (ClassTab.access$000(this$0) != null)
        {
          ClassTab.ClassOverviewPanel.access$100(ClassTab.access$000(this$0), ctCount, clCount);
          ClassTab.access$000(this$0).getPlotter().addValues(timeStamp, new long[] { clCount });
        }
        this$0.loadedClassesMeter.setValueLabel(clCount + "");
        ClassTab.access$200(this$0).setSelected(isVerbose);
        ClassTab.access$300(this$0).setText(detailsStr);
      }
    }
    catch (InterruptedException localInterruptedException) {}catch (ExecutionException localExecutionException)
    {
      if (JConsole.isDebug()) {
        localExecutionException.printStackTrace();
      }
    }
  }
  
  private String formatDetails()
  {
    String str1 = "<table cellspacing=0 cellpadding=0>";
    
    long l = System.currentTimeMillis();
    String str2 = Formatter.formatDateTime(l);
    str1 = str1 + Formatter.newRow(Resources.getText("Time", new Object[0]), str2);
    str1 = str1 + Formatter.newRow(Resources.getText("Current classes loaded", new Object[0]), Formatter.justify(clCount, 5));
    str1 = str1 + Formatter.newRow(Resources.getText("Total classes loaded", new Object[0]), Formatter.justify(ctCount, 5));
    str1 = str1 + Formatter.newRow(Resources.getText("Total classes unloaded", new Object[0]), Formatter.justify(cuCount, 5));
    
    return str1;
  }
}

/* Location:
 * Qualified Name:     sun.tools.jconsole.ClassTab.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.jconsole;

import javax.swing.JLabel;

class ClassTab$ClassOverviewPanel
  extends OverviewPanel
{
  ClassTab$ClassOverviewPanel()
  {
    super(Resources.getText("Classes", new Object[0]), "loaded", ClassTab.access$400(), null);
  }
  
  private void updateClassInfo(long paramLong1, long paramLong2)
  {
    long l = paramLong1 - paramLong2;
    getInfoLabel().setText(Resources.getText("ClassTab.infoLabelFormat", new Object[] { Long.valueOf(paramLong2), Long.valueOf(l), Long.valueOf(paramLong1) }));
  }
}

/* Location:
 * Qualified Name:     sun.tools.jconsole.ClassTab.ClassOverviewPanel
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package sun.tools.jconsole;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.lang.management.ClassLoadingMXBean;
import java.lang.reflect.UndeclaredThrowableException;
import java.util.concurrent.ExecutionException;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingWorker;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;

class ClassTab
  extends Tab
  implements ActionListener
{
  PlotterPanel loadedClassesMeter;
  TimeComboBox timeComboBox;
  private JCheckBox verboseCheckBox;
  private HTMLPane details;
  private ClassOverviewPanel overviewPanel;
  private boolean plotterListening = false;
  private static final String loadedPlotterKey = "loaded";
  private static final String totalLoadedPlotterKey = "totalLoaded";
  private static final String loadedPlotterName = Resources.getText("Loaded", new Object[0]);
  private static final String totalLoadedPlotterName = Resources.getText("Total Loaded", new Object[0]);
  private static final Color loadedPlotterColor = Plotter.defaultColor;
  private static final Color totalLoadedPlotterColor = Color.red;
  private static final String infoLabelFormat = "ClassTab.infoLabelFormat";
  
  public static String getTabName()
  {
    return Resources.getText("Classes", new Object[0]);
  }
  
  public ClassTab(VMPanel paramVMPanel)
  {
    super(paramVMPanel, getTabName());
    
    setLayout(new BorderLayout(0, 0));
    setBorder(new EmptyBorder(4, 4, 3, 4));
    
    JPanel localJPanel1 = new JPanel(new BorderLayout());
    JPanel localJPanel2 = new JPanel(new BorderLayout());
    JPanel localJPanel3 = new JPanel(new BorderLayout
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd