sa-jdi

eCellRenderer)tcr).getLeafIcon();
      }
      else
      {
        Icon icon;
        if (this$0.tree.isExpanded(offsetRow)) {
          icon = ((DefaultTreeCellRenderer)tcr).getOpenIcon();
        } else {
          icon = ((DefaultTreeCellRenderer)tcr).getClosedIcon();
        }
      }
      if (icon != null) {
        offset += ((DefaultTreeCellRenderer)tcr).getIconTextGap() + icon.getIconWidth();
      }
    }
    getComponentoffset = offset;
    return component;
  }
  
  public boolean isCellEditable(EventObject e)
  {
    if ((e instanceof MouseEvent))
    {
      MouseEvent me = (MouseEvent)e;
      if ((me.getModifiers() == 0) || (me.getModifiers() == 16)) {
        for (int counter = this$0.getColumnCount() - 1; counter >= 0; counter--) {
          if (this$0.getColumnClass(counter) == (JTreeTable.class$sun$jvm$hotspot$ui$treetable$TreeTableModel == null ? (JTreeTable.class$sun$jvm$hotspot$ui$treetable$TreeTableModel = JTreeTable.class$("sun.jvm.hotspot.ui.treetable.TreeTableModel")) : JTreeTable.class$sun$jvm$hotspot$ui$treetable$TreeTableModel))
          {
            MouseEvent newME = new MouseEvent(this$0.tree, me.getID(), me.getWhen(), me.getModifiers(), me.getX() - this$0.getCellRect(0, counter, true).x, me.getY(), me.getClickCount(), me.isPopupTrigger());
            
            this$0.tree.dispatchEvent(newME);
            break;
          }
        }
      }
      if (me.getClickCount() >= 3) {
        return JTreeTable.access$200(this$0);
      }
      return false;
    }
    if (e == null) {
      return JTreeTable.access$200(this$0);
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.ui.treetable.JTreeTable.TreeTableCellEditor
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.ui.treetable;

import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import javax.swing.JTable;
import javax.swing.JTree;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.table.TableCellRenderer;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeModel;

public class JTreeTable$TreeTableCellRenderer
  extends JTree
  implements TableCellRenderer
{
  protected int visibleRow;
  protected Border highlightBorder;
  private final JTreeTable this$0;
  
  public JTreeTable$TreeTableCellRenderer(JTreeTable paramJTreeTable, TreeModel model)
  {
    super(model);
    setCellRenderer(new JTreeTable.JTreeTableCellRenderer(paramJTreeTable));
  }
  
  public void updateUI()
  {
    super.updateUI();
    
    TreeCellRenderer tcr = getCellRenderer();
    if ((tcr instanceof DefaultTreeCellRenderer))
    {
      DefaultTreeCellRenderer dtcr = (DefaultTreeCellRenderer)tcr;
      
      dtcr.setTextSelectionColor(UIManager.getColor("Table.selectionForeground"));
      
      dtcr.setBackgroundSelectionColor(UIManager.getColor("Table.selectionBackground"));
    }
  }
  
  public void setRowHeight(int rowHeight)
  {
    if (rowHeight > 0)
    {
      super.setRowHeight(rowHeight);
      if ((this$0 != null) && (this$0.getRowHeight() != rowHeight)) {
        this$0.setRowHeight(getRowHeight());
      }
    }
  }
  
  public void setBounds(int x, int y, int w, int h)
  {
    super.setBounds(x, 0, w, this$0.getHeight());
  }
  
  public void paint(Graphics g)
  {
    g.translate(0, -visibleRow * getRowHeight());
    super.paint(g);
    if (highlightBorder != null) {
      highlightBorder.paintBorder(this, g, 0, visibleRow * getRowHeight(), getWidth(), getRowHeight());
    }
  }
  
  public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
  {
    Color foreground;
    Color background;
    Color foreground;
    if (isSelected)
    {
      Color background = table.getSelectionBackground();
      foreground = table.getSelectionForeground();
    }
    else
    {
      background = table.getBackground();
      foreground = table.getForeground();
    }
    highlightBorder = null;
    if ((JTreeTable.access$100(this$0) == row) && (this$0.getEditingColumn() == column))
    {
      background = UIManager.getColor("Table.focusCellBackground");
      foreground = UIManager.getColor("Table.focusCellForeground");
    }
    else if (hasFocus)
    {
      highlightBorder = UIManager.getBorder("Table.focusCellHighlightBorder");
      if (this$0.isCellEditable(row, column))
      {
        background = UIManager.getColor("Table.focusCellBackground");
        
        foreground = UIManager.getColor("Table.focusCellForeground");
      }
    }
    visibleRow = row;
    setBackground(background);
    
    TreeCellRenderer tcr = getCellRenderer();
    if ((tcr instanceof DefaultTreeCellRenderer))
    {
      DefaultTreeCellRenderer dtcr = (DefaultTreeCellRenderer)tcr;
      if (isSelected)
      {
        dtcr.setTextSelectionColor(foreground);
        dtcr.setBackgroundSelectionColor(background);
      }
      else
      {
        dtcr.setTextNonSelectionColor(foreground);
        dtcr.setBackgroundNonSelectionColor(background);
      }
    }
    return this;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.ui.treetable.JTreeTable.TreeTableCellRenderer
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.ui.treetable;

import javax.swing.JTextField;

class JTreeTable$TreeTableTextField
  extends JTextField
{
  public int offset;
  
  public void setBounds(int x, int y, int w, int h)
  {
    int newX = Math.max(x, offset);
    super.setBounds(newX, y, w - (newX - x), h);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.ui.treetable.JTreeTable.TreeTableTextField
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.ui.treetable;

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.util.EventObject;
import javax.swing.DefaultCellEditor;
import javax.swing.DefaultListSelectionModel;
import javax.swing.Icon;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.JTree;
import javax.swing.ListSelectionModel;
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.TableCellRenderer;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeSelectionModel;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;

public class JTreeTable
  extends JTable
{
  protected TreeTableCellRenderer tree;
  private boolean treeEditable = true;
  private boolean showsIcons = true;
  
  public boolean getTreeEditable()
  {
    return treeEditable;
  }
  
  public void setTreeEditable(boolean editable)
  {
    treeEditable = editable;
  }
  
  public boolean getShowsIcons()
  {
    return showsIcons;
  }
  
  public void setShowsIcons(boolean show)
  {
    showsIcons = show;
  }
  
  public void setRootVisible(boolean visible)
  {
    tree.setRootVisible(visible);
  }
  
  public boolean getShowsRootHandles()
  {
    return tree.getShowsRootHandles();
  }
  
  public void setShowsRootHandles(boolean newValue)
  {
    tree.setShowsRootHandles(newValue);
  }
  
  public JTreeTable(TreeTableModel treeTableModel)
  {
    tree = new TreeTableCellRenderer(treeTableModel);
    
    super.setModel(new TreeTableModelAdapter(treeTableModel, tree));
    
    ListToTreeSelectionModelWrapper selectionWrapper = new ListToTreeSelectionModelWrapper();
    
    tree.setSelectionModel(selectionWrapper);
    setSelectionModel(selectionWrapper.getListSelectionModel());
    
    setDefaultRenderer(TreeTableModel.class, tree);
    setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor());
    
    setShowGrid(false);
    
    setIntercellSpacing(new Dimension(0, 0));
    if (tree.getRowHeight() < 1) {
      setRowHeight(20);
    }
  }
  
  public void updateUI()
  {
    super.updateUI();
    if (tree != null)
    {
      tree.updateUI();
      
      setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor());
    }
    LookAndFeel.installColorsAndFont(this, "Tree.background", "Tree.foreground", "Tree.font");
  }
  
  public int getEditingRow()
  {
    return getColumnClass(editingColumn) == TreeTableModel.class ? -1 : editingRow;
  }
  
  private int realEditingRow()
  {
    return editingRow;
  }
  
  public void sizeColumnsToFit(int resizingColumn)
  {
    super.sizeColumnsToFit(resizingColumn);
    if ((getEditingColumn() != -1) && (getColumnClass(editingColumn) == TreeTableModel.class))
    {
      Rectangle cellRect = getCellRect(realEditingRow(), getEditingColumn(), false);
      
      Component component = getEditorComponent();
      component.setBounds(cellRect);
      component.validate();
    }
  }
  
  public void setRowHeight(int rowHeight)
  {
    super.setRowHeight(rowHeight);
    if ((tree != null) && (tree.getRowHeight() != rowHeight)) {
      tree.setRowHeight(getRowHeight());
    }
  }
  
  public JTree getTree()
  {
    return tree;
  }
  
  public boolean editCellAt(int row, int column, EventObject e)
  {
    boolean retValue = super.editCellAt(row, column, e);
    if ((retValue) && (getColumnClass(column) == TreeTableModel.class)) {
      repaint(getCellRect(row, column, false));
    }
    return retValue;
  }
  
  class JTreeTableCellRenderer
    extends DefaultTreeCellRenderer
  {
    JTreeTableCellRenderer() {}
    
    public Icon getClosedIcon()
    {
      return showsIcons ? super.getClosedIcon() : null;
    }
    
    public Icon getDefaultClosedIcon()
    {
      return showsIcons ? super.getDefaultClosedIcon() : null;
    }
    
    public Icon getDefaultLeafIcon()
    {
      return showsIcons ? super.getDefaultLeafIcon() : null;
    }
    
    public Icon getDefaultOpenIcon()
    {
      return showsIcons ? super.getDefaultOpenIcon() : null;
    }
    
    public Icon getLeafIcon()
    {
      return showsIcons ? super.getLeafIcon() : null;
    }
    
    public Icon getOpenIcon()
    {
      return showsIcons ? super.getOpenIcon() : null;
    }
  }
  
  public class TreeTableCellRenderer
    extends JTree
    implements TableCellRenderer
  {
    protected int visibleRow;
    protected Border highlightBorder;
    
    public TreeTableCellRenderer(TreeModel model)
    {
      super();
      setCellRenderer(new JTreeTable.JTreeTableCellRenderer(JTreeTable.this));
    }
    
    public void updateUI()
    {
      super.updateUI();
      
      TreeCellRenderer tcr = getCellRenderer();
      if ((tcr instanceof DefaultTreeCellRenderer))
      {
        DefaultTreeCellRenderer dtcr = (DefaultTreeCellRenderer)tcr;
        
        dtcr.setTextSelectionColor(UIManager.getColor("Table.selectionForeground"));
        
        dtcr.setBackgroundSelectionColor(UIManager.getColor("Table.selectionBackground"));
      }
    }
    
    public void setRowHeight(int rowHeight)
    {
      if (rowHeight > 0)
      {
        super.setRowHeight(rowHeight);
        if ((JTreeTable.this != null) && (getRowHeight() != rowHeight)) {
          JTreeTable.this.setRowHeight(getRowHeight());
        }
      }
    }
    
    public void setBounds(int x, int y, int w, int h)
    {
      super.setBounds(x, 0, w, getHeight());
    }
    
    public void paint(Graphics g)
    {
      g.translate(0, -visibleRow * getRowHeight());
      super.paint(g);
      if (highlightBorder != null) {
        highlightBorder.paintBorder(this, g, 0, visibleRow * getRowHeight(), getWidth(), getRowHeight());
      }
    }
    
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
    {
      Color foreground;
      Color background;
      Color foreground;
      if (isSelected)
      {
        Color background = table.getSelectionBackground();
        foreground = table.getSelectionForeground();
      }
      else
      {
        background = table.getBackground();
        foreground = table.getForeground();
      }
      highlightBorder = null;
      if ((JTreeTable.this.realEditingRow() == row) && (getEditingColumn() == column))
      {
        background = UIManager.getColor("Table.focusCellBackground");
        foreground = UIManager.getColor("Table.focusCellForeground");
      }
      else if (hasFocus)
      {
        highlightBorder = UIManager.getBorder("Table.focusCellHighlightBorder");
        if (isCellEditable(row, column))
        {
          background = UIManager.getColor("Table.focusCellBackground");
          
          foreground = UIManager.getColor("Table.focusCellForeground");
        }
      }
      visibleRow = row;
      setBackground(background);
      
      TreeCellRenderer tcr = getCellRenderer();
      if ((tcr instanceof DefaultTreeCellRenderer))
      {
        DefaultTreeCellRenderer dtcr = (DefaultTreeCellRenderer)tcr;
        if (isSelected)
        {
          dtcr.setTextSelectionColor(foreground);
          dtcr.setBackgroundSelectionColor(background);
        }
        else
        {
          dtcr.setTextNonSelectionColor(foreground);
          dtcr.setBackgroundNonSelectionColor(background);
        }
      }
      return this;
    }
  }
  
  public class TreeTableCellEditor
    extends DefaultCellEditor
  {
    public TreeTableCellEditor()
    {
      super();
    }
    
    public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int r, int c)
    {
      Component component = super.getTableCellEditorComponent(table, value, isSelected, r, c);
      
      JTree t = getTree();
      boolean rv = t.isRootVisible();
      int offsetRow = rv ? r : r - 1;
      Rectangle bounds = t.getRowBounds(offsetRow);
      int offset = x;
      TreeCellRenderer tcr = t.getCellRenderer();
      if ((tcr instanceof DefaultTreeCellRenderer))
      {
        Object node = t.getPathForRow(offsetRow).getLastPathComponent();
        Icon icon;
        Icon icon;
        if (t.getModel().isLeaf(node))
        {
          icon = ((DefaultTreeCellRenderer)tcr).getLeafIcon();
        }
        else
        {
          Icon icon;
          if (tree.isExpanded(offsetRow)) {
            icon = ((DefaultTreeCellRenderer)tcr).getOpenIcon();
          } else {
            icon = ((DefaultTreeCellRenderer)tcr).getClosedIcon();
          }
        }
        if (icon != null) {
          offset += ((DefaultTreeCellRenderer)tcr).getIconTextGap() + icon.getIconWidth();
        }
      }
      getComponentoffset = offset;
      return component;
    }
    
    public boolean isCellEditable(EventObject e)
    {
      if ((e instanceof MouseEvent))
      {
        MouseEvent me = (MouseEvent)e;
        if ((me.getModifiers() == 0) || (me.getModifiers() == 16)) {
          for (int counter = getColumnCount() - 1; counter >= 0; counter--) {
            if (getColumnClass(counter) == TreeTableModel.class)
            {
              MouseEvent newME = new MouseEvent(tree, me.getID(), me.getWhen(), me.getModifiers(), me.getX() - getCellRect(0, counter, true).x, me.getY(), me.getClickCount(), me.isPopupTrigger());
              
              tree.dispatchEvent(newME);
              break;
            }
          }
        }
        if (me.getClickCount() >= 3) {
          return treeEditable;
        }
        return false;
      }
      if (e == null) {
        return treeEditable;
      }
      return false;
    }
  }
  
  static class TreeTableTextField
    extends JTextField
  {
    public int offset;
    
    public void setBounds(int x, int y, int w, int h)
    {
      int newX = Math.max(x, offset);
      super.setBounds(newX, y, w - (newX - x), h);
    }
  }
  
  class ListToTreeSelectionModelWrapper
    extends DefaultTreeSelectionModel
  {
    protected boolean updatingListSelectionModel;
    
    public ListToTreeSelectionModelWrapper()
    {
      getListSelectionModel().addListSelectionListener(createListSelectionListener());
    }
    
    ListSelectionModel getListSelectionModel()
    {
      return listSelectionModel;
    }
    
    public void resetRowSelection()
    {
      if (!updatingListSelectionModel)
      {
        updatingListSelectionModel = true;
        try
        {
          super.resetRowSelection();
        }
        finally
        {
          updatingListSelectionModel = false;
        }
      }
    }
    
    protected ListSelectionListener createListSelectionListener()
    {
      return new ListSelectionHandler();
    }
    
    protected void updateSelectedPathsFromSelectedRows()
    {
      if (!updatingListSelectionModel)
      {
        updatingListSelectionModel = true;
        try
        {
          int min = listSelectionModel.getMinSelectionIndex();
          int max = listSelectionModel.getMaxSelectionIndex();
          
          clearSelection();
          if ((min != -1) && (max != -1)) {
            for (int counter = min; counter <= max; counter++) {
              if (listSelectionModel.isSelectedIndex(counter))
              {
                TreePath selPath = tree.getPathForRow(counter);
                if (selPath != null) {
                  addSelectionPath(selPath);
                }
              }
            }
          }
        }
        finally
        {
          updatingListSelectionModel = false;
        }
      }
    }
    
    class ListSelectionHandler
      implements ListSelectionListener
    {
      ListSelectionHandler() {}
      
      public void valueChanged(ListSelectionEvent e)
      {
        updateSelectedPathsFromSelectedRows();
      }
    }
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.ui.treetable.JTreeTable
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.ui.treetable;

import sun.jvm.hotspot.ui.tree.SimpleTreeModel;
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;

public class SimpleTreeTableModel
  extends SimpleTreeModel
  implements TreeTableModel
{
  private boolean valuesEditable = true;
  
  public int getColumnCount()
  {
    return 2;
  }
  
  public String getColumnName(int column)
  {
    switch (column)
    {
    case 0: 
      return "Name";
    case 1: 
      return "Value";
    }
    throw new RuntimeException("Index " + column + " out of bounds");
  }
  
  public Class getColumnClass(int column)
  {
    switch (column)
    {
    case 0: 
      return TreeTableModel.class;
    case 1: 
      return String.class;
    }
    throw new RuntimeException("Index " + column + " out of bounds");
  }
  
  public Object getValueAt(Object node, int column)
  {
    SimpleTreeNode realNode = (SimpleTreeNode)node;
    switch (column)
    {
    case 0: 
      return realNode.getName();
    case 1: 
      return realNode.getValue();
    }
    throw new RuntimeException("Index " + column + " out of bounds");
  }
  
  public boolean isCellEditable(Object node, int column)
  {
    switch (column)
    {
    case 0: 
      return true;
    case 1: 
      return valuesEditable;
    }
    throw new RuntimeException("Index " + column + " out of bounds");
  }
  
  public void setValueAt(Object aValue, Object node, int column)
  {
    throw new RuntimeException("FIXME: figure out how to handle editing of SimpleTreeNodes");
  }
  
  public boolean getValuesEditable()
  {
    return valuesEditable;
  }
  
  public void setValuesEditable(boolean val)
  {
    valuesEditable = val;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.ui.treetable.SimpleTreeTableModel
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.ui.treetable;

import javax.swing.tree.TreeModel;

public abstract interface TreeTableModel
  extends TreeModel
{
  public abstract int getColumnCount();
  
  public abstract String getColumnName(int paramInt);
  
  public abstract Class getColumnClass(int paramInt);
  
  public abstract Object getValueAt(Object paramObject, int paramInt);
  
  public abstract boolean isCellEditable(Object paramObject, int paramInt);
  
  public abstract void setValueAt(Object paramObject1, Object paramObject2, int paramInt);
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.ui.treetable.TreeTableModel
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.ui.treetable;

import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeExpansionListener;

final class TreeTableModelAdapter$1
  implements TreeExpansionListener
{
  private final TreeTableModelAdapter this$0;
  
  TreeTableModelAdapter$1(TreeTableModelAdapter paramTreeTableModelAdapter) {}
  
  public void treeExpanded(TreeExpansionEvent event)
  {
    this$0.fireTableDataChanged();
  }
  
  public void treeCollapsed(TreeExpansionEvent event)
  {
    this$0.fireTableDataChanged();
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.ui.treetable.TreeTableModelAdapter.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.ui.treetable;

import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;

final class TreeTableModelAdapter$2
  implements TreeModelListener
{
  private final TreeTableModelAdapter this$0;
  
  TreeTableModelAdapter$2(TreeTableModelAdapter paramTreeTableModelAdapter) {}
  
  public void treeNodesChanged(TreeModelEvent e)
  {
    this$0.delayedFireTableDataChanged();
  }
  
  public void treeNodesInserted(TreeModelEvent e)
  {
    this$0.delayedFireTableDataChanged();
  }
  
  public void treeNodesRemoved(TreeModelEvent e)
  {
    this$0.delayedFireTableDataChanged();
  }
  
  public void treeStructureChanged(TreeModelEvent e)
  {
    this$0.delayedFireTableDataChanged();
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.ui.treetable.TreeTableModelAdapter.2
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.ui.treetable;

final class TreeTableModelAdapter$3
  implements Runnable
{
  private final TreeTableModelAdapter this$0;
  
  TreeTableModelAdapter$3(TreeTableModelAdapter paramTreeTableModelAdapter) {}
  
  public void run()
  {
    this$0.fireTableDataChanged();
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.ui.treetable.TreeTableModelAdapter.3
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.ui.treetable;

import javax.swing.JTree;
import javax.swing.SwingUtilities;
import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeExpansionListener;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.table.AbstractTableModel;
import javax.swing.tree.TreePath;

public class TreeTableModelAdapter
  extends AbstractTableModel
{
  JTree tree;
  TreeTableModel treeTableModel;
  
  public TreeTableModelAdapter(TreeTableModel treeTableModel, JTree tree)
  {
    this.tree = tree;
    this.treeTableModel = treeTableModel;
    
    tree.addTreeExpansionListener(new TreeExpansionListener()
    {
      public void treeExpanded(TreeExpansionEvent event)
      {
        fireTableDataChanged();
      }
      
      public void treeCollapsed(TreeExpansionEvent event)
      {
        fireTableDataChanged();
      }
    });
    treeTableModel.addTreeModelListener(new TreeModelListener()
    {
      public void treeNodesChanged(TreeModelEvent e)
      {
        delayedFireTableDataChanged();
      }
      
      public void treeNodesInserted(TreeModelEvent e)
      {
        delayedFireTableDataChanged();
      }
      
      public void treeNodesRemoved(TreeModelEvent e)
      {
        delayedFireTableDataChanged();
      }
      
      public void treeStructureChanged(TreeModelEvent e)
      {
        delayedFireTableDataChanged();
      }
    });
  }
  
  public int getColumnCount()
  {
    return treeTableModel.getColumnCount();
  }
  
  public String getColumnName(int column)
  {
    return treeTableModel.getColumnName(column);
  }
  
  public Class getColumnClass(int column)
  {
    return treeTableModel.getColumnClass(column);
  }
  
  public int getRowCount()
  {
    return tree.getRowCount();
  }
  
  protected Object nodeForRow(int row)
  {
    TreePath treePath = tree.getPathForRow(row);
    return treePath.getLastPathComponent();
  }
  
  public Object getValueAt(int row, int column)
  {
    return treeTableModel.getValueAt(nodeForRow(row), column);
  }
  
  public boolean isCellEditable(int row, int column)
  {
    return treeTableModel.isCellEditable(nodeForRow(row), column);
  }
  
  public void setValueAt(Object value, int row, int column)
  {
    treeTableModel.setValueAt(value, nodeForRow(row), column);
  }
  
  protected void delayedFireTableDataChanged()
  {
    SwingUtilities.invokeLater(new Runnable()
    {
      public void run()
      {
        fireTableDataChanged();
      }
    });
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.ui.treetable.TreeTableModelAdapter
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.ui;

import java.awt.BorderLayout;
import javax.swing.JEditorPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VM.Flag;

public class VMFlagsPanel
  extends JPanel
{
  private JEditorPane flagsPane;
  
  public VMFlagsPanel()
  {
    initUI();
  }
  
  private void initUI()
  {
    setLayout(new BorderLayout());
    flagsPane = new JEditorPane();
    flagsPane.setContentType("text/html");
    flagsPane.setEditable(false);
    flagsPane.setText(getFlags());
    
    add(new JScrollPane(flagsPane), "Center");
  }
  
  private String getFlags()
  {
    VM.Flag[] flags = VM.getVM().getCommandLineFlags();
    StringBuffer buf = new StringBuffer();
    buf.append("<html><head><title>VM Command Line Flags</title></head><body>");
    if (flags == null)
    {
      buf.append("<b>Command Flag info not available (use 1.4.1_03 or later)!</b>");
    }
    else
    {
      buf.append("<table border='1'>");
      for (int f = 0; f < flags.length; f++)
      {
        buf.append("<tr><td>");
        buf.append(flags[f].getName());
        buf.append("</td><td>");
        buf.append(flags[f].getValue());
        buf.append("</td>");
      }
      buf.append("</table>");
    }
    buf.append("</body></html>");
    return buf.toString();
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.ui.VMFlagsPanel
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.ui;

import java.awt.BorderLayout;
import javax.swing.JEditorPane;
import javax.swing.JPanel;
import sun.jvm.hotspot.runtime.VM;

public class VMVersionInfoPanel
  extends JPanel
{
  private JEditorPane versionPane;
  
  public VMVersionInfoPanel()
  {
    initUI();
  }
  
  private void initUI()
  {
    setLayout(new BorderLayout());
    versionPane = new JEditorPane();
    versionPane.setContentType("text/html");
    versionPane.setEditable(false);
    versionPane.setText(getVersionInfo());
    
    add(versionPane, "Center");
  }
  
  private String getVersionInfo()
  {
    VM vm = VM.getVM();
    StringBuffer buf = new StringBuffer();
    buf.append("<html><head><title>VM Version Info</title></head>");
    buf.append("<body><table border='1'>");
    
    buf.append("<tr><td><b>VM Type</b></td>");
    buf.append("<td>");
    if (vm.isCore()) {
      buf.append("<b>core</b>");
    } else if (vm.isClientCompiler()) {
      buf.append("<b>client</b>");
    } else if (vm.isServerCompiler()) {
      buf.append("<b>server</b>");
    } else {
      buf.append("<b>unknown</b>");
    }
    buf.append("</td></tr>");
    
    String release = vm.getVMRelease();
    if (release != null)
    {
      buf.append("<tr><td><b>VM Release</td><td><b>");
      buf.append(release);
      buf.append("</b></td></tr>");
    }
    String internalInfo = vm.getVMInternalInfo();
    if (internalInfo != null)
    {
      buf.append("<tr><td><b>VM Internal Info</td><td><b>");
      buf.append(internalInfo);
      buf.append("</b></td></tr>");
    }
    buf.append("</table></body></html>");
    return buf.toString();
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.ui.VMVersionInfoPanel
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.utilities;

import java.io.IOException;
import sun.jvm.hotspot.oops.DefaultHeapVisitor;
import sun.jvm.hotspot.oops.Instance;
import sun.jvm.hotspot.oops.InstanceKlass;
import sun.jvm.hotspot.oops.Klass;
import sun.jvm.hotspot.oops.ObjArray;
import sun.jvm.hotspot.oops.ObjArrayKlass;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.Symbol;
import sun.jvm.hotspot.oops.TypeArray;
import sun.jvm.hotspot.oops.TypeArrayKlass;

final class AbstractHeapGraphWriter$1
  extends DefaultHeapVisitor
{
  private final AbstractHeapGraphWriter this$0;
  
  AbstractHeapGraphWriter$1(AbstractHeapGraphWriter paramAbstractHeapGraphWriter) {}
  
  public void prologue(long usedSize)
  {
    try
    {
      this$0.writeHeapHeader();
    }
    catch (IOException exp)
    {
      throw new RuntimeException(exp);
    }
  }
  
  public boolean doObj(Oop oop)
  {
    try
    {
      if ((oop instanceof TypeArray))
      {
        this$0.writePrimitiveArray((TypeArray)oop);
      }
      else if ((oop instanceof ObjArray))
      {
        Klass klass = oop.getKlass();
        ObjArrayKlass oak = (ObjArrayKlass)klass;
        Klass bottomType = oak.getBottomKlass();
        if (((bottomType instanceof InstanceKlass)) || ((bottomType instanceof TypeArrayKlass))) {
          this$0.writeObjectArray((ObjArray)oop);
        } else {
          this$0.writeInternalObject(oop);
        }
      }
      else if ((oop instanceof Instance))
      {
        Instance instance = (Instance)oop;
        Klass klass = instance.getKlass();
        Symbol name = klass.getName();
        if (name.equals(this$0.javaLangString))
        {
          this$0.writeString(instance);
        }
        else if (name.equals(this$0.javaLangClass))
        {
          this$0.writeClass(instance);
        }
        else if (name.equals(this$0.javaLangThread))
        {
          this$0.writeThread(instance);
        }
        else
        {
          klass = klass.getSuper();
          while (klass != null)
          {
            name = klass.getName();
            if (name.equals(this$0.javaLangThread))
            {
              this$0.writeThread(instance);
              return false;
            }
            klass = klass.getSuper();
          }
          this$0.writeInstance(instance);
        }
      }
      else
      {
        this$0.writeInternalObject(oop);
      }
    }
    catch (IOException exp)
    {
      throw new RuntimeException(exp);
    }
    return false;
  }
  
  public void epilogue()
  {
    try
    {
      this$0.writeHeapFooter();
    }
    catch (IOException exp)
    {
      throw new RuntimeException(exp);
    }
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.utilities;

import java.io.IOException;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.AddressVisitor;

final class AbstractHeapGraphWriter$2
  implements AddressVisitor
{
  private final AbstractHeapGraphWriter this$0;
  
  AbstractHeapGraphWriter$2(AbstractHeapGraphWriter paramAbstractHeapGraphWriter) {}
  
  public void visitAddress(Address handleAddr)
  {
    try
    {
      if (handleAddr != null) {
        this$0.writeGlobalJNIHandle(handleAddr);
      }
    }
    catch (IOException exp)
    {
      throw new RuntimeException(exp);
    }
  }
  
  public void visitCompOopAddress(Address handleAddr)
  {
    throw new RuntimeException("Should not reach here. JNIHandles are not compressed");
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.2
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.utilities;

import java.io.IOException;
import sun.jvm.hotspot.oops.BooleanField;
import sun.jvm.hotspot.oops.ByteField;
import sun.jvm.hotspot.oops.CharField;
import sun.jvm.hotspot.oops.DefaultOopVisitor;
import sun.jvm.hotspot.oops.DoubleField;
import sun.jvm.hotspot.oops.FloatField;
import sun.jvm.hotspot.oops.Instance;
import sun.jvm.hotspot.oops.IntField;
import sun.jvm.hotspot.oops.LongField;
import sun.jvm.hotspot.oops.ObjArray;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.OopField;
import sun.jvm.hotspot.oops.ShortField;
import sun.jvm.hotspot.oops.TypeArray;

final class AbstractHeapGraphWriter$3
  extends DefaultOopVisitor
{
  private final AbstractHeapGraphWriter this$0;
  
  AbstractHeapGraphWriter$3(AbstractHeapGraphWriter paramAbstractHeapGraphWriter, Oop paramOop) {}
  
  public void doOop(OopField field, boolean isVMField)
  {
    try
    {
      Oop ref = field.getValue(val$oop);
      if (((ref instanceof TypeArray)) || ((ref instanceof ObjArray)) || ((ref instanceof Instance))) {
        this$0.writeReferenceField(val$oop, field);
      } else {
        this$0.writeInternalReferenceField(val$oop, field);
      }
    }
    catch (IOException exp)
    {
      throw new RuntimeException(exp);
    }
  }
  
  public void doByte(ByteField field, boolean isVMField)
  {
    try
    {
      this$0.writeByteField(val$oop, field);
    }
    catch (IOException exp)
    {
      throw new RuntimeException(exp);
    }
  }
  
  public void doChar(CharField field, boolean isVMField)
  {
    try
    {
      this$0.writeCharField(val$oop, field);
    }
    catch (IOException exp)
    {
      throw new RuntimeException(exp);
    }
  }
  
  public void doBoolean(BooleanField field, boolean vField)
  {
    try
    {
      this$0.writeBooleanField(val$oop, field);
    }
    catch (IOException exp)
    {
      throw new RuntimeException(exp);
    }
  }
  
  public void doShort(ShortField field, boolean isVMField)
  {
    try
    {
      this$0.writeShortField(val$oop, field);
    }
    catch (IOException exp)
    {
      throw new RuntimeException(exp);
    }
  }
  
  public void doInt(IntField field, boolean isVMField)
  {
    try
    {
      this$0.writeIntField(val$oop, field);
    }
    catch (IOException exp)
    {
      throw new RuntimeException(exp);
    }
  }
  
  public void doLong(LongField field, boolean isVMField)
  {
    try
    {
      this$0.writeLongField(val$oop, field);
    }
    catch (IOException exp)
    {
      throw new RuntimeException(exp);
    }
  }
  
  public void doFloat(FloatField field, boolean isVMField)
  {
    try
    {
      this$0.writeFloatField(val$oop, field);
    }
    catch (IOException exp)
    {
      throw new RuntimeException(exp);
    }
  }
  
  public void doDouble(DoubleField field, boolean vField)
  {
    try
    {
      this$0.writeDoubleField(val$oop, field);
    }
    catch (IOException exp)
    {
      throw new RuntimeException(exp);
    }
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.3
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.utilities;

import java.io.IOException;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.memory.SymbolTable;
import sun.jvm.hotspot.oops.BooleanField;
import sun.jvm.hotspot.oops.ByteField;
import sun.jvm.hotspot.oops.CharField;
import sun.jvm.hotspot.oops.DefaultHeapVisitor;
import sun.jvm.hotspot.oops.DefaultOopVisitor;
import sun.jvm.hotspot.oops.DoubleField;
import sun.jvm.hotspot.oops.FloatField;
import sun.jvm.hotspot.oops.Instance;
import sun.jvm.hotspot.oops.InstanceKlass;
import sun.jvm.hotspot.oops.IntField;
import sun.jvm.hotspot.oops.Klass;
import sun.jvm.hotspot.oops.LongField;
import sun.jvm.hotspot.oops.ObjArray;
import sun.jvm.hotspot.oops.ObjArrayKlass;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.OopField;
import sun.jvm.hotspot.oops.ShortField;
import sun.jvm.hotspot.oops.Symbol;
import sun.jvm.hotspot.oops.TypeArray;
import sun.jvm.hotspot.oops.TypeArrayKlass;
import sun.jvm.hotspot.runtime.AddressVisitor;
import sun.jvm.hotspot.runtime.JNIHandleBlock;
import sun.jvm.hotspot.runtime.JNIHandles;
import sun.jvm.hotspot.runtime.JavaThread;
import sun.jvm.hotspot.runtime.Threads;
import sun.jvm.hotspot.runtime.VM;

public abstract class AbstractHeapGraphWriter
  implements HeapGraphWriter
{
  protected Symbol javaLangClass;
  protected Symbol javaLangString;
  protected Symbol javaLangThread;
  
  protected void write()
    throws IOException
  {
    SymbolTable symTbl = VM.getVM().getSymbolTable();
    javaLangClass = symTbl.probe("java/lang/Class");
    javaLangString = symTbl.probe("java/lang/String");
    javaLangThread = symTbl.probe("java/lang/Thread");
    ObjectHeap heap = VM.getVM().getObjectHeap();
    try
    {
      heap.iterate(new DefaultHeapVisitor()
      {
        public void prologue(long usedSize)
        {
          try
          {
            writeHeapHeader();
          }
          catch (IOException exp)
          {
            throw new RuntimeException(exp);
          }
        }
        
        public boolean doObj(Oop oop)
        {
          try
          {
            if ((oop instanceof TypeArray))
            {
              writePrimitiveArray((TypeArray)oop);
            }
            else if ((oop instanceof ObjArray))
            {
              Klass klass = oop.getKlass();
              ObjArrayKlass oak = (ObjArrayKlass)klass;
              Klass bottomType = oak.getBottomKlass();
              if (((bottomType instanceof InstanceKlass)) || ((bottomType instanceof TypeArrayKlass))) {
                writeObjectArray((ObjArray)oop);
              } else {
                writeInternalObject(oop);
              }
            }
            else if ((oop instanceof Instance))
            {
              Instance instance = (Instance)oop;
              Klass klass = instance.getKlass();
              Symbol name = klass.getName();
              if (name.equals(javaLangString))
              {
                writeString(instance);
              }
              else if (name.equals(javaLangClass))
              {
                writeClass(instance);
              }
              else if (name.equals(javaLangThread))
              {
                writeThread(instance);
              }
              else
              {
                klass = klass.getSuper();
                while (klass != null)
                {
                  name = klass.getName();
                  if (name.equals(javaLangThread))
                  {
                    writeThread(instance);
                    return false;
                  }
                  klass = klass.getSuper();
                }
                writeInstance(instance);
              }
            }
            else
            {
              writeInternalObject(oop);
            }
          }
          catch (IOException exp)
          {
            throw new RuntimeException(exp);
          }
          return false;
        }
        
        public void epilogue()
        {
          try
          {
            writeHeapFooter();
          }
          catch (IOException exp)
          {
            throw new RuntimeException(exp);
          }
        }
      });
      writeJavaThreads();
      
      writeGlobalJNIHandles();
    }
    catch (RuntimeException re)
    {
      handleRuntimeException(re);
    }
  }
  
  protected void writeJavaThreads()
    throws IOException
  {
    Threads threads = VM.getVM().getThreads();
    JavaThread jt = threads.first();
    int index = 1;
    while (jt != null)
    {
  
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114

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-2019. Infinite Loop Ltd