sa-jdi

turn new CharTreeNodeAdapter(value, cf, getTreeTableMode());
        }
        if ((f instanceof JBooleanField))
        {
          boolean value = isStatic ? f.getJBoolean() : f.getJBoolean(addr);
          return new BooleanTreeNodeAdapter(value, cf, getTreeTableMode());
        }
        if ((f instanceof JFloatField))
        {
          float value = isStatic ? f.getJFloat() : f.getJFloat(addr);
          return new DoubleTreeNodeAdapter(value, cf, getTreeTableMode());
        }
        if ((f instanceof JDoubleField))
        {
          double value = isStatic ? f.getJDouble() : f.getJDouble(addr);
          return new DoubleTreeNodeAdapter(value, cf, getTreeTableMode());
        }
        throw new RuntimeException("unhandled type: " + t.getName());
      }
      if (t.isPointerType())
      {
        Address ptr;
        Address ptr;
        if (f.isStatic()) {
          ptr = f.getAddress();
        } else {
          ptr = f.getAddress(addr);
        }
        if (t.isCStringType()) {
          return new CStringTreeNodeAdapter(CStringUtilities.getString(ptr), cf);
        }
        return new CTypeTreeNodeAdapter(ptr, ((PointerType)t).getTargetType(), cf, getTreeTableMode());
      }
      if (f.isStatic()) {
        return new CTypeTreeNodeAdapter(f.getStaticFieldAddress(), f.getType(), cf, getTreeTableMode());
      }
      return new CTypeTreeNodeAdapter(addr.addOffsetTo(f.getOffset()), f.getType(), cf, getTreeTableMode());
    }
    catch (AddressException e)
    {
      return new BadAddressTreeNodeAdapter(e.getAddress(), new CTypeFieldIdentifier(type, f), getTreeTableMode());
    }
  }
  
  public boolean isLeaf()
  {
    return getFields().length == 0;
  }
  
  public int getIndexOfChild(SimpleTreeNode child)
  {
    CTypeFieldIdentifier id = (CTypeFieldIdentifier)((FieldTreeNodeAdapter)child).getID();
    CTypeFieldIdentifier[] f = getFields();
    for (int i = 0; i < f.length; i++) {
      if (id == f[i]) {
        return i;
      }
    }
    return -1;
  }
  
  public String getValue()
  {
    if (type != null) {
      return type.getName() + " @ " + addr;
    }
    return "<statics>";
  }
}

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

import sun.jvm.hotspot.oops.FieldIdentifier;

public class DoubleTreeNodeAdapter
  extends FieldTreeNodeAdapter
{
  private double val;
  
  public DoubleTreeNodeAdapter(double val, FieldIdentifier id)
  {
    this(val, id, false);
  }
  
  public DoubleTreeNodeAdapter(double val, FieldIdentifier id, boolean treeTableMode)
  {
    super(id, treeTableMode);
    this.val = val;
  }
  
  public int getChildCount()
  {
    return 0;
  }
  
  public SimpleTreeNode getChild(int index)
  {
    return null;
  }
  
  public boolean isLeaf()
  {
    return true;
  }
  
  public int getIndexOfChild(SimpleTreeNode child)
  {
    return 0;
  }
  
  public String getValue()
  {
    return Double.toString(val);
  }
}

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

import sun.jvm.hotspot.oops.FieldIdentifier;

public abstract class FieldTreeNodeAdapter
  implements SimpleTreeNode
{
  private FieldIdentifier id;
  private boolean treeTableMode;
  
  public FieldTreeNodeAdapter(FieldIdentifier id, boolean treeTableMode)
  {
    this.id = id;
    this.treeTableMode = treeTableMode;
  }
  
  public FieldIdentifier getID()
  {
    return id;
  }
  
  public boolean getTreeTableMode()
  {
    return treeTableMode;
  }
  
  public String getName()
  {
    if (getID() != null) {
      return getID().getName();
    }
    return "";
  }
  
  public String toString()
  {
    if (treeTableMode) {
      return getName();
    }
    if (getID() != null) {
      return getName() + ": " + getValue();
    }
    return getValue();
  }
}

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

import sun.jvm.hotspot.oops.FieldIdentifier;

