Package org.dyno.visual.swing.layouts

Examples of org.dyno.visual.swing.layouts.Spring


    int gap = layoutStyle.getContainerGap((JComponent) me, SwingConstants.NORTH, parent);
    if (gap > min)
      min = gap;
    if (gap > pref)
      pref = gap;
    Spring spring = new Spring(min, pref);
    Insets insets = parent.getInsets();
    int h = parent.getHeight();
    return new Trailing(h - bounds.y - bounds.height - insets.bottom, bounds.height, spring);
  }
View Full Code Here


  protected Alignment createVerticalSpring(Component me, Rectangle bounds, Container parent) {
    int h = parent.getHeight();
    Insets insets = parent.getInsets();
    int min = me.getMinimumSize().height;
    int pref = me.getPreferredSize().height;
    Spring spring = new Spring(min, pref);
    return new Bilateral(bounds.y - insets.top, h - bounds.y - bounds.height - insets.bottom, spring);
  }
View Full Code Here

    int gap = layoutStyle.getContainerGap((JComponent) me, SwingConstants.EAST, parent);
    if (gap > min)
      min = gap;
    if (gap > pref)
      pref = gap;
    Spring spring = new Spring(min, pref);
    Insets insets = parent.getInsets();
    return new Leading(bounds.x - insets.left, bounds.width, spring);
  }
View Full Code Here

    int gap = layoutStyle.getContainerGap((JComponent) me, SwingConstants.WEST, parent);
    if (gap > min)
      min = gap;
    if (gap > pref)
      pref = gap;
    Spring spring = new Spring(min, pref);
    Insets insets = parent.getInsets();
    int w = parent.getWidth();
    return new Trailing(w - bounds.x - bounds.width - insets.right, bounds.width, spring);
  }
View Full Code Here

  protected Alignment createHorizontalSpring(Component me, Rectangle bounds, Container parent) {
    int w = parent.getWidth();
    Insets insets = parent.getInsets();
    int min = me.getMinimumSize().width;
    int pref = me.getPreferredSize().width;
    Spring spring = new Spring(min, pref);
    return new Bilateral(bounds.x - insets.left, w - bounds.x - bounds.width - insets.right, spring);
  }
View Full Code Here

    LayoutStyle style = LayoutStyle.getInstance();
    for (int i = 0; i < count; i++) {
      JComponent widget = (JComponent) container.getComponent(i);
      int gap = style.getContainerGap(widget, SwingConstants.EAST, container);
      Rectangle bounds = widget.getBounds();
      Spring spring = new Spring(gap, gap);
      Leading horizontal = new Leading(bounds.x, bounds.width, spring);
      gap = style.getContainerGap(widget, SwingConstants.SOUTH, container);
      spring = new Spring(gap, gap);
      Leading vertical = new Leading(bounds.y, bounds.height, spring);
      Constraints constraints = new Constraints(horizontal, vertical);
      comps.put(widget, constraints);
      array.add(widget);
    }
View Full Code Here

TOP

Related Classes of org.dyno.visual.swing.layouts.Spring

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.