src/share/classes/javax/swing/Spring.java

Print this page




  92  *
  93  *  <pre>
  94  *      X - Y = X + (-Y)
  95  *
  96  *      min(X, Y) = -max(-X, -Y)
  97  *  </pre>
  98  *  <p>
  99  *  For the static methods in this class that embody the arithmetic
 100  *  operators, we do not actually perform the operation in question as
 101  *  that would snapshot the values of the properties of the method's arguments
 102  *  at the time the static method is called. Instead, the static methods
 103  *  create a new <code>Spring</code> instance containing references to
 104  *  the method's arguments so that the characteristics of the new spring track the
 105  *  potentially changing characteristics of the springs from which it
 106  *  was made. This is a little like the idea of a <em>lazy value</em>
 107  *  in a functional language.
 108  * <p>
 109  * If you are implementing a <code>SpringLayout</code> you
 110  * can find further information and examples in
 111  * <a
 112  href="http://docs.oracle.com/javase/tutorial/uiswing/layout/spring.html">How to Use SpringLayout</a>,
 113  * a section in <em>The Java Tutorial.</em>
 114  * <p>
 115  * <strong>Warning:</strong>
 116  * Serialized objects of this class will not be compatible with
 117  * future Swing releases. The current serialization support is
 118  * appropriate for short term storage or RMI between applications running
 119  * the same version of Swing.  As of 1.4, support for long term storage
 120  * of all JavaBeans&trade;
 121  * has been added to the <code>java.beans</code> package.
 122  * Please see {@link java.beans.XMLEncoder}.
 123  *
 124  * @see SpringLayout
 125  * @see SpringLayout.Constraints
 126  *
 127  * @author      Philip Milne
 128  * @since       1.4
 129  */
 130 public abstract class Spring {
 131 
 132     /**




  92  *
  93  *  <pre>
  94  *      X - Y = X + (-Y)
  95  *
  96  *      min(X, Y) = -max(-X, -Y)
  97  *  </pre>
  98  *  <p>
  99  *  For the static methods in this class that embody the arithmetic
 100  *  operators, we do not actually perform the operation in question as
 101  *  that would snapshot the values of the properties of the method's arguments
 102  *  at the time the static method is called. Instead, the static methods
 103  *  create a new <code>Spring</code> instance containing references to
 104  *  the method's arguments so that the characteristics of the new spring track the
 105  *  potentially changing characteristics of the springs from which it
 106  *  was made. This is a little like the idea of a <em>lazy value</em>
 107  *  in a functional language.
 108  * <p>
 109  * If you are implementing a <code>SpringLayout</code> you
 110  * can find further information and examples in
 111  * <a
 112  href="https://docs.oracle.com/javase/tutorial/uiswing/layout/spring.html">How to Use SpringLayout</a>,
 113  * a section in <em>The Java Tutorial.</em>
 114  * <p>
 115  * <strong>Warning:</strong>
 116  * Serialized objects of this class will not be compatible with
 117  * future Swing releases. The current serialization support is
 118  * appropriate for short term storage or RMI between applications running
 119  * the same version of Swing.  As of 1.4, support for long term storage
 120  * of all JavaBeans&trade;
 121  * has been added to the <code>java.beans</code> package.
 122  * Please see {@link java.beans.XMLEncoder}.
 123  *
 124  * @see SpringLayout
 125  * @see SpringLayout.Constraints
 126  *
 127  * @author      Philip Milne
 128  * @since       1.4
 129  */
 130 public abstract class Spring {
 131 
 132     /**