public class FloatTreeNodeAdapter
  extends FieldTreeNodeAdapter
{
  private float val;
  
  public FloatTreeNodeAdapter(float val, FieldIdentifier id)
  {
    this(val, id, false);
  }
  
  public FloatTreeNodeAdapter(float val, FieldIdentifier id, boolean treeTableMode)
  {
    super(id, treeTableMode);
    this.val = val;
  }
  
  public int getChildCount()
  {
    return 0;
  }
  
  public SimpleTreeNode getChild(int index)
  {
    return null;
  }
  
  public boolean isLeaf()
  {
    return true;
  }
  
  public int getIndexOfChild(SimpleTreeNode child)
  {
    return 0;
  }
  
  public String getValue()
  {
    return Float.toString(val);
  }
}

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

import sun.jvm.hotspot.oops.FieldIdentifier;

public class LongTreeNodeAdapter
  extends FieldTreeNodeAdapter
{
  private long val;
  private boolean hexFormat = false;
  
  public LongTreeNodeAdapter(long val, FieldIdentifier id)
  {
    this(val, id, false);
  }
  
  public LongTreeNodeAdapter(long val, FieldIdentifier id, boolean treeTableMode)
  {
    super(id, treeTableMode);
    this.val = val;
  }
  
  public void setHexFormat(boolean hexFormat)
  {
    this.hexFormat = hexFormat;
  }
  
  public boolean getHexFormat()
  {
    return hexFormat;
  }
  
  public int getChildCount()
  {
    return 0;
  }
  
  public SimpleTreeNode getChild(int index)
  {
    return null;
  }
  
  public boolean isLeaf()
  {
    return true;
  }
  
  public int getIndexOfChild(SimpleTreeNode child)
  {
    return 0;
  }
  
  public String getValue()
  {
    if (hexFormat) {
      return "0x" + Long.toHexString(val);
    }
    return Long.toString(val);
  }
}

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

import sun.jvm.hotspot.oops.BooleanField;
import sun.jvm.hotspot.oops.ByteField;
import sun.jvm.hotspot.oops.CIntField;
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.IntField;
import sun.jvm.hotspot.oops.LongField;
import sun.jvm.hotspot.oops.OopField;
import sun.jvm.hotspot.oops.ShortField;

class OopTreeNodeAdapter$Counter
  extends DefaultOopVisitor
{
  private int numFields;
  
  public int getNumFields()
  {
    return numFields;
  }
  
  public void prologue()
  {
    numFields = 0;
  }
  
  public void doOop(OopField field, boolean isVMField)
  {
    numFields += 1;
  }
  
  public void doByte(ByteField field, boolean isVMField)
  {
    numFields += 1;
  }
  
  public void doChar(CharField field, boolean isVMField)
  {
    numFields += 1;
  }
  
  public void doBoolean(BooleanField field, boolean isVMField)
  {
    numFields += 1;
  }
  
  public void doShort(ShortField field, boolean isVMField)
  {
    numFields += 1;
  }
  
  public void doInt(IntField field, boolean isVMField)
  {
    numFields += 1;
  }
  
  public void doLong(LongField field, boolean isVMField)
  {
    numFields += 1;
  }
  
  public void doFloat(FloatField field, boolean isVMField)
  {
    numFields += 1;
  }
  
  public void doDouble(DoubleField field, boolean isVMField)
  {
    numFields += 1;
  }
  
  public void doCInt(CIntField field, boolean isVMField)
  {
    numFields += 1;
  }
}

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

import sun.jvm.hotspot.debugger.AddressException;
import sun.jvm.hotspot.oops.BooleanField;
import sun.jvm.hotspot.oops.ByteField;
import sun.jvm.hotspot.oops.CIntField;
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.IntField;
import sun.jvm.hotspot.oops.LongField;
import sun.jvm.hotspot.oops.OopField;
import sun.jvm.hotspot.oops.ShortField;
import sun.jvm.hotspot.oops.UnknownOopException;

