Lines Matching refs:constraint
42 import com.android.ide.common.layout.relative.DependencyGraph.Constraint;
62 * Paints a given match as a constraint.
77 * Paints a constraint.
83 * @param constraint The constraint to be drawn
85 private static void paintConstraint(IGraphics graphics, Constraint constraint,
86 Set<Constraint> allConstraints) {
87 ViewData source = constraint.from;
88 ViewData target = constraint.to;
99 paintConstraint(graphics, constraint.type, sourceNode, sourceBounds, targetNode,
152 private static void paintConstraints(IGraphics graphics, List<Constraint> constraints) {
153 Set<Constraint> mutableConstraintSet = new HashSet<Constraint>(constraints);
156 // constraint; this is because we also *add* alignBottom attachments when you add
159 for (Constraint constraint : constraints) {
160 if (constraint.type == ALIGN_BASELINE) {
162 for (Constraint c : constraints) {
163 if (c.type == ALIGN_BOTTOM && c.to.node == constraint.to.node) {
170 for (Constraint constraint : constraints) {
171 // paintConstraint can digest more than one constraint, so we need to keep
172 // checking to see if the given constraint is still relevant.
173 if (mutableConstraintSet.contains(constraint)) {
174 paintConstraint(graphics, constraint, mutableConstraintSet);
180 * Paints a constraint of the given type from the given source node, to the
185 Set<Constraint> allConstraints, boolean highlightTargetEdge) {
192 // Horizontal center constraint?
198 // Vertical center constraint?
204 // Corner constraint?
214 // Vertical constraint?
221 // Horizontal constraint?
228 // This shouldn't happen - it means we have a constraint that defines all sides
229 // and is not a centering constraint
234 * Paints a corner constraint, or returns false if this constraint is not a corner.
268 * @param type the constraint to be drawn
274 * matching corner constraint is removed from the set
275 * @return true if the constraint was handled and painted as a corner, false otherwise
279 Set<Constraint> allConstraints) {
301 Constraint pair = null;
302 for (Constraint constraint : allConstraints) {
303 if ((constraint.type == opposite1 || constraint.type == opposite2) &&
304 constraint.to.node == targetNode && constraint.from.node == sourceNode) {
305 pair = constraint;
314 // Visualize the corner constraint
353 // Don't process this constraint on its own later.
363 * Paints a vertical constraint, handling the various scenarios where there are
366 * Here's an example of what will be shown for a "below" constraint where the
477 // When the constraint is for two immediately adjacent edges, we
607 * Paints a horizontal constraint, handling the various scenarios where there are margins,
757 * Paints a vertical center constraint. The constraint is shown as a dashed line
771 * Paints a horizontal center constraint. The constraint is shown as a dashed line