Android Open Source - CalWatch Cl Edit Or Stay Constraint

From Project

Back to project page CalWatch.


The source code is released under:

GNU General Public License

If you think the Android project CalWatch listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

// $Id:,v 1.11 1999/04/20 00:26:30 gjb Exp $
///*w w  w.  jav  a2s .  c  om*/
// Cassowary Incremental Constraint Solver
// Original Smalltalk Implementation by Alan Borning
// This Java Implementation by Greg J. Badros, <>
// (C) 1998, 1999 Greg J. Badros and Alan Borning
// See ../LICENSE for legal details regarding this software
// ClEditOrStayConstraint

package EDU.Washington.grad.gjb.cassowary;

abstract class ClEditOrStayConstraint extends ClConstraint

  public ClEditOrStayConstraint(ClVariable var,
        ClStrength strength,
        double weight)
    super(strength, weight);
    _variable = var;
    _expression = new ClLinearExpression(_variable, -1.0, _variable.value());

  public ClEditOrStayConstraint(ClVariable var,
        ClStrength strength)

  public ClEditOrStayConstraint(ClVariable var)
    _variable = var;
  public ClVariable variable()
    { return  _variable; }

  public ClLinearExpression expression()
    { return _expression; }

  private void setVariable(ClVariable v)
    { _variable = v; }

  protected ClVariable  _variable;
  // cache the expresion
  private ClLinearExpression _expression;


Java Source Code List