Package org.dyno.visual.swing.layouts

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


    Bilateral bilateral = (Bilateral) oldconstraints.getVertical();
    int l = bilateral.getLeading();
    int h = child.getHeight();
    Insets insets = container.getInsets();
    int t = container.getHeight() - insets.top - insets.bottom - l - h;
    Constraints newconstraints = new Constraints(oldconstraints.getHorizontal(), new Trailing(t, 10, l));
    container.remove(child);
    container.add(child, newconstraints);
    container.doLayout();
    container.invalidate();
    WidgetAdapter adapter = WidgetAdapter.getWidgetAdapter(container);
View Full Code Here


        Alignment vertical = constraints.getVertical();
        Dimension prefs = target.getPreferredSize();
        Dimension mins = target.getMinimumSize();
        if (vertical instanceof Trailing) {
          int gap = layoutStyle.getPreferredGap((JComponent) target, (JComponent) me, ComponentPlacement.UNRELATED, SwingConstants.NORTH, parent);
          Trailing trailing = (Trailing) vertical;
          int pref_size = trailing.getSize() == Alignment.PREFERRED ? prefs.height : trailing.getSize();
          int min_size = pref_size > mins.height ? mins.height : pref_size;
          int actual = gap + min_size + trailing.getTrailing();
          if (actual > min)
            min = actual;
          actual = gap + pref_size + trailing.getTrailing();
          if (actual > pref)
            pref = actual;
        } else if (vertical instanceof Bilateral) {
          int gap = layoutStyle.getPreferredGap((JComponent) target, (JComponent) me, ComponentPlacement.RELATED, SwingConstants.NORTH, parent);
          Bilateral bilateral = (Bilateral) vertical;
View Full Code Here

    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

        Alignment horizontal = constraints.getHorizontal();
        Dimension prefs = target.getPreferredSize();
        Dimension mins = target.getMinimumSize();
        if (horizontal instanceof Trailing) {
          int gap = layoutStyle.getPreferredGap((JComponent) target, (JComponent) me, ComponentPlacement.UNRELATED, SwingConstants.WEST, parent);
          Trailing trailing = (Trailing) horizontal;
          int pref_size = trailing.getSize() == Alignment.PREFERRED ? prefs.width : trailing.getSize();
          int min_size = pref_size > mins.width ? mins.width : pref_size;
          int actual = gap + min_size + trailing.getTrailing();
          if (actual > min)
            min = actual;
          actual = gap + pref_size + trailing.getTrailing();
          if (actual > pref)
            pref = actual;
        } else if (horizontal instanceof Bilateral) {
          int gap = layoutStyle.getPreferredGap((JComponent) target, (JComponent) me, ComponentPlacement.RELATED, SwingConstants.WEST, parent);
          Bilateral bilateral = (Bilateral) horizontal;
View Full Code Here

    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

          container.doLayout();
          container.validate();
        }
      }
    } else if (horizontal instanceof Trailing) {
      Trailing trailing = (Trailing) horizontal;
      if (trailing.getSize() == Alignment.PREFERRED) {
        int now_width = widget.getWidth();
        int pref_width = widget.getPreferredSize().width;
        int delta_width = pref_width - now_width;
        if (delta_width != 0) {
          adjustHorizontalTrailingBy(widget, delta_width);
          container.doLayout();
          container.validate();
        }
      } else {
        int delta_width = trailing.getSize() - widget.getWidth();
        if (delta_width != 0) {
          adjustHorizontalTrailingBy(widget, delta_width);
          container.doLayout();
          container.validate();
        }
      }
    }

    Alignment vertical = constraints.getVertical();
    if (vertical instanceof Leading) {
      Leading leading = (Leading) vertical;
      if (leading.getSize() == Alignment.PREFERRED) {
        int now_height = widget.getHeight();
        int pref_height = widget.getPreferredSize().height;
        int delta_height = pref_height - now_height;
        if (delta_height != 0) {
          adjustVerticalLeadingBy(widget, delta_height);
          container.doLayout();
          container.validate();
        }
      } else {
        int delta_height = leading.getSize() - widget.getHeight();
        if (delta_height != 0) {
          adjustVerticalLeadingBy(widget, delta_height);
          container.doLayout();
          container.validate();
        }
      }
    } else if (vertical instanceof Trailing) {
      Trailing trailing = (Trailing) vertical;
      if (trailing.getSize() == Alignment.PREFERRED) {
        int now_height = widget.getHeight();
        int pref_height = widget.getPreferredSize().height;
        int delta_height = pref_height - now_height;
        if (delta_height != 0) {
          adjustVerticalTrailingBy(widget, delta_height);
          container.doLayout();
          container.validate();
        }
      } else {
        int delta_height = trailing.getSize() - widget.getHeight();
        if (delta_height != 0) {
          adjustVerticalTrailingBy(widget, delta_height);
          container.doLayout();
          container.validate();
        }
View Full Code Here

      if (target != widget) {
        if (isTopRelatedTo((JComponent) target, (JComponent) widget)) {
          Constraints constraints = layout.getConstraints(target);
          Alignment vertical = constraints.getHorizontal();
          if (vertical instanceof Trailing) {
            Trailing leading = (Trailing) vertical;
            leading.setTrailing(leading.getTrailing() + delta_height);
            adjustVerticalTrailingBy(target, delta_height);
          } else if (vertical instanceof Bilateral) {
            Bilateral spring = (Bilateral) vertical;
            spring.setTrailing(spring.getTrailing() + delta_height);
          }
View Full Code Here

      if (target != widget) {
        if (isLeftRelatedTo((JComponent) target, (JComponent) widget)) {
          Constraints constraints = layout.getConstraints(target);
          Alignment horizontal = constraints.getHorizontal();
          if (horizontal instanceof Trailing) {
            Trailing leading = (Trailing) horizontal;
            leading.setTrailing(leading.getTrailing() + delta_width);
            adjustHorizontalTrailingBy(target, delta_width);
          } else if (horizontal instanceof Bilateral) {
            Bilateral spring = (Bilateral) horizontal;
            spring.setTrailing(spring.getTrailing() + delta_width);
          }
View Full Code Here

  private void initComponents() {
    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    setLayout(new GroupLayout());
    add(getJLabel0(), new Constraints(new Leading(12, 12, 12), new Leading(12, 12, 12)));
    add(getJTextField0(), new Constraints(new Bilateral(123, 82, 4), new Leading(10, 12, 12)));
    add(getBrowseOldRoot(), new Constraints(new Trailing(12, 129, 129), new Leading(8, 12, 12)));
    add(getJLabel1(), new Constraints(new Leading(12, 100, 100), new Leading(38, 12, 12)));
    add(getJTextField1(), new Constraints(new Bilateral(123, 82, 6), new Leading(35, 12, 12)));
    add(getBrowseNewRoot(), new Constraints(new Trailing(12, 131, 131), new Leading(34, 12, 12)));
    add(getExecuteDiffCount(), new Constraints(new Trailing(12, 12, 12), new Leading(63, 12, 12)));
    add(getJScrollPane0(), new Constraints(new Bilateral(12, 12, 23), new Bilateral(90, 12, 23)));
    setSize(475, 258);
  }
View Full Code Here

TOP

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

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.