class OopTreeNodeAdapter$Fetcher
  extends DefaultOopVisitor
{
  private int index;
  private int curField;
  private SimpleTreeNode child;
  private final OopTreeNodeAdapter this$0;
  
  public OopTreeNodeAdapter$Fetcher(OopTreeNodeAdapter paramOopTreeNodeAdapter, int index)
  {
    this.index = index;
  }
  
  public SimpleTreeNode getChild()
  {
    return child;
  }
  
  public void prologue()
  {
    curField = 0;
  }
  
  public void doOop(OopField field, boolean isVMField)
  {
    if (curField == index) {
      try
      {
        child = new OopTreeNodeAdapter(field.getValue(getObj()), field.getID(), this$0.getTreeTableMode());
      }
      catch (AddressException e)
      {
        child = new BadOopTreeNodeAdapter(field.getValueAsOopHandle(getObj()), field.getID(), this$0.getTreeTableMode());
      }
      catch (UnknownOopException e)
      {
        child = new BadOopTreeNodeAdapter(field.getValueAsOopHandle(getObj()), field.getID(), this$0.getTreeTableMode());
      }
    }
    curField += 1;
  }
  
  public void doByte(ByteField field, boolean isVMField)
  {
    if (curField == index) {
      child = new LongTreeNodeAdapter(field.getValue(getObj()) & 0xFF, field.getID(), this$0.getTreeTableMode());
    }
    curField += 1;
  }
  
  public void doChar(CharField field, boolean isVMField)
  {
    if (curField == index) {
      child = new CharTreeNodeAdapter(field.getValue(getObj()), field.getID(), this$0.getTreeTableMode());
    }
    curField += 1;
  }
  
  public void doBoolean(BooleanField field, boolean isVMField)
  {
    if (curField == index) {
      child = new BooleanTreeNodeAdapter(field.getValue(getObj()), field.getID(), this$0.getTreeTableMode());
    }
    curField += 1;
  }
  
  public void doShort(ShortField field, boolean isVMField)
  {
    if (curField == index) {
      child = new LongTreeNodeAdapter(field.getValue(getObj()) & 0xFFFF, field.getID(), this$0.getTreeTableMode());
    }
    curField += 1;
  }
  
  public void doInt(IntField field, boolean isVMField)
  {
    if (curField == index) {
      child = new LongTreeNodeAdapter(field.getValue(getObj()) & 0xFFFFFFFF, field.getID(), this$0.getTreeTableMode());
    }
    curField += 1;
  }
  
  public void doLong(LongField field, boolean isVMField)
  {
    if (curField == index) {
      child = new LongTreeNodeAdapter(field.getValue(getObj()), field.getID(), this$0.getTreeTableMode());
    }
    curField += 1;
  }
  
  public void doFloat(FloatField field, boolean isVMField)
  {
    if (curField == index) {
      child = new FloatTreeNodeAdapter(field.getValue(getObj()), field.getID(), this$0.getTreeTableMode());
    }
    curField += 1;
  }
  
  public void doDouble(DoubleField field, boolean isVMField)
  {
    if (curField == index) {
      child = new DoubleTreeNodeAdapter(field.getValue(getObj()), field.getID(), this$0.getTreeTableMode());
    }
    curField += 1;
  }
  
  public void doCInt(CIntField field, boolean isVMField)
  {
    if (curField == index) {
      child = new LongTreeNodeAdapter(field.getValue(getObj()), field.getID(), this$0.getTreeTableMode());
    }
    curField += 1;
  }
}

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

import sun.jvm.hotspot.oops.BooleanField;
import sun.jvm.hotspot.oops.ByteField;
import sun.jvm.hotspot.oops.CIntField;
import sun.jvm.hotspot.oops.CharField;
import sun.jvm.hotspot.oops.DefaultOopVisitor;
import sun.jvm.hotspot.oops.DoubleField;
import sun.jvm.hotspot.oops.FieldIdentifier;
import sun.jvm.hotspot.oops.FloatField;
import sun.jvm.hotspot.oops.IntField;
import sun.jvm.hotspot.oops.LongField;
import sun.jvm.hotspot.oops.OopField;
import sun.jvm.hotspot.oops.ShortField;

