Home
last modified time | relevance | path

Searched refs:node (Results 1 – 25 of 66) sorted by relevance

123

/sdk/hierarchyviewer/src/com/android/hierarchyviewer/ui/
DCaptureRenderer.java25 private ViewNode node; field in CaptureRenderer
28 CaptureRenderer(ImageIcon icon, ViewNode node) { in CaptureRenderer() argument
30 this.node = node; in CaptureRenderer()
38 if (node.hasMargins) { in getPreferredSize()
39 d.width += node.marginLeft + node.marginRight; in getPreferredSize()
40 d.height += node.marginTop + node.marginBottom; in getPreferredSize()
65 if ((node.paddingBottom | node.paddingLeft | in paintComponent()
66 node.paddingTop | node.paddingRight) != 0) { in paintComponent()
68 g.drawRect(node.paddingLeft, node.paddingTop, in paintComponent()
69 width - node.paddingRight - node.paddingLeft, in paintComponent()
[all …]
DLayoutRenderer.java94 ViewNode node = (ViewNode) selection.iterator().next(); in paintComponent() local
97 ViewNode p = node.parent; in paintComponent()
102 if (showExtras && node.image != null) { in paintComponent()
103 s.drawImage(node.image, node.left, node.top, null); in paintComponent()
105 s.drawRect(node.left, node.top, node.width - 1, node.height - 1); in paintComponent()
114 for (ViewNode node : root.children) { in drawChildren()
115 if (!node.willNotDraw) { in drawChildren()
116 g.drawRect(node.left, node.top, node.width - 1, node.height - 1); in drawChildren()
119 if (node.children.size() > 0) { in drawChildren()
120 drawChildren(g, node, in drawChildren()
[all …]
/sdk/layoutopt/libs/uix/src/resources/rules/
DUselessLayout.rule3 // Description: Checks whether current node can be removed.
6 // - The node has children
7 // - The node does not have siblings
8 // - The node's parent is not a scroll view (horizontal or vertical)
9 // - The node does not have a background or its parent does not have a
10 // background or neither the node and its parent have a background
13 if (!node.isRoot() && !(node['..'].name() in ["ScrollView", "HorizontalScrollView"]) &&
14 node['..']['*'].size() == 1 && node['*'].size() > 0 && ((node.'@android:background' ||
15 node['..'].'@android:background') || (!node.'@android:background' &&
16 !node['..'].'@android:background'))) {
[all …]
DMergeRootFrameLayout.rule3 // Description: Checks whether the root node of the XML document can be
7 // - The node is the root of the document
8 // - The node is a FrameLayout
9 // - The node is match_parent in both orientation *or* it has no layout_gravity
10 // - The node does not have a background nor a foreground
11 // - The node does not have padding
13 if (node.isRoot() && node.is("FrameLayout") && !node.'@android:background' &&
14 !node.'@android:foreground' && ((node.isWidthFillParent() &&
15 node.isHeightFillParent()) || !node.'@android:layout_gravity') &&
16 !node.hasPadding()) {
DUselessView.rule6 // - The node is a container view (LinearLayout, etc.)
7 // - The node has no id
8 // - The node has no background
9 // - The node has no children
11 if (node.isContainer() && node.'*'.size() == 0 && !node.'@android:id' &&
12 !node.'@android:background') {
13 analysis << "This ${node.name()} view is useless (no children, no background, no id)"
DUseCompoundDrawables.rule3 // Description: Checks whether the current node can be replaced by a TextView
7 // - The node is a LinearLayout
8 // - The node has two children, ImageView and TextView
11 if (node.is("LinearLayout") && node.'*'.size() == 2 && node.'TextView'.size() == 1 &&
12 node.'ImageView'.size() == 1 && !node.'ImageView'[0].'@android:layout_weight') {
DNestedScrollingWidgets.rule6 // - The node is a scrolling widget
7 // - The node has a descendant who is also a scrolling widget
10 if (node.name() in widgets && node.all().any{ it.name() in widgets }) {
11 analysis << "The vertically scrolling ${node.name()} should not contain another " +
16 if (node.name() in widgets && node.all().any{ it.name() in widgets }) {
17 analysis << "The horizontally scrolling ${node.name()} should not contain another " +
DInefficientWeight.rule6 // - The node has a LinearLayout parent
7 // - The node is the only sibling with a weight
8 // - The node has a height/width != 0
10 def parent = node.'..'
11 if (parent.is("LinearLayout") && node.'@android:layout_weight' &&
15 if (node."@${dimension}"[0] != '0') {
16 analysis << "Use an ${dimension} of 0dip instead of ${node."@${dimension}"} " +
DIncorrectHeightInScrollView.rule6 // - The node has a ScrollView parent
7 // - The node has a height set to match_parent
9 if (node.'..'.is("ScrollView") && node.isHeightFillParent()) {
10 analysis << "This ${node.name()} tag should use android:layout_height=\"wrap_content\""
DIncorrectWidthInHorizontalScrollView.rule6 // - The node has a HorizontalScrollView parent
7 // - The node has a width set to match_parent
9 if (node.'..'.is("HorizontalScrollView") && node.isWidthFillParent()) {
10 analysis << "This ${node.name()} tag should use android:layout_width=\"wrap_content\""
DTooManyChildren.rule9 if (node.name() in ["ScrollView", "HorizontalScrollView"] && node.'*'.size() > 1) {
13 if (node.name() in ["ListView", "GridView"] && node.'*'.size() > 0) {
14 analysis << "A list/grid should have no children declared in node"
DTooManyViews.rule8 if (node.isRoot && (size = node.'**'.size()) > 80) {
9 analysis << [node: null,
DTooManyLevels.rule8 if (node.isRoot() && (depth = node.depth()) > 10) {
9 analysis << [node: null, description: "This layout has too many nested layouts: " +
/sdk/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/
DXmlParserUtils.java30 public static Node getFirstChild(Node node, String xmlLocalName) { in getFirstChild() argument
32 String nsUri = node.getNamespaceURI(); in getFirstChild()
33 for(Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) { in getFirstChild()
58 public static String getXmlString(Node node, String xmlLocalName) { in getXmlString() argument
59 Node child = getFirstChild(node, xmlLocalName); in getXmlString()
77 public static String getOptionalXmlString(Node node, String xmlLocalName) { in getOptionalXmlString() argument
78 Node child = getFirstChild(node, xmlLocalName); in getOptionalXmlString()
87 public static int getXmlInt(Node node, String xmlLocalName, int defaultValue) { in getXmlInt() argument
88 String s = getXmlString(node, xmlLocalName); in getXmlInt()
100 public static long getXmlLong(Node node, String xmlLocalName, long defaultValue) { in getXmlLong() argument
[all …]
/sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/
DLayoutDevice.java134 Element node = createNode(doc, configNode, LayoutDevicesXsd.NODE_COUNTRY_CODE); in saveConfigTo() local
135 node.setTextContent(Integer.toString(ccq.getCode())); in saveConfigTo()
140 Element node = createNode(doc, configNode, LayoutDevicesXsd.NODE_NETWORK_CODE); in saveConfigTo() local
141 node.setTextContent(Integer.toString(ncq.getCode())); in saveConfigTo()
146 Element node = createNode(doc, configNode, LayoutDevicesXsd.NODE_SCREEN_SIZE); in saveConfigTo() local
147 node.setTextContent(ssq.getFolderSegment()); in saveConfigTo()
152 Element node = createNode(doc, configNode, LayoutDevicesXsd.NODE_SCREEN_RATIO); in saveConfigTo() local
153 node.setTextContent(srq.getFolderSegment()); in saveConfigTo()
158 Element node = createNode(doc, configNode, LayoutDevicesXsd.NODE_SCREEN_ORIENTATION); in saveConfigTo() local
159 node.setTextContent(soq.getFolderSegment()); in saveConfigTo()
[all …]
/sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/
DReplaceStringsVisitor.java83 public boolean visit(StringLiteral node) { in visit() argument
84 if (node.getLiteralValue().equals(mOldString)) { in visit()
90 useGetResource = examineVariableDeclaration(node) || in visit()
91 examineMethodInvocation(node); in visit()
100 Expression context = methodHasContextArgument(node); in visit()
101 if (context == null && !isClassDerivedFromContext(node)) { in visit()
105 context = findContextFieldOrMethod(node); in visit()
125 mRewriter.replace(node, newNode, editGroup); in visit()
127 return super.visit(node); in visit()
141 private boolean examineVariableDeclaration(StringLiteral node) { in examineVariableDeclaration() argument
[all …]
/sdk/layoutopt/libs/uix/src/com/android/layoutopt/uix/groovy/
DLayoutAnalysisCategory.java91 public static int getStartLine(Node node) { in getStartLine() argument
92 final Object data = node == null ? null : in getStartLine()
93 node.getUserData(XmlDocumentBuilder.NODE_START_LINE); in getStartLine()
102 public static int getEndLine(Node node) { in getEndLine() argument
103 final Object data = node == null ? null : in getEndLine()
104 node.getUserData(XmlDocumentBuilder.NODE_END_LINE); in getEndLine()
156 public static boolean isRoot(Node node) { in isRoot() argument
157 return node.getOwnerDocument().getDocumentElement() == node; in isRoot()
165 public static boolean is(Node node, String name) { in is() argument
166 return node.getNodeName().equals(name); in is()
[all …]
/sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/
DExplodedRenderingHelper.java232 Node node = entry.getKey(); in combineRelativeLayout() local
235 int[] leftResult = getBiggestMarginInDirection(node, 0 /*horizontal*/, in combineRelativeLayout()
241 int[] rightResult = getBiggestMarginInDirection(node, 0 /*horizontal*/, in combineRelativeLayout()
247 int[] thisPadding = childrenPadding.get(node); in combineRelativeLayout()
257 int[] topResult = getBiggestMarginInDirection(node, 1 /*horizontal*/, in combineRelativeLayout()
263 int[] bottomResult = getBiggestMarginInDirection(node, 1 /*horizontal*/, in combineRelativeLayout()
284 private int[] getBiggestMarginInDirection(Node node, int resIndex, String relativeTo, in getBiggestMarginInDirection() argument
288 NamedNodeMap attributes = node.getAttributes(); in getBiggestMarginInDirection()
290 String viewId = getAttribute(node, "id", attributes); //$NON-NLS-1$ in getBiggestMarginInDirection()
293 String toLeftOfRef = getAttribute(node, relativeTo, attributes); in getBiggestMarginInDirection()
[all …]
/sdk/hierarchyviewer/src/com/android/hierarchyviewer/ui/model/
DPropertiesTableModel.java29 public PropertiesTableModel(ViewNode node) { in PropertiesTableModel() argument
30 properties = node.properties; in PropertiesTableModel()
31 loadPrivateProperties(node); in PropertiesTableModel()
34 private void loadPrivateProperties(ViewNode node) { in loadPrivateProperties() argument
35 int x = node.left; in loadPrivateProperties()
36 int y = node.top; in loadPrivateProperties()
37 ViewNode p = node.parent; in loadPrivateProperties()
/sdk/hierarchyviewer/src/com/android/hierarchyviewer/scene/
DViewHierarchyScene.java62 protected Widget attachNodeWidget(ViewNode node) { in attachNodeWidget() argument
63 Widget widget = createBox(node, node.name, node.id); in attachNodeWidget()
70 private Widget createBox(ViewNode node, String nodeName, String id) { in createBox() argument
72 node.setShortName(shortName); in createBox()
74 GradientWidget box = new GradientWidget(this, node); in createBox()
194 private final ViewNode node; field in ViewHierarchyScene.GradientWidget
203 public GradientWidget(ViewHierarchyScene scene, ViewNode node) { in GradientWidget() argument
205 this.node = node; in GradientWidget()
206 node.setStateListener(this); in GradientWidget()
219 child.setForeground(isSelected || node.filtered ? SELECTED : UNSELECTED); in pickChildrenColor()
[all …]
/sdk/layoutopt/libs/uix/src/com/android/layoutopt/uix/
DLayoutAnalysis.java94 public void addIssue(Node node, String description) { in addIssue() argument
95 mIssues.add(new Issue(node, description)); in addIssue()
133 void setCurrentNode(Node node) { in setCurrentNode() argument
134 mNode = node; in setCurrentNode()
164 public Issue(Node node, String description) { in Issue() argument
165 mNode = node; in Issue()
/sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/
DUiModelTreeContentProvider.java50 UiElementNode node = (UiElementNode) parentElement; in getChildren() local
51 return node.getUiChildren().toArray(); in getChildren()
61 UiElementNode node = (UiElementNode) element; in getParent() local
62 return node.getUiParent(); in getParent()
71 UiElementNode node = (UiElementNode) element; in hasChildren() local
72 return node.getUiChildren().size() > 0; in hasChildren()
DUiActions.java148 for (UiElementNode node : nodes) { in doRemove()
150 sb.append(node.getBreadcrumbTrailDescription(false /* include_root */)); in doRemove()
164 UiElementNode node = nodes.get(i); in doRemove()
165 previous = node.getUiPreviousSibling(); in doRemove()
166 parent = node.getUiParent(); in doRemove()
169 node.deleteXmlNode(); in doRemove()
199 final UiElementNode node = last_node = nodes.get(i); in doUp() local
202 search_root = node.getUiParent(); in doUp()
210 Node xml_node = node.getXmlNode(); in doUp()
214 UiElementNode ui_prev = node.getUiPreviousSibling(); in doUp()
[all …]
/sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/
DAttrsXmlParser.java210 for (Node node = res.getFirstChild(); node != null; node = node.getNextSibling()) { in parseResources()
211 switch (node.getNodeType()) { in parseResources()
213 lastComment = node; in parseResources()
216 if (node.getNodeName().equals("declare-styleable")) { //$NON-NLS-1$ in parseResources()
217 Node nameNode = node.getAttributes().getNamedItem("name"); //$NON-NLS-1$ in parseResources()
221 Node parentNode = node.getAttributes().getNamedItem("parent"); //$NON-NLS-1$ in parseResources()
225 DeclareStyleableInfo style = parseDeclaredStyleable(name, node); in parseResources()
235 } else if (node.getNodeName().equals("attr")) { //$NON-NLS-1$ in parseResources()
236 parseAttr(node, lastComment); in parseResources()
286 for (Node node = declareStyleableNode.getFirstChild(); in parseDeclaredStyleable()
[all …]
/sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/parts/
DUiElementTreeEditPartFactory.java39 UiElementNode node = (UiElementNode) model; in createEditPart() local
40 if (node.getDescriptor().hasChildren()) { in createEditPart()
41 return new UiLayoutTreeEditPart(node); in createEditPart()
43 return new UiViewTreeEditPart(node); in createEditPart()

123