Package org.dyno.visual.swing.layouts

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


    int height = drop.getHeight();
    Spring spring = new Spring(10, 10);// TODO should be replaced by a
                      // container gap.
    if (pair == null || pair.vQuart == null) {
      if (horizontal instanceof Leading)
        horizontal = new Leading(x - insets.left, width, spring);
      else if (horizontal instanceof Trailing)
        horizontal = new Leading(x - insets.left, width, spring);
      else if (horizontal instanceof Bilateral)
        horizontal = new Leading(x - insets.left, width, spring);
    } else {
      if (pair.vQuart != null) {
        horizontal = pair.vQuart.anchor.createRightAxis(drop, new Rectangle(x, y, width, height), horizontal);
      }
    }
View Full Code Here


  }

  @Override
  public IStatus execute(IProgressMonitor monitor, IAdaptable info)
      throws ExecutionException {
    Leading leading = (Leading) oldconstraints.getVertical();
    int l = leading.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, child.getHeight(), 10, l));
View Full Code Here

    int height = drop.getHeight();
    Spring spring = new Spring(10, 10);// TODO should be replaced by a
    // container gap.
    if (pair == null) {
      if (horizontal instanceof Leading)
        horizontal = new Leading(x - insets.left, width, spring);
      else if (horizontal instanceof Trailing)
        horizontal = new Trailing(container.getWidth() - x - width - insets.right, width, spring);
      else if (horizontal instanceof Bilateral)
        horizontal = new Trailing(container.getWidth() - x - width - insets.right, width, spring);
      if (vertical instanceof Leading)
        vertical = new Leading(y - insets.top, height, spring);
      else if (vertical instanceof Trailing)
        vertical = new Leading(y - insets.top, height, spring);
      else if (vertical instanceof Bilateral)
        vertical = new Leading(y - insets.top, height, spring);
    } else {
      if (pair.vQuart != null) {
        horizontal = pair.vQuart.anchor.createLeftAxis(drop, new Rectangle(x, y, width, height), horizontal);
      } else {
        if (horizontal instanceof Leading)
          horizontal = new Leading(x - insets.left, width, spring);
        else if (horizontal instanceof Trailing)
          horizontal = new Trailing(container.getWidth() - x - width - insets.right, width, spring);
        else if (horizontal instanceof Bilateral)
          horizontal = new Trailing(container.getWidth() - x - width - insets.right, width, spring);
      }
      if (pair.hQuart != null) {
        vertical = pair.hQuart.anchor.createBottomAxis(drop, new Rectangle(x, y, width, height), vertical);
      } else {
        if (vertical instanceof Leading)
          vertical = new Leading(y - insets.top, height, spring);
        else if (vertical instanceof Trailing)
          vertical = new Leading(y - insets.top, height, spring);
        else if (vertical instanceof Bilateral)
          vertical = new Leading(y - insets.top, height, spring);
      }
    }
    assert horizontal != null && vertical != null;
    Constraints constraints = new Constraints(horizontal, vertical);
    container.add(drop, constraints);
View Full Code Here

    Trailing trailing = (Trailing) oldconstraints.getHorizontal();
    int t = trailing.getTrailing();
    int w = child.getWidth();
    Insets insets = container.getInsets();
    int l = container.getWidth() - insets.left - insets.right - t - w;
    Constraints newconstraints = new Constraints(new Leading(l, 10, t),
        oldconstraints.getVertical());
    container.remove(child);
    container.add(child, newconstraints);
    container.doLayout();
    container.invalidate();
View Full Code Here

    int height = drop.getHeight();
    Spring spring = new Spring(10, 10);// TODO should be replaced by a
                      // container gap.
    if (pair == null || pair.hQuart == null) {
      if (vertical instanceof Leading)
        vertical = new Leading(y - insets.top, height, spring);
      else if (vertical instanceof Trailing)
        vertical = new Leading(y - insets.top, height, spring);
      else if (vertical instanceof Bilateral)
        vertical = new Leading(y - insets.top, height, spring);
    } else {
      if (pair.hQuart != null) {
        vertical = pair.hQuart.anchor.createBottomAxis(drop, new Rectangle(x, y, width, height), vertical);
      }
    }