class OopTreeNodeAdapter$Finder
  extends DefaultOopVisitor
{
  private FieldIdentifier id;
  private int curField;
  private int index;
  
  public OopTreeNodeAdapter$Finder(FieldIdentifier id)
  {
    this.id = id;
  }
  
  public int getIndex()
  {
    return index;
  }
  
  public void prologue()
  {
    curField = 0;
    index = -1;
  }
  
  public void doOop(OopField field, boolean isVMField)
  {
    if (field.getID().equals(id)) {
      index = curField;
    }
    curField += 1;
  }
  
  public void doByte(ByteField field, boolean isVMField)
  {
    if (field.getID().equals(id)) {
      index = curField;
    }
    curField += 1;
  }
  
  public void doChar(CharField field, boolean isVMField)
  {
    if (field.getID().equals(id)) {
      index = curField;
    }
    curField += 1;
  }
  
  public void doBoolean(BooleanField field, boolean isVMField)
  {
    if (field.getID().equals(id)) {
      index = curField;
    }
    curField += 1;
  }
  
  public void doShort(ShortField field, boolean isVMField)
  {
    if (field.getID().equals(id)) {
      index = curField;
    }
    curField += 1;
  }
  
  public void doInt(IntField field, boolean isVMField)
  {
    if (field.getID().equals(id)) {
      index = curField;
    }
    curField += 1;
  }
  
  public void doLong(LongField field, boolean isVMField)
  {
    if (field.getID().equals(id)) {
      index = curField;
    }
    curField += 1;
  }
  
  public void doFloat(FloatField field, boolean isVMField)
  {
    if (field.getID().equals(id)) {
      index = curField;
    }
    curField += 1;
  }
  
  public void doDouble(DoubleField field, boolean isVMField)
  {
    if (field.getID().equals(id)) {
      index = curField;
    }
    curField += 1;
  }
  
  public void doCInt(CIntField field, boolean isVMField)
  {
    if (field.getID().equals(id)) {
      index = curField;
    }
    curField += 1;
  }
}

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

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import sun.jvm.hotspot.debugger.AddressException;
import sun.jvm.hotspot.oops.BooleanField;
import sun.jvm.hotspot.oops.ByteField;
import sun.jvm.hotspot.oops.CIntField;
import sun.jvm.hotspot.oops.CharField;
import sun.jvm.hotspot.oops.DefaultOopVisitor;
import sun.jvm.hotspot.oops.DoubleField;
import sun.jvm.hotspot.oops.FieldIdentifier;
import sun.jvm.hotspot.oops.FloatField;
import sun.jvm.hotspot.oops.IntField;
import sun.jvm.hotspot.oops.LongField;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.OopField;
import sun.jvm.hotspot.oops.ShortField;
import sun.jvm.hotspot.oops.UnknownOopException;
import sun.jvm.hotspot.runtime.VM;

