FileDocCategorySizeDatePackage
PropertiesTableModel.javaAPI DocAndroid 1.5 API2722Wed May 06 22:41:10 BST 2009com.android.hierarchyviewer.ui.model

PropertiesTableModel

public class PropertiesTableModel extends DefaultTableModel

Fields Summary
private List
properties
private List
privateProperties
Constructors Summary
public PropertiesTableModel(com.android.hierarchyviewer.scene.ViewNode node)


       
        properties = node.properties;
        loadPrivateProperties(node);
    
Methods Summary
public intgetColumnCount()

        return 2;
    
public java.lang.StringgetColumnName(int column)

        return column == 0 ? "Property" : "Value";
    
public intgetRowCount()

        return (privateProperties == null ? 0 : privateProperties.size()) +
                (properties == null ? 0 : properties.size());
    
public java.lang.ObjectgetValueAt(int row, int column)

        ViewNode.Property property;

        if (row < privateProperties.size()) {
            property = privateProperties.get(row);
        } else {
            property = properties.get(row - privateProperties.size());
        }

        return column == 0 ? property.name : property.value;
    
public booleanisCellEditable(int arg0, int arg1)

        return false;
    
private voidloadPrivateProperties(com.android.hierarchyviewer.scene.ViewNode node)

        int x = node.left;
        int y = node.top;
        ViewNode p = node.parent;
        while (p != null) {
            x += p.left - p.scrollX;
            y += p.top - p.scrollY;
            p = p.parent;
        }

        ViewNode.Property property = new ViewNode.Property();
        property.name = "absolute_x";
        property.value = String.valueOf(x);
        privateProperties.add(property);

        property = new ViewNode.Property();
        property.name = "absolute_y";
        property.value = String.valueOf(y);
        privateProperties.add(property);
    
public voidsetValueAt(java.lang.Object arg0, int arg1, int arg2)