sa-jdi

   progressBar.setValue(frac);
        }
      });
    }
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.AddressException;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.utilities.PointerFinder;
import sun.jvm.hotspot.utilities.PointerLocation;

final class FindPanel$1
  implements ActionListener
{
  private final FindPanel this$0;
  
  FindPanel$1(FindPanel paramFindPanel) {}
  
  public void actionPerformed(ActionEvent e)
  {
    try
    {
      Address a = VM.getVM().getDebugger().parseAddress(FindPanel.access$000(this$0).getText());
      PointerLocation loc = PointerFinder.find(a);
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      loc.printOn(new PrintStream(bos));
      FindPanel.access$100(this$0);
      FindPanel.access$200(this$0).append(bos.toString());
      FindPanel.access$300(this$0).setText("");
    }
    catch (NumberFormatException ex)
    {
      FindPanel.access$300(this$0).setText("<parse error>");
    }
    catch (AddressException ex)
    {
      FindPanel.access$300(this$0).setText("<bad address>");
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
      FindPanel.access$300(this$0).setText("<error during find>");
    }
  }
}

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

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import javax.swing.Box;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JViewport;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.AddressException;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.utilities.PointerFinder;
import sun.jvm.hotspot.utilities.PointerLocation;

public class FindPanel
  extends JPanel
{
  private JTextField addressField;
  private JTextArea textArea;
  private JLabel statusLabel;
  
  public FindPanel()
  {
    setLayout(new BorderLayout());
    Box hbox = Box.createHorizontalBox();
    hbox.add(new JLabel("Address: "));
    addressField = new JTextField(20);
    hbox.add(addressField);
    statusLabel = new JLabel();
    hbox.add(statusLabel);
    add(hbox, "North");
    
    JScrollPane scroller = new JScrollPane();
    textArea = new JTextArea();
    textArea.setEditable(false);
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);
    scroller.getViewport().add(textArea);
    add(scroller, "Center");
    
    addressField.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        try
        {
          Address a = VM.getVM().getDebugger().parseAddress(addressField.getText());
          PointerLocation loc = PointerFinder.find(a);
          ByteArrayOutputStream bos = new ByteArrayOutputStream();
          loc.printOn(new PrintStream(bos));
          FindPanel.this.clear();
          textArea.append(bos.toString());
          statusLabel.setText("");
        }
        catch (NumberFormatException ex)
        {
          statusLabel.setText("<parse error>");
        }
        catch (AddressException ex)
        {
          statusLabel.setText("<bad address>");
        }
        catch (Exception ex)
        {
          ex.printStackTrace();
          statusLabel.setText("<error during find>");
        }
      }
    });
  }
  
  private void clear()
  {
    Document doc = textArea.getDocument();
    if (doc.getLength() > 0) {
      try
      {
        doc.remove(0, doc.getLength());
      }
      catch (BadLocationException e) {}
    }
  }
}

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

import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.event.ActionListener;

public abstract interface FrameWrapper
{
  public abstract Component getComponent();
  
  public abstract Container getContentPane();
  
  public abstract void setVisible(boolean paramBoolean);
  
  public abstract void setSize(int paramInt1, int paramInt2);
  
  public abstract void pack();
  
  public abstract void dispose();
  
  public abstract void setBackground(Color paramColor);
  
  public abstract void setResizable(boolean paramBoolean);
  
  public abstract void setClosable(boolean paramBoolean);
  
  public abstract void setClosingActionListener(ActionListener paramActionListener);
  
  public abstract void setActivatedActionListener(ActionListener paramActionListener);
  
  public abstract void toFront();
}

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

import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.GraphicsEnvironment;
import java.awt.geom.Rectangle2D;
import java.util.Random;
import javax.swing.BorderFactory;
import javax.swing.border.Border;

public class GraphicsUtilities
{
  public static Font lookupFont(String fontName)
  {
    Font[] allFonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
    Font font = null;
    for (int i = 0; i < allFonts.length; i++) {
      if (allFonts[i].getFontName().indexOf(fontName) != -1)
      {
        font = allFonts[i];
        break;
      }
    }
    if (font == null) {
      return null;
    }
    return font.deriveFont(0, 12.0F);
  }
  
  public static Rectangle2D getStringBounds(String s, Graphics g)
  {
    FontMetrics fm = g.getFontMetrics();
    return fm.getStringBounds(s, 0, s.length(), g);
  }
  