public class OopTreeNodeAdapter
  extends FieldTreeNodeAdapter
{
  private Oop oop;
  
  public OopTreeNodeAdapter(Oop oop, FieldIdentifier id)
  {
    this(oop, id, false);
  }
  
  public OopTreeNodeAdapter(Oop oop, FieldIdentifier id, boolean treeTableMode)
  {
    super(id, treeTableMode);
    this.oop = oop;
  }
  
  public Oop getOop()
  {
    return oop;
  }
  
  public int getChildCount()
  {
    if (oop == null) {
      return 0;
    }
    Counter c = new Counter();
    oop.iterate(c, true);
    return c.getNumFields() + (VM.getVM().getRevPtrs() == null ? 0 : 1);
  }
  
  public SimpleTreeNode getChild(int index)
  {
    if (oop == null) {
      return null;
    }
    if (VM.getVM().getRevPtrs() != null)
    {
      if (index == 0) {
        return new RevPtrsTreeNodeAdapter(oop, getTreeTableMode());
      }
      index--;
    }
    Fetcher f = new Fetcher(index);
    oop.iterate(f, true);
    return f.getChild();
  }
  
  public boolean isLeaf()
  {
    return oop == null;
  }
  
  public int getIndexOfChild(SimpleTreeNode child)
  {
    if ((child instanceof RevPtrsTreeNodeAdapter)) {
      return 0;
    }
    FieldIdentifier id = ((FieldTreeNodeAdapter)child).getID();
    Finder f = new Finder(id);
    oop.iterate(f, true);
    return f.getIndex() + (VM.getVM().getRevPtrs() == null ? 0 : 1);
  }
  
  public String getValue()
  {
    if (oop != null)
    {
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      Oop.printOopValueOn(oop, new PrintStream(bos));
      return bos.toString();
    }
    return "null";
  }
  
  static class Counter
    extends DefaultOopVisitor
  {
    private int numFields;
    
    public int getNumFields()
    {
      return numFields;
    }
    
    public void prologue()
    {
      numFields = 0;
    }
    
    public void doOop(OopField field, boolean isVMField)
    {
      numFields += 1;
    }
    
    public void doByte(ByteField field, boolean isVMField)
    {
      numFields += 1;
    }
    
    public void doChar(CharField field, boolean isVMField)
    {
      numFields += 1;
    }
    
    public void doBoolean(BooleanField field, boolean isVMField)
    {
      numFields += 1;
    }
    
    public void doShort(ShortField field, boolean isVMField)
    {
      numFields += 1;
    }
    
    public void doInt(IntField field, boolean isVMField)
    {
      numFields += 1;
    }
    
    public void doLong(LongField field, boolean isVMField)
    {
      numFields += 1;
    }
    
    public void doFloat(FloatField field, boolean isVMField)
    {
      numFields += 1;
    }
    
    public void doDouble(DoubleField field, boolean isVMField)
    {
      numFields += 1;
    }
    
    public void doCInt(CIntField field, boolean isVMField)
    {
      numFields += 1;
    }
  }
  
  class Fetcher
    extends DefaultOopVisitor
  {
    private int index;
    private int curField;
    private SimpleTreeNode child;
    
    public Fetcher(int index)
    {
      this.index = index;
    }
    
    public SimpleTreeNode getChild()
    {
      return child;
    }
    
    public void prologue()
    {
      curField = 0;
    }
    
    public void doOop(OopField field, boolean isVMField)
    {
      if (curField == index) {
        try
        {
          child = new OopTreeNodeAdapter(field.getValue(getObj()), field.getID(), getTreeTableMode());
        }
        catch (AddressException e)
        {
          child = new BadOopTreeNodeAdapter(field.getValueAsOopHandle(getObj()), field.getID(), getTreeTableMode());
        }
        catch (UnknownOopException e)
        {
          child = new BadOopTreeNodeAdapter(field.getValueAsOopHandle(getObj()), field.getID(), getTreeTableMode());
        }
      }
      curField += 1;
    }
    
    public void doByte(ByteField field, boolean isVMField)
    {
      if (curField == index) {
        child = new LongTreeNodeAdapter(field.getValue(getObj()) & 0xFF, field.getID(), getTreeTableMode());
      }
      curField += 1;
    }
    
    public void doChar(CharField field, boolean isVMField)
    {
      if (curField == index) {
        child = new CharTreeNodeAdapter(field.getValue(getObj()), field.getID(), getTreeTableMode());
      }
      curField += 1;
    }
    
    public void doBoolean(BooleanField field, boolean isVMField)
    {
      if (curField == index) {
        child = new BooleanTreeNodeAdapter(field.getValue(getObj()), field.getID(), getTreeTableMode());
      }
      curField += 1;
    }
    
    public void doShort(ShortField field, boolean isVMField)
    {
      if (curField == index) {
        child = new LongTreeNodeAdapter(field.getValue(getObj()) & 0xFFFF, field.getID(), getTreeTableMode());
      }
      curField += 1;
    }
    
    public void doInt(IntField field, boolean isVMField)
    {
      if (curField == index) {
        child = new LongTreeNodeAdapter(field.getValue(getObj()) & 0xFFFFFFFF, field.getID(), getTreeTableMode());
      }
      curField += 1;
    }
    
    public void doLong(LongField field, boolean isVMField)
    {
      if (curField == index) {
        child = new LongTreeNodeAdapter(field.getValue(getObj()), field.getID(), getTreeTableMode());
      }
      curField += 1;
    }
    
    public void doFloat(FloatField field, boolean isVMField)
    {
      if (curField == index) {
        child = new FloatTreeNodeAdapter(field.getValue(getObj()), field.getID(), getTreeTableMode());
      }
      curField += 1;
    }
    
    public void doDouble(DoubleField field, boolean isVMField)
    {
      if (curField == index) {
        child = new DoubleTreeNodeAdapter(field.getValue(getObj()), field.getID(), getTreeTableMode());
      }
      curField += 1;
    }
    
    public void doCInt(CIntField field, boolean isVMField)
    {
      if (curField == index) {
        child = new LongTreeNodeAdapter(field.getValue(getObj()), field.getID(), getTreeTableMode());
      }
      curField += 1;
    }
  }
  
  static class Finder
    extends DefaultOopVisitor
  {
    private FieldIdentifier id;
    private int curField;
    private int index;
    
    public Finder(FieldIdentifier id)
    {
      this.id = id;
    }
    
    public int getIndex()
    {
      return index;
    }
    
    public void prologue()
    {
      curField = 0;
      index = -1;
    }
    
    public void doOop(OopField field, boolean isVMField)
    {
      if (field.getID().equals(id)) {
        index = curField;
      }
      curField += 1;
    }
    
    public void doByte(ByteField field, boolean isVMField)
    {
      if (field.getID().equals(id)) {
        index = curField;
      }
      curField += 1;
    }
    
    public void doChar(CharField field, boolean isVMField)
    {
      if (field.getID().equals(id)) {
        index = curField;
      }
      curField += 1;
    }
    
    public void doBoolean(BooleanField field, boolean isVMField)
    {
      if (field.getID().equals(id)) {
        index = curField;
      }
      curField += 1;
    }
    
    public void doShort(ShortField field, boolean isVMField)
    {
      if (field.getID().equals(id)) {
        index = curField;
      }
      curField += 1;
    }
    
    public void doInt(IntField field, boolean isVMField)
    {
      if (field.getID().equals(id)) {
        index = curField;
      }
      curField += 1;
    }
    
    public void doLong(LongField field, boolean isVMField)
    {
      if (field.getID().equals(id)) {
        index = curField;
      }
      curField += 1;
    }
    
    public void doFloat(FloatField field, boolean isVMField)
    {
      if (field.getID().equals(id)) {
        index = curField;
      }
      curField += 1;
    }
    
    public void doDouble(DoubleField field, boolean isVMField)
    {
      if (field.getID().equals(id)) {
        index = curField;
      }
      curField += 1;
    }
    
    public void doCInt(CIntField field, boolean isVMField)
    {
      if (field.getID().equals(id)) {
        index = curField;
      }
      curField += 1;
    }
  }
}

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

