Package javax.swing

Examples of javax.swing.SizeRequirements


        // The major axis requirements for a row are dictated by the column
        // requirements. These methods use the value calculated by
        // TableView.
        protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements r) {
            SizeRequirements req = new SizeRequirements();
            req.minimum = totalColumnRequirements.minimum;
            req.maximum = totalColumnRequirements.maximum;
            req.preferred = totalColumnRequirements.preferred;
            req.alignment = 0f;
            return req;
View Full Code Here


        max = Math.max((int) v.getMaximumSpan(axis), max);
    }
      }

      if (r == null) {
    r = new SizeRequirements();
    r.alignment = 0.5f;
      }
      r.preferred = (int) pref;
      r.minimum = (int) min;
      r.maximum = (int) max;
View Full Code Here

   * @param r the requirements to fill in.  If null, a new one
   *  should be allocated.
   */
        protected SizeRequirements calculateMajorAxisRequirements(int axis,
                  SizeRequirements r) {
      SizeRequirements req = super.calculateMajorAxisRequirements(axis, r);
      req.maximum = Integer.MAX_VALUE;
      return req;
  }
View Full Code Here

      return req;
  }

        @Override
        protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r) {
            SizeRequirements rv = super.calculateMinorAxisRequirements(axis, r);
            //for the cell the minimum should be derived from the child views
            //the parent behaviour is to use CSS for that
            int n = getViewCount();
            int min = 0;
            for (int i = 0; i < n; i++) {
View Full Code Here

        @Override       
        protected SizeRequirements calculateMajorAxisRequirements(int axis,
                SizeRequirements r) {
            int oldJustficationData[] = justificationData;
            justificationData = null;
            SizeRequirements ret = super.calculateMajorAxisRequirements(axis, r);
            if (isJustifyEnabled()) {
                justificationData = oldJustficationData;
            }
            return ret;
        }
View Full Code Here

     * CSS width or height attribute is specified and applicable to
     * the axis.
     */
    protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements r) {
  if (r == null) {
      r = new SizeRequirements();
  }
  if (! spanSetFromAttributes(axis, r, cssWidth, cssHeight)) {
      r = super.calculateMajorAxisRequirements(axis, r);
  }
        else {
            // Offset by the margins so that pref/min/max return the
            // right value.
            SizeRequirements parentR = super.calculateMajorAxisRequirements(
                                      axis, null);
            int margin = (axis == X_AXIS) ? getLeftInset() + getRightInset() :
                                            getTopInset() + getBottomInset();
            r.minimum -= margin;
            r.preferred -= margin;
View Full Code Here

     * CSS width or height attribute is specified and applicable to
     * the axis.
     */
    protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r) {
  if (r == null) {
      r = new SizeRequirements();
  }

  if (! spanSetFromAttributes(axis, r, cssWidth, cssHeight)) {

      /*
       * The requirements were not directly specified by attributes, so
       * compute the aggregate of the requirements of the children.  The
       * children that have a percentage value specified will be treated
       * as completely stretchable since that child is not limited in any
       * way.
       */
/*
      int min = 0;
      long pref = 0;
      int max = 0;
      int n = getViewCount();
      for (int i = 0; i < n; i++) {
    View v = getView(i);
    min = Math.max((int) v.getMinimumSpan(axis), min);
    pref = Math.max((int) v.getPreferredSpan(axis), pref);
    if (
    max = Math.max((int) v.getMaximumSpan(axis), max);

      }
      r.preferred = (int) pref;
      r.minimum = min;
      r.maximum = max;
      */
      r = super.calculateMinorAxisRequirements(axis, r);
  }
        else {
            // Offset by the margins so that pref/min/max return the
            // right value.
            SizeRequirements parentR = super.calculateMinorAxisRequirements(
                                      axis, null);
            int margin = (axis == X_AXIS) ? getLeftInset() + getRightInset() :
                                            getTopInset() + getBottomInset();
            r.minimum -= margin;
            r.preferred -= margin;
View Full Code Here

  preferred += totalSpacing;
  maximum += totalSpacing;

  // set return value
  if (r == null) {
      r = new SizeRequirements();
  }
  r.minimum = (minimum > Integer.MAX_VALUE) ? Integer.MAX_VALUE : (int)minimum;
  r.preferred = (preferred > Integer.MAX_VALUE) ? Integer.MAX_VALUE :(int) preferred;
  r.maximum = (maximum > Integer.MAX_VALUE) ? Integer.MAX_VALUE :(int) maximum;
  return r;
View Full Code Here

     * view by calling getMinimumSpan, getPreferredSpan, and
     * getMaximumSpan on it. 
     */
    protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r) {
  if (r == null) {
      r = new SizeRequirements();
  }
  float pref = layoutPool.getPreferredSpan(axis);
  float min = layoutPool.getMinimumSpan(axis);
        // Don't include insets, Box.getXXXSpan will include them.
  r.minimum = (int)min;
View Full Code Here

      pref += v.getPreferredSpan(axis);
      max += v.getMaximumSpan(axis);
  }

  if (r == null) {
      r = new SizeRequirements();
  }
  r.alignment = 0.5f;
  r.minimum = (int) min;
  r.preferred = (int) pref;
  r.maximum = (int) max;
View Full Code Here

TOP

Related Classes of javax.swing.SizeRequirements

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.