  public static int getStringWidth(String s, FontMetrics fm)
  {
    return fm.stringWidth(s);
  }
  
  public static void reshapeToAspectRatio(Component component, float aspectRatio, float fillRatio, Dimension containerDimension)
  {
    int x = width;
    int y = height;
    int desiredX;
    int desiredX;
    int desiredY;
    if (x / y > aspectRatio)
    {
      int desiredY = (int)(fillRatio * y);
      desiredX = (int)(desiredY * aspectRatio);
    }
    else
    {
      desiredX = (int)(fillRatio * x);
      desiredY = (int)(desiredX / aspectRatio);
    }
    component.setSize(desiredX, desiredY);
  }
  
  public static void constrainToSize(Component component, Dimension containerDimension)
  {
    Dimension d = component.getSize();
    int x = width;
    int y = height;
    boolean changed = false;
    if (x > width)
    {
      x = width;
      changed = true;
    }
    if (y > height)
    {
      y = height;
      changed = true;
    }
    if (changed) {
      component.setSize(x, y);
    }
  }
  
  public static void centerInContainer(Component c)
  {
    centerInContainer(c, c.getParent().getSize());
  }
  
  public static void centerInContainer(Component component, Dimension containerDimension)
  {
    Dimension sz = component.getSize();
    int x = (width - width) / 2;
    int y = (height - height) / 2;
    component.setLocation(x, y);
  }
  
  public static void moveToInContainer(Component component, float relativeX, float relativeY, int minX, int minY)
  {
    Dimension d = component.getParent().getSize();
    
    Dimension sz = component.getSize();
    int xPos = Math.min(width - width, (int)(width * relativeX - width / 2));
    
    int yPos = Math.min(height - height, (int)(height * relativeY - height / 2));
    
    xPos = Math.max(xPos, minX);
    yPos = Math.max(yPos, minY);
    component.setLocation(xPos, yPos);
  }
  
  static Random random = new Random();
  
  public static void randomLocation(Component c)
  {
    randomLocation(c, c.getParent().getSize());
  }
  
  public static void randomLocation(Component component, Dimension containerDimension)
  {
    Dimension sz = component.getSize();
    int x = (int)((width - width) * random.nextFloat());
    int y = (int)((height - height) * random.nextFloat());
    component.setLocation(x, y);
  }
  
  public static Border newBorder(int size)
  {
    return BorderFactory.createEmptyBorder(size, size, size, size);
  }
}

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

import java.awt.BorderLayout;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JViewport;
import sun.jvm.hotspot.gc_interface.CollectedHeap;
import sun.jvm.hotspot.memory.Universe;
import sun.jvm.hotspot.runtime.VM;

public class HeapParametersPanel
  extends JPanel
{
  public HeapParametersPanel()
  {
    setLayout(new BorderLayout());
    
    JScrollPane scroller = new JScrollPane();
    JTextArea textArea = new JTextArea();
    textArea = new JTextArea();
    textArea.setEditable(false);
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);
    scroller.getViewport().add(textArea);
    add(scroller, "Center");
    
    Universe u = VM.getVM().getUniverse();
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    PrintStream tty = new PrintStream(bos);
    tty.println("Heap Parameters:");
    u.heap().printOn(tty);
    
    textArea.setText(bos.toString());
  }
}

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

import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
import java.math.BigInteger;

final class HighPrecisionJScrollBar$1
  implements AdjustmentListener
{
  private final HighPrecisionJScrollBar this$0;
  
  HighPrecisionJScrollBar$1(HighPrecisionJScrollBar paramHighPrecisionJScrollBar) {}
  
  public void adjustmentValueChanged(AdjustmentEvent e)
  {
    if (HighPrecisionJScrollBar.access$000(this$0)) {
      return;
    }
    HighPrecisionJScrollBar.access$100(this$0);
    switch (e.getAdjustmentType())
    {
    case 5: 
      int val = e.getValue();
      int diff = val - HighPrecisionJScrollBar.access$200(this$0);
      int absDiff = Math.abs(diff);
      if (absDiff == 1)
      {
        if (diff > 0) {
          this$0.setValueHP(this$0.getValueHP().add(this$0.getUnitIncrementHP()));
        } else {
          this$0.setValueHP(this$0.getValueHP().subtract(this$0.getUnitIncrementHP()));
        }
      }
      else if (absDiff == 2)
      {
        if (diff > 0) {
          this$0.setValueHP(this$0.getValueHP().add(this$0.getBlockIncrementHP()));
        } else {
          this$0.setValueHP(this$0.getValueHP().subtract(this$0.getBlockIncrementHP()));
        }
      }
      else if (absDiff != 0)
      {
        BigInteger i = null;
        if (e.getValue() == this$0.getMinimum()) {
          i = this$0.getMinimumHP();
        } else if (e.getValue() >= this$0.getMaximum() - 1) {
          i = this$0.getMaximumHP();
        } else {
          i = HighPrecisionJScrollBar.access$300(this$0, e.getValue());
        }
        this$0.setValueHP(i);
      }
      break;
    }
    HighPrecisionJScrollBar.access$400(this$0);
  }
}

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