import java.util.List;
import sun.jvm.hotspot.oops.FieldIdentifier;
import sun.jvm.hotspot.oops.IndexableFieldIdentifier;
import sun.jvm.hotspot.oops.NamedFieldIdentifier;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.utilities.LivenessPathElement;
import sun.jvm.hotspot.utilities.ReversePtrs;

public class RevPtrsTreeNodeAdapter
  extends FieldTreeNodeAdapter
{
  private static FieldIdentifier fid = new NamedFieldIdentifier("_revPtrs");
  private List children;
  
  public RevPtrsTreeNodeAdapter(Oop oop)
  {
    this(oop, false);
  }
  
  public RevPtrsTreeNodeAdapter(Oop oop, boolean treeTableMode)
  {
    super(fid, treeTableMode);
    children = VM.getVM().getRevPtrs().get(oop);
  }
  
  public int getChildCount()
  {
    return children != null ? children.size() : 0;
  }
  
  public SimpleTreeNode getChild(int index)
  {
    LivenessPathElement lpe = (LivenessPathElement)children.get(index);
    IndexableFieldIdentifier ifid = new IndexableFieldIdentifier(index);
    Oop oop = lpe.getObj();
    if (oop != null) {
      return new OopTreeNodeAdapter(oop, ifid, getTreeTableMode());
    }
    NamedFieldIdentifier nfi = (NamedFieldIdentifier)lpe.getField();
    return new RootTreeNodeAdapter(nfi.getName(), ifid, getTreeTableMode());
  }
  
  public boolean isLeaf()
  {
    return false;
  }
  
  public int getIndexOfChild(SimpleTreeNode child)
  {
    FieldIdentifier id = ((FieldTreeNodeAdapter)child).getID();
    IndexableFieldIdentifier ifid = (IndexableFieldIdentifier)id;
    return ifid.getIndex();
  }
  
  public String getName()
  {
    return "<<Reverse pointers>>";
  }
  
  public String getValue()
  {
    return "";
  }
}

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

import sun.jvm.hotspot.oops.FieldIdentifier;

public class RootTreeNodeAdapter
  extends FieldTreeNodeAdapter
{
  private String val;
  
  public RootTreeNodeAdapter(String val, FieldIdentifier id)
  {
    this(val, id, false);
  }
  
  public RootTreeNodeAdapter(String val, FieldIdentifier id, boolean treeTableMode)
  {
    super(id, treeTableMode);
    this.val = val;
  }
  
  public int getChildCount()
  {
    return 0;
  }
  
  public SimpleTreeNode getChild(int index)
  {
    return null;
  }
  
  public boolean isLeaf()
  {
    return true;
  }
  
  public int getIndexOfChild(SimpleTreeNode child)
  {
    return 0;
  }
  
  public String getValue()
  {
    return val;
  }
}

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

import java.util.ArrayList;
import java.util.List;

public class SimpleTreeGroupNode
  implements SimpleTreeNode
{
  private List children;
  
  public SimpleTreeGroupNode()
  {
    children = new ArrayList();
  }
  
  public int getChildCount()
  {
    return children.size();
  }
  
  public SimpleTreeNode getChild(int index)
  {
    return (SimpleTreeNode)children.get(index);
  }
  
  public void addChild(SimpleTreeNode child)
  {
    children.add(child);
  }
  
  public SimpleTreeNode removeChild(int index)
  {
    return (SimpleTreeNode)children.remove(index);
  }
  
  public void removeAllChildren()
  {
    children.clear();
  }
  
  public boolean isLeaf()
  {
    return false;
  }
  
  public int getIndexOfChild(SimpleTreeNode child)
  {
    return children.indexOf(child);
  }
  
  public String getName()
  {
    return null;
  }
  
  public String getValue()
  {
    return null;
  }
}

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

