Package javax.swing

Examples of javax.swing.SizeRequirements


   *
   * @param harness the test harness to use
   */
  private void test1(TestHarness harness)
  {
    SizeRequirements req1 = new SizeRequirements(282, 282, 282, 0.5F);
    SizeRequirements req2 = new SizeRequirements(599, 599, 2147483647, 0.5F);
    SizeRequirements[] els = new SizeRequirements[]{req1, req2};
    // Only the alignment field of total is used.
    SizeRequirements total = SizeRequirements.getAlignedSizeRequirements(els);
    int[] offsets = new int[2];
    int[] spans = new int[2];
    SizeRequirements.calculateAlignedPositions(112, total, els, offsets, spans);
    harness.check(offsets[0], 0);
    harness.check(offsets[1], 0);
View Full Code Here


              return new ParagraphView(e) {
                @Override
                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
View Full Code Here

        }

        protected SizeRequirements
            calculateMinorAxisRequirements(final int axis,
                                           final SizeRequirements r) {
            SizeRequirements result = super.calculateMinorAxisRequirements(axis,
                                                                           r);
            // This view is not resizable along Y (minor axis)
            result.maximum = result.preferred;
            return result;
        }
View Full Code Here

        protected SizeRequirements
            calculateMajorAxisRequirements(final int axis,
                                           final SizeRequirements r) {

            SizeRequirements result =
                super.calculateMajorAxisRequirements(axis, r);
            result.alignment = getAlignByJustification();
            return result;
        }
View Full Code Here

        protected SizeRequirements
            calculateMinorAxisRequirements(final int axis,
                                           final SizeRequirements r) {

            SizeRequirements result = baselineRequirements(axis, r);
            lineSpace = (int)(result.preferred * lineSpacing);
            return result;
        }
View Full Code Here

    }

    public int getResizeWeight(final int axis) {
        isAxisValid(axis);

        final SizeRequirements sr = getTotalRequirements(axis);
        return sr.minimum == sr.maximum ? 0 : 1;
    }
View Full Code Here

        return SizeRequirementsHelper.getTiledSizeRequirements(sr, r);
    }

    protected SizeRequirements calculateMinorAxisRequirements(final int axis,
            final SizeRequirements r)  {
        final SizeRequirements result = r != null ? r : new SizeRequirements();
        final SizeRequirements[] children = getRequirements(axis);

        int min  = 0;
        int pref = 0;
View Full Code Here

                                  final int axis) {
        for (int i = 0; i < getViewCount(); i++) {
            View child = getView(i);

            if (requirements[i] == null) {
                requirements[i] = new SizeRequirements();
            }

            requirements[i].minimum   = (int)child.getMinimumSpan(axis);
            requirements[i].preferred = (int)child.getPreferredSpan(axis);
            requirements[i].maximum   = (int)child.getMaximumSpan(axis);
View Full Code Here

    }

    protected SizeRequirements
        calculateMinorAxisRequirements(final int axis,
                                       final SizeRequirements sr) {
        SizeRequirements result = sr != null ? sr : new SizeRequirements();
        result.minimum = (int)layoutPool.getMinimumSpan(axis);
        result.preferred = (int)layoutPool.getPreferredSpan(axis);
        result.maximum = Integer.MAX_VALUE;
        result.alignment = ALIGN_CENTER;
        return result;
View Full Code Here

     */
    public static SizeRequirements
        getTiledSizeRequirements(final SizeRequirements[] children,
                                 final SizeRequirements sr) {

        SizeRequirements result = (sr != null) ? sr : new SizeRequirements();
        result.minimum   = 0;
        result.preferred = 0;
        result.maximum   = 0;
        result.alignment = 0.5f;

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.