View Full Code Here

    int height = drop.getHeight();
    Spring spring = new Spring(10, 10);// TODO should be replaced by a
    // container gap.
    if (pair == null) {
      if (horizontal instanceof Leading)
        horizontal = new Leading(x - insets.left, width, spring);
      else if (horizontal instanceof Trailing)
        horizontal = new Leading(x - insets.left, width, spring);
      else if (horizontal instanceof Bilateral)
        horizontal = new Leading(x - insets.left, width, spring);
      if (vertical instanceof Leading)
        vertical = new Leading(y - insets.top, height, spring);
      else if (vertical instanceof Trailing)
        vertical = new Trailing(container.getHeight() - y - height - insets.bottom, height, spring);
      else if (vertical instanceof Bilateral)
        vertical = new Trailing(container.getHeight() - y - height - insets.bottom, height, spring);
    } else {
      if (pair.vQuart != null) {
        horizontal = pair.vQuart.anchor.createRightAxis(drop, new Rectangle(x, y, width, height), horizontal);
      } else {
        if (horizontal instanceof Leading)
          horizontal = new Leading(x - insets.left, width, spring);
        else if (horizontal instanceof Trailing)
          horizontal = new Leading(x - insets.left, width, spring);
        else if (horizontal instanceof Bilateral)
          horizontal = new Leading(x - insets.left, width, spring);
      }
      if (pair.hQuart != null) {
        vertical = pair.hQuart.anchor.createTopAxis(drop, new Rectangle(x, y, width, height), vertical);
      } else {
        if (vertical instanceof Leading)
          vertical = new Leading(y - insets.top, height, spring);
        else if (vertical instanceof Trailing)
          vertical = new Trailing(container.getHeight() - y - height - insets.bottom, height, spring);
        else if (vertical instanceof Bilateral)
          vertical = new Trailing(container.getHeight() - y - height - insets.bottom, height, spring);
      }
View Full Code Here

          constraints = new Constraints(bilateral, constraints.getVertical());
        }
        layout.setConstraints(child, constraints);
      }
    } else if (postAlignment instanceof Leading) {
      Leading postLeading = (Leading) postAlignment;
      int postLead = postLeading.getLeading() + postChild.getWidth();
      for (int i = 1; i < widgets.size(); i++) {
        WidgetAdapter adapter = widgets.get(i);
        Component child = adapter.getWidget();
        Constraints constraints = layout.getConstraints(child);
        CompCons cons = new CompCons();
        cons.component = child;
        cons.constraints = constraints;
        compcons.add(cons);
        Alignment alignment = constraints.getHorizontal();
        if (alignment instanceof Trailing) {
          int l = postLead - child.getWidth();
          Leading trailing = new Leading(l, 10, child.getWidth());
          constraints = new Constraints(trailing,constraints.getVertical());
        } else if (alignment instanceof Bilateral) {
          int l = postLead - child.getWidth();
          Leading leading = new Leading(l, 10, child.getWidth());
          constraints = new Constraints(leading, constraints.getVertical());
        } else if (alignment instanceof Leading) {
          Leading leading = (Leading) alignment.clone();
          leading.setLeading(postLead - child.getWidth());
          constraints = new Constraints(leading, constraints.getVertical());
        }
        layout.setConstraints(child, constraints);
      }
    }
View Full Code Here

  }

  @Override
  public IStatus execute(IProgressMonitor monitor, IAdaptable info)
      throws ExecutionException {
    Leading leading = (Leading) oldconstraints.getHorizontal();
    int l = leading.getLeading();
    int w = child.getWidth();
    Insets insets = container.getInsets();   
    int t = container.getWidth() - insets.left - insets.right - l - w;
    Constraints newconstraints = new Constraints(new Bilateral(l, t, w), oldconstraints.getVertical());
    container.remove(child);
View Full Code Here

        cons.component = child;
        cons.constraints = constraints;
        compcons.add(cons);
        Alignment alignment = constraints.getVertical();
        if (alignment instanceof Leading) {
          Leading leading = (Leading) alignment.clone();
          leading.setLeading(postLead);
          constraints = new Constraints(constraints.getHorizontal(), leading);
        } else if (alignment instanceof Bilateral) {
          Bilateral bilateral = (Bilateral) alignment.clone();
          bilateral.setLeading(postLead);
          constraints = new Constraints(constraints.getHorizontal(), bilateral);
View Full Code Here

    int height = drop.getHeight();
    Spring spring = new Spring(10, 10);// TODO should be replaced by a
                      // container gap.
    if (pair == null || pair.hQuart == null) {
      if (vertical instanceof Leading)
        vertical = new Leading(y - insets.top, height, spring);
      else if (vertical instanceof Trailing)
        vertical = new Trailing(container.getHeight() - y - height - insets.bottom, height, spring);
      else if (vertical instanceof Bilateral)
        vertical = new Trailing(container.getHeight() - y - height - insets.bottom, height, spring);
    } else {
View Full Code Here

TOP

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

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.