final class SimpleTreeModel$1
  implements SimpleTreeNode
{
  public int getChildCount()
  {
    return 0;
  }
  
  public SimpleTreeNode getChild(int index)
  {
    return null;
  }
  
  public boolean isLeaf()
  {
    return true;
  }
  
  public int getIndexOfChild(SimpleTreeNode child)
  {
    return 0;
  }
  
  public String toString()
  {
    return "";
  }
  
  public String getName()
  {
    return toString();
  }
  
  public String getValue()
  {
    return toString();
  }
}

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

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;

public class SimpleTreeModel
  implements TreeModel
{
  private static final SimpleTreeNode singletonNullRoot = new SimpleTreeNode()
  {
    public int getChildCount()
    {
      return 0;
    }
    
    public SimpleTreeNode getChild(int index)
    {
      return null;
    }
    
    public boolean isLeaf()
    {
      return true;
    }
    
    public int getIndexOfChild(SimpleTreeNode child)
    {
      return 0;
    }
    
    public String toString()
    {
      return "";
    }
    
    public String getName()
    {
      return toString();
    }
    
    public String getValue()
    {
      return toString();
    }
  };
  private SimpleTreeNode root = singletonNullRoot;
  private List listeners = new ArrayList();
  
  public void setRoot(SimpleTreeNode node)
  {
    if (node != null) {
      root = node;
    } else {
      root = singletonNullRoot;
    }
    fireTreeStructureChanged();
  }
  
  public Object getRoot()
  {
    return root;
  }
  
  public Object getChild(Object parent, int index)
  {
    return ((SimpleTreeNode)parent).getChild(index);
  }
  
  public int getChildCount(Object parent)
  {
    return ((SimpleTreeNode)parent).getChildCount();
  }
  
  public boolean isLeaf(Object node)
  {
    if (node == null) {
      return true;
    }
    return ((SimpleTreeNode)node).isLeaf();
  }
  
  public void valueForPathChanged(TreePath path, Object newValue)
  {
    throw new UnsupportedOperationException();
  }
  
  public int getIndexOfChild(Object parent, Object child)
  {
    return ((SimpleTreeNode)parent).getIndexOfChild((SimpleTreeNode)child);
  }
  
  public void addTreeModelListener(TreeModelListener l)
  {
    listeners.add(l);
  }
  
  public void removeTreeModelListener(TreeModelListener l)
  {
    listeners.remove(l);
  }
  
  public void fireTreeStructureChanged()
  {
    TreeModelEvent e = new TreeModelEvent(getRoot(), new Object[] { getRoot() }, null, null);
    for (Iterator iter = listeners.iterator(); iter.hasNext();)
    {
      TreeModelListener l = (TreeModelListener)iter.next();
      l.treeStructureChanged(e);
    }
  }
}

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

public abstract interface SimpleTreeNode
{
  public abstract int getChildCount();
  
  public abstract SimpleTreeNode getChild(int paramInt);
  
  public abstract boolean isLeaf();
  
  public abstract int getIndexOfChild(SimpleTreeNode paramSimpleTreeNode);
  
  public abstract String getName();
  
  public abstract String getValue();
}

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

import javax.swing.event.EventListenerList;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.tree.TreePath;

