FileDocCategorySizeDatePackage
ViewNode.javaAPI DocAndroid 1.5 API6115Wed May 06 22:41:10 BST 2009com.android.hierarchyviewer.scene

ViewNode

public class ViewNode extends Object

Fields Summary
public String
id
public String
name
public List
properties
public Map
namedProperties
public ViewNode
parent
public List
children
public Image
image
public int
left
public int
top
public int
width
public int
height
public int
scrollX
public int
scrollY
public int
paddingLeft
public int
paddingRight
public int
paddingTop
public int
paddingBottom
public int
marginLeft
public int
marginRight
public int
marginTop
public int
marginBottom
public int
baseline
public boolean
willNotDraw
public boolean
hasMargins
boolean
hasFocus
int
index
public boolean
decoded
public boolean
filtered
private String
shortName
private StateListener
listener
Constructors Summary
Methods Summary
voidcomputeIndex()

        index = parent == null ? 0 : parent.children.indexOf(this);
        listener.nodeIndexChanged(this);
    
voiddecode()


      
        id = namedProperties.get("mID").value;

        left = getInt("mLeft", 0);
        top = getInt("mTop", 0);
        width = getInt("getWidth()", 0);
        height = getInt("getHeight()", 0);
        scrollX = getInt("mScrollX", 0);
        scrollY = getInt("mScrollY", 0);
        paddingLeft = getInt("mPaddingLeft", 0);
        paddingRight = getInt("mPaddingRight", 0);
        paddingTop = getInt("mPaddingTop", 0);
        paddingBottom = getInt("mPaddingBottom", 0);
        marginLeft = getInt("layout_leftMargin", Integer.MIN_VALUE);
        marginRight = getInt("layout_rightMargin", Integer.MIN_VALUE);
        marginTop = getInt("layout_topMargin", Integer.MIN_VALUE);
        marginBottom = getInt("layout_bottomMargin", Integer.MIN_VALUE);
        baseline = getInt("getBaseline()", 0);
        willNotDraw = getBoolean("willNotDraw()", false);
        hasFocus = getBoolean("hasFocus()", false);

        hasMargins = marginLeft != Integer.MIN_VALUE &&
                marginRight != Integer.MIN_VALUE &&
                marginTop != Integer.MIN_VALUE &&
                marginBottom != Integer.MIN_VALUE;

        decoded = true;
    
public booleanequals(java.lang.Object obj)

        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ViewNode other = (ViewNode) obj;
        return !(this.name != other.name && (this.name == null || !this.name.equals(other.name)));
    
public voidfilter(java.util.regex.Pattern pattern)

        if (pattern == null || pattern.pattern().length() == 0) {
            filtered = false;
        } else {
            filtered = pattern.matcher(shortName).find() || pattern.matcher(id).find();
        }
        listener.nodeStateChanged(this);
    
private booleangetBoolean(java.lang.String name, boolean defaultValue)

        Property p = namedProperties.get(name);
        if (p != null) {
            try {
                return Boolean.parseBoolean(p.value);
            } catch (NumberFormatException e) {
                return defaultValue;
            }   
        }
        return defaultValue;
    
private intgetInt(java.lang.String name, int defaultValue)

        Property p = namedProperties.get(name);
        if (p != null) {
            try {
                return Integer.parseInt(p.value);
            } catch (NumberFormatException e) {
                return defaultValue;
            }
        }
        return defaultValue;
    
public inthashCode()

        int hash = 5;
        hash = 67 * hash + (this.name != null ? this.name.hashCode() : 0);
        return hash;
    
voidsetShortName(java.lang.String shortName)

        this.shortName = shortName;
    
voidsetStateListener(com.android.hierarchyviewer.scene.ViewNode$StateListener listener)

        this.listener = listener;
    
public java.lang.StringtoString()

        return name;