Lines Matching defs:Constraint
55 /** Format to chain constraint dependencies: button 1 above button2 etc */
71 // the parent id from a constraint, only via parent-relative params
101 Constraint constraint = new Constraint(type, view, parentView);
102 view.dependsOn.add(constraint);
103 parentView.dependedOnBy.add(constraint);
106 // id-based constraint.
117 Constraint constraint = new Constraint(type, view, target);
118 view.dependsOn.add(constraint);
119 target.dependedOnBy.add(constraint);
188 for (Constraint constraint : view.dependedOnBy) {
189 if (vertical && !constraint.type.verticalEdge) {
191 } else if (!vertical && !constraint.type.horizontalEdge) {
195 assert constraint.to == view;
196 ViewData from = constraint.from;
199 List<Constraint> path = getPathTo(start.node, view.node, vertical);
203 System.out.println(Constraint.describePath(path, null, null));
213 public List<Constraint> getPathTo(INode from, INode to, boolean vertical) {
217 List<Constraint> path = new ArrayList<Constraint>();
226 private List<Constraint> findForwards(ViewData view, Set<ViewData> visiting,
227 List<Constraint> path, boolean vertical, INode target) {
230 for (Constraint constraint : view.dependsOn) {
231 if (vertical && !constraint.type.verticalEdge) {
233 } else if (!vertical && !constraint.type.horizontalEdge) {
238 path.add(constraint);
240 if (constraint.to.node == target) {
241 return new ArrayList<Constraint>(path);
244 assert constraint.from == view;
245 ViewData to = constraint.to;
251 List<Constraint> chain = findForwards(to, visiting, path, vertical, target);
256 path.remove(constraint);
272 public final List<Constraint> dependsOn = new ArrayList<Constraint>(4);
273 public final List<Constraint> dependedOnBy = new ArrayList<Constraint>(8);
282 * Info about a specific constraint between two widgets in a relative layout. This is
285 static class Constraint {
295 Constraint(ConstraintType type, ViewData from, ViewData to) {
301 static String describePath(List<Constraint> path, String newName, String newId) {
304 Constraint constraint = path.get(i);
305 String suffix = (i == path.size() -1) ? constraint.to.id : s;
306 s = String.format(DEPENDENCY_FORMAT, constraint.from.id,
307 stripLayoutAttributePrefix(constraint.type.name), suffix);