public abstract class AbstractTreeTableModel
  implements TreeTableModel
{
  protected Object root;
  protected EventListenerList listenerList = new EventListenerList();
  
  public AbstractTreeTableModel(Object root)
  {
    this.root = root;
  }
  
  public Object getRoot()
  {
    return root;
  }
  
  public boolean isLeaf(Object node)
  {
    return getChildCount(node) == 0;
  }
  
  public void valueForPathChanged(TreePath path, Object newValue) {}
  
  public int getIndexOfChild(Object parent, Object child)
  {
    for (int i = 0; i < getChildCount(parent); i++) {
      if (getChild(parent, i).equals(child)) {
        return i;
      }
    }
    return -1;
  }
  
  public void addTreeModelListener(TreeModelListener l)
  {
    listenerList.add(TreeModelListener.class, l);
  }
  
  public void removeTreeModelListener(TreeModelListener l)
  {
    listenerList.remove(TreeModelListener.class, l);
  }
  
  protected void fireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children)
  {
    Object[] listeners = listenerList.getListenerList();
    TreeModelEvent e = null;
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
      if (listeners[i] == TreeModelListener.class)
      {
        if (e == null) {
          e = new TreeModelEvent(source, path, childIndices, children);
        }
        ((TreeModelListener)listeners[(i + 1)]).treeNodesChanged(e);
      }
    }
  }
  
  protected void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children)
  {
    Object[] listeners = listenerList.getListenerList();
    TreeModelEvent e = null;
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
      if (listeners[i] == TreeModelListener.class)
      {
        if (e == null) {
          e = new TreeModelEvent(source, path, childIndices, children);
        }
        ((TreeModelListener)listeners[(i + 1)]).treeNodesInserted(e);
      }
    }
  }
  
  protected void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children)
  {
    Object[] listeners = listenerList.getListenerList();
    TreeModelEvent e = null;
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
      if (listeners[i] == TreeModelListener.class)
      {
        if (e == null) {
          e = new TreeModelEvent(source, path, childIndices, children);
        }
        ((TreeModelListener)listeners[(i + 1)]).treeNodesRemoved(e);
      }
    }
  }
  
  protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children)
  {
    Object[] listeners = listenerList.getListenerList();
    TreeModelEvent e = null;
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
      if (listeners[i] == TreeModelListener.class)
      {
        if (e == null) {
          e = new TreeModelEvent(source, path, childIndices, children);
        }
        ((TreeModelListener)listeners[(i + 1)]).treeStructureChanged(e);
      }
    }
  }
  
  public Class getColumnClass(int column)
  {
    return Object.class;
  }
  
  public boolean isCellEditable(Object node, int column)
  {
    return getColumnClass(column) == TreeTableModel.class;
  }
  
  public void setValueAt(Object aValue, Object node, int column) {}
}

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

import javax.swing.Icon;
import javax.swing.tree.DefaultTreeCellRenderer;

class JTreeTable$JTreeTableCellRenderer
  extends DefaultTreeCellRenderer
{
  private final JTreeTable this$0;
  
  JTreeTable$JTreeTableCellRenderer(JTreeTable paramJTreeTable) {}
  
  public Icon getClosedIcon()
  {
    return JTreeTable.access$000(this$0) ? super.getClosedIcon() : null;
  }
  
  public Icon getDefaultClosedIcon()
  {
    return JTreeTable.access$000(this$0) ? super.getDefaultClosedIcon() : null;
  }
  
  public Icon getDefaultLeafIcon()
  {
    return JTreeTable.access$000(this$0) ? super.getDefaultLeafIcon() : null;
  }
  
  public Icon getDefaultOpenIcon()
  {
    return JTreeTable.access$000(this$0) ? super.getDefaultOpenIcon() : null;
  }
  
  public Icon getLeafIcon()
  {
    return JTreeTable.access$000(this$0) ? super.getLeafIcon() : null;
  }
  
  public Icon getOpenIcon()
  {
    return JTreeTable.access$000(this$0) ? super.getOpenIcon() : null;
  }
}

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

import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

class JTreeTable$ListToTreeSelectionModelWrapper$ListSelectionHandler
  implements ListSelectionListener
{
  private final JTreeTable.ListToTreeSelectionModelWrapper this$1;
  
  JTreeTable$ListToTreeSelectionModelWrapper$ListSelectionHandler(JTreeTable.ListToTreeSelectionModelWrapper paramListToTreeSelectionModelWrapper) {}
  
  public void valueChanged(ListSelectionEvent e)
  {
    this$1.updateSelectedPathsFromSelectedRows();
  }
}

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

import javax.swing.DefaultListSelectionModel;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.tree.DefaultTreeSelectionModel;
import javax.swing.tree.TreePath;

class JTreeTable$ListToTreeSelectionModelWrapper
  extends DefaultTreeSelectionModel
{
  protected boolean updatingListSelectionModel;
  private final JTreeTable this$0;
  
  public JTreeTable$ListToTreeSelectionModelWrapper(JTreeTable paramJTreeTable)
  {
    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 = this$0.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.ListToTreeSelectionModelWrapper
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.ui.treetable;

import java.awt.Component;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.util.EventObject;
import javax.swing.DefaultCellEditor;
import javax.swing.Icon;
import javax.swing.JTable;
import javax.swing.JTree;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;

public class JTreeTable$TreeTableCellEditor
  extends DefaultCellEditor
{
  private final JTreeTable this$0;
  
  public JTreeTable$TreeTableCellEditor(JTreeTable paramJTreeTable)
  {
    super(new JTreeTable.TreeTableTextField());
  }
  
  public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int r, int c)
  {
    Component component = super.getTableCellEditorComponent(table, value, isSelected, r, c);
    
    JTree t = this$0.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 = ((DefaultTre
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