import java.io.PrintStream;
import java.math.BigInteger;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

final class HighPrecisionJScrollBar$2
  implements ChangeListener
{
  public void stateChanged(ChangeEvent e)
  {
    HighPrecisionJScrollBar h = (HighPrecisionJScrollBar)e.getSource();
    System.out.println("New value = 0x" + h.getValueHP().toString(16));
  }
}

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

import java.awt.Container;
import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
import java.io.PrintStream;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JScrollBar;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

public class HighPrecisionJScrollBar
  extends JScrollBar
{
  private BigInteger valueHP;
  private BigInteger visibleHP;
  private BigInteger minimumHP;
  private BigInteger maximumHP;
  private BigInteger unitIncrementHP;
  private BigInteger blockIncrementHP;
  private BigDecimal scaleFactor;
  private BigInteger rangeHP;
  private static final int BIG_RANGE = 10000;
  private boolean down;
  private List changeListeners = new ArrayList();
  private static final int SCALE = 20;
  private static final int UNIT_INCREMENT = 1;
  private static final int BLOCK_INCREMENT = 2;
  private static final int MINIMUM = 0;
  private static final int MAXIMUM = 65536;
  private boolean updating = false;
  private int lastValueSeen = -1;
  
  public HighPrecisionJScrollBar()
  {
    initialize();
    installListener();
  }
  
  public HighPrecisionJScrollBar(int orientation)
  {
    super(orientation);
    initialize();
    installListener();
  }
  
  public HighPrecisionJScrollBar(int orientation, BigInteger value, BigInteger minimum, BigInteger maximum)
  {
    super(orientation);
    initialize(value, minimum, maximum);
    installListener();
  }
  
  public BigInteger getValueHP()
  {
    return valueHP;
  }
  
  public void setValueHP(BigInteger value)
  {
    if (value.compareTo(getMaximumHP()) > 0) {
      value = getMaximumHP();
    } else if (value.compareTo(getMinimumHP()) < 0) {
      value = getMinimumHP();
    }
    valueHP = value.subtract(value.mod(unitIncrementHP));
    int lpValue = toUnderlyingRange(valueHP);
    if (getValueHP().add(getVisibleAmountHP()).compareTo(getMaximumHP()) >= 0) {
      lpValue = 10000 - getVisibleAmount();
    }
    lastValueSeen = lpValue;
    setValue(lpValue);
    fireStateChanged();
  }
  
  public BigInteger getMinimumHP()
  {
    return minimumHP;
  }
  
  public void setMinimumHP(BigInteger minimum)
  {
    setRange(minimum, maximumHP);
    updateScrollBarValues();
  }
  
  public BigInteger getMaximumHP()
  {
    return maximumHP;
  }
  
  public void setMaximumHP(BigInteger maximum)
  {
    setRange(minimumHP, maximum);
    updateScrollBarValues();
  }
  
  public BigInteger getVisibleAmountHP()
  {
    return visibleHP;
  }
  
  public void setVisibleAmountHP(BigInteger visibleAmount)
  {
    visibleHP = visibleAmount;
    int lpVisAmt;
    if (visibleAmount.compareTo(rangeHP) < 0)
    {
      int lpVisAmt = scaleToUnderlying(visibleAmount);
      if (lpVisAmt == 0) {
        lpVisAmt = 1;
      }
      setVisible(true);
    }
    else
    {
      lpVisAmt = 10000;
      setVisible(false);
    }
    setVisibleAmount(lpVisAmt);
  }
  
  public BigInteger getBlockIncrementHP()
  {
    return blockIncrementHP;
  }
  
  public void setBlockIncrementHP(BigInteger blockIncrement)
  {
    blockIncrementHP = blockIncrement;
  }
  
  public BigInteger getUnitIncrementHP()
  {
    return unitIncrementHP;
  }
  
  public void setUnitIncrementHP(BigInteger unitIncrement)
  {
    unitIncrementHP = unitIncrement;
  }
  
  public void addChangeListener(ChangeListener l)
  {
    changeListeners.add(l);
  }
  
  public void removeChangeListener(ChangeListener l)
  {
    changeListeners.remove(l);
  }
  
  public void scrollUpOrLeft()
  {
    if (updating) {
      return;
    }
    beginUpdate();
    setValueHP(getValueHP().subtract(getUnitIncrementHP()));
    endUpdate();
  }
  
  public void scrollDownOrRight()
  {
    if (updating) {
      return;
    }
    beginUpdate();
    setValueHP(getValueHP().add(getUnitIncrementHP()));
    endUpdate();
  }
  
  public void pageUpOrLeft()
  {
    if (updating) {
      return;
    }
    beginUpdate();
    setValueHP(getValueHP().subtract(getBlockIncrementHP()));
    endUpdate();
  }
  
  public void pageDownOrRight()
  {
    if (updating) {
      return;
    }
    beginUpdate();
    setValueHP(getValueHP().add(getBlockIncrementHP()));
    endUpdate();
  }
  
  private void beginUpdate()
  {
    updating = true;
  }
  
  private void endUpdate()
  {
    updating = false;
  }
  
  private void initialize(BigInteger value, BigInteger minimum, BigInteger maximum)
  {
    setMinimum(0);
    setMaximum(9999);
    setValue(0);
    setVisibleAmount(1);
    setUnitIncrement(1);
    setBlockIncrement(2);
    
    setUnitIncrementHP(new BigInteger(Integer.toString(getUnitIncrement())));
    setBlockIncrementHP(new BigInteger(Integer.toString(getBlockIncrement())));
    
    setRange(minimum, maximum);
    
    setVisibleAmountHP(new BigInteger(Integer.toString(getVisibleAmount())));
    setValueHP(value);
  }
  
  private void initialize()
  {
    BigInteger min = new BigInteger(Integer.toString(getMinimum()));
    BigInteger max = new BigInteger(Integer.toString(getMaximum()));
    initialize(min, min, max);
  }
  
  private void setRange(BigInteger minimum, BigInteger maximum)
  {
    if (minimum.compareTo(maximum) > 0) {
      throw new RuntimeException("Bad scrollbar range " + minimum + " > " + maximum);
    }
    minimumHP = minimum;
    maximumHP = maximum;
    rangeHP = maximum.subtract(minimum).add(BigInteger.ONE);
    BigInteger range2 = new BigInteger(Integer.toString(10000));
    if (rangeHP.compareTo(range2) >= 0)
    {
      down = true;
      scaleFactor = new BigDecimal(rangeHP, 20).divide(new BigDecimal(range2, 20), 1).max(new BigDecimal(BigInteger.ONE));
    }
    else
    {
      down = false;
      scaleFactor = new BigDecimal(range2, 20).divide(new BigDecimal(rangeHP, 20), 1).max(new BigDecimal(BigInteger.ONE));
    }
  }
  
  private void updateScrollBarValues()
  {
    setValueHP(getValueHP());
    setVisibleAmountHP(getVisibleAmountHP());
    setBlockIncrementHP(getBlockIncrementHP());
    setUnitIncrementHP(getUnitIncrementHP());
  }
  
  private BigDecimal getScaleFactor()
  {
    return scaleFactor;
  }
  
  private BigInteger scaleToHP(int i)
  {
    BigDecimal ib = new BigDecimal(Integer.toString(i));
    if (down) {
      return ib.multiply(getScaleFactor()).toBigInteger();
    }
    return ib.divide(getScaleFactor(), 1).toBigInteger();
  }
  
  private int scaleToUnderlying(BigInteger i)
  {
    BigDecimal d = new BigDecimal(i);
    if (down) {
      return d.divide(getScaleFactor(), 1).intValue();
    }
    return d.multiply(getScaleFactor()).intValue();
  }
  
  private BigInteger toHPRange(int i)
  {
    return scaleToHP(i).add(minimumHP);
  }
  
  private int toUnderlyingRange(BigInteger i)
  {
    return scaleToUnderlying(i.subtract(minimumHP));
  }
  
  private void installListener()
  {
    super.addAdjustmentListener(new AdjustmentListener()
    {
      public void adjustmentValueChanged(AdjustmentEvent e)
      {
        if (updating) {
          return;
        }
        HighPrecisionJScrollBar.this.beginUpdate();
        switch (e.getAdjustmentType())
        {
        case 5: 
          int val = e.getValue();
          int diff = val - lastValueSeen;
          int absDiff = Math.abs(diff);
          if (absDiff == 1)
          {
            if (diff > 0) {
              setValueHP(getValueHP().add(getUnitIncrementHP()));
            } else {
              setValueHP(getValueHP().subtract(getUnitIncrementHP()));
            }
          }
          else if (absDiff == 2)
          {
            if (diff > 0) {
              setValueHP(getValueHP().add(getBlockIncrementHP()));
            } else {
              setValueHP(getValueHP().subtract(getBlockIncrementHP()));
            }
          }
          else if (absDiff != 0)
          {
            BigInteger i = null;
            if (e.getValue() == getMinimum()) {
              i = getMinimumHP();
            } else if (e.getValue() >= getMaximum() - 1) {
              i = getMaximumHP();
            } else {
              i = HighPrecisionJScrollBar.this.toHPRange(e.getValue());
            }
            setValueHP(i);
          }
          break;
        }
        HighPrecisionJScrollBar.this.endUpdate();
      }
    });
  }
  
  private void fireStateChanged()
  {
    ChangeEvent e = null;
    for (Iterator iter = changeListeners.iterator(); iter.hasNext();)
    {
      ChangeListener l = (ChangeListener)iter.next();
      if (e == null) {
        e = new ChangeEvent(this);
      }
      l.stateChanged(e);
    }
  }
  
  public static void main(String[] args)
  {
    JFrame frame = new JFrame();
    frame.setSize(300, 300);
    
    HighPrecisionJScrollBar hpsb = new HighPrecisionJScrollBar(1, new BigInteger(1, new byte[] { Byte.MIN_VALUE, 0, 0, 0, 0, 0, 0, 0 }), new BigInteger(1, new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }), new BigInteger(1, new byte[] { -1, -1, -1, -1, -1, -1, -1, -1 }));
    
    hpsb.setUnitIncrementHP(new BigInteger(1, new byte[] { 0, 0, 0, 0, 0, 0, 0, 1 }));
    
    hpsb.setBlockIncrementHP(new BigInteger(1, new byte[] { 0, 0, 0, 0, 0, 0, 0, 16 }));
    
    hpsb.addChangeListener(new ChangeListener()
    {
      public void stateChanged(ChangeEvent e)
      {
        HighPrecisionJScrollBar h = (HighPrecisionJScrollBar)e.getSource();
        System.out.println("New value = 0x" + h.getValueHP().toString(16));
      }
    });
    frame.getContentPane().add(hpsb);
    frame.setVisible(true);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HistoryComboBox$1
  implements ActionListener
{
  private final HistoryComboBox this$0;
  
  HistoryComboBox$1(HistoryComboBox paramHistoryComboBox) {}
  
  public void actionPerformed(ActionEvent e)
  {
    Object text = this$0.getSelectedItem();
    if (text != null) {
      this$0.setText((String)text);
    }
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ComboBoxModel;
import javax.swing.JComboBox;

public class HistoryComboBox
  extends JComboBox
{
  static final int HISTORY_LENGTH = 15;
  
  public HistoryComboBox()
  {
    setEditable(true);
    addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        Object text = getSelectedItem();
        if (text != null) {
          setText((String)text);
        }
      }
    });
  }
  
  public String getText()
  {
    Object text = getSelectedItem();
    if (text == null) {
      return "";
    }
    return (String)text;
  }
  
  public void setText(String text)
  {
    removeItem(text);
    insertItemAt(text, 0);
    setSelectedItem(text);
    int length = getModel().getSize();
    while (length > 15) {
      removeItemAt(--length);
    }
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.runtime.VM;

final class Inspector$1
  implements ActionListener
{
  private final Inspector this$0;
  
  Inspector$1(Inspector paramInspector) {}
  
  public void actionPerformed(ActionEvent e)
  {
    String text = Inspector.access$000(this$0).getText();
    try
    {
      VM vm = VM.getVM();
      Address a = vm.getDebugger().parseAddress(text);
      OopHandle handle = a.addOffsetToAsOopHandle(-vm.getAddressSize());
      Inspector.access$000(this$0).setText(handle.toString());
    }
    catch (Exception ex) {}
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class Inspector$2
  implements ActionListener
{
  private final Inspector this$0;
  
  Inspector$2(Inspector paramInspector) {}
  
  public void actionPerformed(ActionEvent e)
  {
    if (Inspector.access$100(this$0) != null) {
      Inspector.access$200(this$0);
    }
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class Inspector$3
  implements ActionListener
{
  private final Inspector this$0;
  
  Inspector$3(Inspector paramInspector) {}
  
  public void actionPerformed(ActionEvent e)
  {
    Inspector.access$300(this$0);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.AddressException;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.oops.NamedFieldIdentifier;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.UnknownOopException;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.types.Field;
import sun.jvm.hotspot.types.PointerType;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.ui.tree.CTypeTreeNodeAdapter;
import sun.jvm.hotspot.ui.tree.OopTreeNodeAdapter;
import sun.jvm.hotspot.utilities.CPPExpressions;
import sun.jvm.hotspot.utilities.CPPExpressions.CastExpr;
import sun.jvm.hotspot.utilities.CPPExpressions.StaticFieldExpr;
import sun.jvm.hotspot.utilities.RobustOopDeterminator;

final class Inspector$4
  implements ActionListener
{
  private final Inspector this$0;
  
  Inspector$4(Inspector paramInspector) {}
  
  public void actionPerformed(ActionEvent e)
  {
    String text = Inspector.access$000(this$0).getText();
    try
    {
      Address a = VM.getVM().getDebugger().parseAddress(text);
      int max_searches = 1000;
      int searches = 0;
      int offset = 0;
      Oop oop = null;
      if (a != null)
      {
        OopHandle handle = a.addOffsetToAsOopHandle(0L);
        while (searches < max_searches)
        {
          searches++;
          if (RobustOopDeterminator.oopLooksValid(handle)) {
            try
            {
              oop = VM.getVM().getObjectHeap().newOop(handle);
              Inspector.access$000(this$0).setText(handle.toString());
            }
            catch (UnknownOopException ex) {}catch (RuntimeException ex)
            {
              ex.printStackTrace();
            }
          }
          offset -= 4;
          handle = a.addOffsetToAsOopHandle(offset);
        }
      }
      if (oop != Inspector.access$100(this$0))
      {
        Inspector.access$102(this$0, oop);
        Inspector.access$400(this$0).setText("");
        Inspector.access$502(this$0, null);
        if (Inspector.access$600(this$0).getText().equals("Show Liveness"))
        {
          Inspector.access$600(this$0).setText("Compute Liveness");
          Inspector.access$600(this$0).removeActionListener(Inspector.access$700(this$0));
          Inspector.access$600(this$0).addActionListener(Inspector.access$800(this$0));
        }
      }
      if (oop != null)
      {
        Inspector.access$900(this$0).setText("");
        Inspector.access$1000(this$0, new OopTreeNodeAdapter(oop, null));
        return;
      }
      Type t = VM.getVM().getTypeDataBase().guessTypeForAddress(a);
      if (t != null)
      {
        Inspector.access$900(this$0).setText("");
        Inspector.access$1000(this$0, new CTypeTreeNodeAdapter(a, t, null));
        return;
      }
      Inspector.access$900(this$0).setText("<bad oop or unknown C++ object " + text + ">");
    }
    catch (NumberFormatException ex)
    {
      Inspector.access$102(this$0, null);
      Inspector.access$400(this$0).setText("");
      Inspector.access$502(this$0, null);
      if (Inspector.access$600(this$0).getText().equals("Show Liveness"))
      {
        Inspector.access$600(this$0).setText("Compute Liveness");
        Inspector.access$600(this$0).removeActionListener(Inspector.access$700(this$0));
        Inspector.access$600(this$0).addActionListener(Inspector.access$800(this$0));
      }
      CPPExpressions.CastExpr cast = CPPExpressions.parseCast(text);
      if (cast != null)
      {
        TypeDataBase db = VM.getVM().getTypeDataBase();
        Type t = db.lookupType(cast.getType());
        if (t == null) {
          Inspector.access$900(this$0).setText("<unknown C++ type \"" + cast.getType() + "\">");
        } else {
          try
          {
            Address a = VM.getVM().getDebugger().parseAddress(cast.getAddress());
            Inspector.access$900(this$0).setText("");
            Inspector.access$1000(this$0, new CTypeTreeNodeAdapter(a, t, null));
          }
          catch (NumberFormatException ex2)
          {
            Inspector.access$900(this$0).setText("<bad address " + cast.getAddress() + ">");
          }
        }
        return;
      }
      CPPExpressions.StaticFieldExpr stat = CPPExpressions.parseStaticField(text);
      if (stat != null)
      {
        TypeDataBase db = VM.getVM().getTypeDataBase();
        Type t = db.lookupType(stat.getContainingType());
        if (t == null)
        {
          Inspector.access$900(this$0).setText("<unknown C++ type \"" + stat.getContainingType() + "\">");
        }
        else
        {
          Field f = t.getField(stat.getFieldName(), true, false);
          if (f == null)
          {
            Inspector.access$900(this$0).setText("<unknown field \"" + stat.getFieldName() + "\" in type \"" + stat.getContainingType() + "\">");
          }
          else if (!f.isStatic())
          {
            Inspector.access$900(this$0).setText("<field \"" + stat.getContainingType() + "::" + stat.getFieldName() + "\" was not static>");
          }
          else
          {
            Type fieldType = f.getType();
            if (fieldType.isPointerType())
            {
              fieldType = ((PointerType)fieldType).getTargetType();
              
              Type typeGuess = db.guessTypeForAddress(f.getAddress());
              if (typeGuess != null) {
                fieldType = typeGuess;
              }
              Inspector.access$900(this$0).setText("");
              Inspector.access$1000(this$0, new CTypeTreeNodeAdapter(f.getAddress(), fieldType, new NamedFieldIdentifier(text)));
            }
            else
            {
              Inspector.access$900(this$0).setText("");
              Inspector.access$1000(this$0, new CTypeTreeNodeAdapter(f.getStaticFieldAddress(), f.getType(), new NamedFieldIdentifier(text)));
            }
          }
        }
        return;
      }
      Inspector.access$900(this$0).setText("<parse error>");
    }
    catch (AddressException ex)
    {
      ex.printStackTrace();
      Inspector.access$102(this$0, null);
      Inspector.access$400(this$0).setText("");
      Inspector.access$502(this$0, null);
      if (Inspector.access$600(this$0).getText().equals("Show Liveness"))
      {
        Inspector.access$600(this$0).setText("Compute Liveness");
        Inspector.access$600(this$0).removeActionListener(Inspector.access$700(this$0));
        Inspector.access$600(this$0).addActionListener(Inspector.access$800(this$0));
      }
      Inspector.access$900(this$0).setText("<bad address>");
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
      Inspector.access$102(this$0, null);
      Inspector.access$400(this$0).setText("");
      Inspector.access$502(this$0, null);
      if (Inspector.access$600(this$0).getText().equals("Show Liveness"))
      {
        Inspector.access$600(this$0).setText("Compute Liveness");
        Inspector.access$600(this$0).removeActionListener(Inspector.access$700(this$0));
        Inspector.access$600(this$0).addActionListener(Inspector.access$800(this$0));
      }
      Inspector.access$900(this$0).setText("<error constructing oop>");
    }
  }
}

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

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JTree;
import javax.swing.tree.TreePath;
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;

final class Inspector$5
  extends MouseAdapter
{
  private final Inspector this$0;
  
  Inspector$5(Inspector paramInspector) {}
  
  public void mousePressed(MouseEvent e)
  {
    int selRow = Inspector.access$1100(this$0).getRowForLocation(e.getX(), e.getY());
    TreePath selPath = Inspector.access$1100(this$0).getPathForLocation(e.getX(), e.getY());
    if ((selRow != -1) && 
      (e.getClickCount() == 1) && ((e.getModifiersEx() & 0x40) != 0))
    {
      Object node = Inspector.access$1100(this$0).getLastSelectedPathComponent();
      if ((node != null) && ((node instanceof SimpleTreeNode))) {
        this$0.showInspector((SimpleTreeNode)node);
      }
    }
  }
}

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

import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.ui.tree.OopTreeNodeAdapter;
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;

final class Inspector$6
  implements Runnable
{
  private final Inspector this$0;
  
  Inspector$6(Inspector paramInspector, SimpleTreeNode paramSimpleTreeNode) {}
  
  public void run()
  {
    if ((val$root instanceof OopTreeNodeAdapter))
    {
      Oop oop = ((OopTreeNodeAdapter)val$root).getOop();
      Inspector.access$000(this$0).setText(oop.getHandle().toString());
    }
    Inspector.access$1000(this$0, val$root);
  }
}

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

import javax.swing.JButton;
import javax.swing.JLabel;
import sun.jvm.hotspot.utilities.LivenessAnalysis;

final class Inspector$7
  implements Runnable
{
  private final Inspector this$0;
  
  Inspector$7(Inspector paramInspector) {}
  
  public void run()
  {
    Inspector.access$502(this$0, LivenessAnalysis.computeAllLivenessPaths(Inspector.access$100(this$0)));
    if (Inspector.access$500(this$0) == null)
    {
      Inspector.access$400(this$0).setText("Oop is Dead");
    }
    else
    {
      Inspector.access$400(this$0).setText("Oop is Alive");
      Inspector.access$600(this$0).removeActionListener(Inspector.access$800(this$0));
      Inspector.access$600(this$0).addActionListener(Inspector.access$700(this$0));
      
      Inspector.access$600(this$0).setEnabled(true);
      Inspector.access$600(this$0).setText("Show Liveness");
    }
  }
}

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

import sun.jvm.hotspot.utilities.ReversePtrsAnalysis;
import sun.jvm.hotspot.utilities.WorkerThread;

final class Inspector$8
  implements Runnable
{
  private final Inspector this$0;
  
  Inspector$8(Inspector paramInspector, Runnable paramRunnable, WorkerThread paramWorkerThread) {}
  
  public void run()
  {
    try
    {
      ReversePtrsAnalysis rev = new ReversePtrsAnalysis();
      rev.run();
      val$cutoverButtonRunnable.run();
    }
    finally
    {
      val$worker.shutdown();
    }
  }
}

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

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.Iterator;
import java.util.List;
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
import javax.swing.tree.TreePath;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.AddressException;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.oops.NamedFieldIdentifier;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.UnknownOopException;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.types.Field;
import sun.jvm.hotspot.types.PointerType;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.ui.tree.CTypeTreeNodeAdapter;
import sun.jvm.hotspot.ui.tree.OopTreeNodeAdapter;
import sun.jvm.hotspot.ui.tree.SimpleTreeModel;
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;
import sun.jvm.hotspot.utilities.CPPExpressions;
import sun.jvm.hotspot.utilities.CPPExpressions.CastExpr;
import sun.jvm.hotspot.utilities.CPPExpressions.StaticFieldExpr;
import sun.jvm.hotspot.utilities.LivenessAnalysis;
import sun.jvm.hotspot.utilities.LivenessPathList;
import sun.jvm.hotspot.utilities.ReversePtrsAnalysis;
import sun.jvm.hotspot.utilities.RobustOopDeterminator;
import sun.jvm.hotspot.utilities.WorkerThread;

public class Inspector
  extends SAPanel
{
  private JTree tree;
  private SimpleTreeModel model;
  private HistoryComboBox addressField;
  private JLabel statusLabel;
  private JButton livenessButton;
  private ActionListener livenessButtonListener;
  private ActionListener showLivenessListener;
  private static final String computeLivenessText = "Compute Liveness";
  private static final String showLivenessText = "Show Liveness";
  private JLabel liveStatus;
  private LivenessPathList list = null;
  private Oop currentOop = null;
  
  public Inspector()
  {
    model = new SimpleTreeModel();
    tree = new JTree(model);
    
    setLayout(new BorderLayout());
    Box hbox = Box.createHorizontalBox();
    JButton button = new JButton("Previous Oop");
    button.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        String text = addressField.getText();
        try
        {
          VM vm = VM.getVM();
          Address a = vm.getDebugger().parseAddress(text);
          OopHandle handle = a.addOffsetToAsOopHandle(-vm.getAddressSize());
          addressField.setText(handle.toString());
        }
        catch (Exception ex) {}
      }
    });
    hbox.add(button);
    hbox.add(new JLabel("Address / C++ Expression: "));
    add
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