Package org.dyno.visual.swing.layouts

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


    Point hot = dropAdapter.getHotspotPoint();
    Spring spring = new Spring(10, 10);// TODO should be replaced by a
    // container gap.
    if (pair == null) {
      Point np = new Point(p.x - hot.x, p.y - hot.y);
      Constraints constraints = new Constraints(new Leading(np.x
          - insets.left, drop.getWidth(), spring), new Leading(np.y
          - insets.top, drop.getHeight(), spring));
      container.add(drop, constraints);
    } else {
      Alignment horizontal = null;
      Alignment vertical = null;
      if (pair.hQuart == null && pair.vQuart != null) {
        int x = pair.vQuart.masc - hot.x;
        int y = p.y - hot.y;
        int width = drop.getWidth();
        int height = drop.getHeight();
        vertical = new Leading(y - insets.top, height, spring);
        horizontal = pair.vQuart.anchor.createHoveredAxis(drop,
            new Rectangle(x, y, width, height));
      } else if (pair.hQuart != null && pair.vQuart == null) {
        int x = p.x - hot.x;
        int y = pair.hQuart.masc - hot.y;
        int width = drop.getWidth();
        int height = drop.getHeight();
        horizontal = new Leading(x - insets.left, width, spring);
        vertical = pair.hQuart.anchor.createHoveredAxis(drop,
            new Rectangle(x, y, width, height));
      } else if (pair.hQuart != null && pair.vQuart != null) {
        int x = pair.vQuart.masc - hot.x;
        int y = pair.hQuart.masc - hot.y;
        int width = drop.getWidth();
        int height = drop.getHeight();
        vertical = pair.hQuart.anchor.createHoveredAxis(drop,
            new Rectangle(x, y, width, height));
        horizontal = pair.vQuart.anchor.createHoveredAxis(drop,
            new Rectangle(x, y, width, height));
      }
      assert vertical != null && horizontal != null;
      Constraints constraints = new Constraints(horizontal, vertical);
      container.add(drop, constraints);
    }
    last_point = null;
    return true;
  }
View Full Code Here


  @Override
  public Alignment createHoveredAxis(Component me, Rectangle bounds) {
    Container parent = target.getParent();
    GroupLayout layout = (GroupLayout) parent.getLayout();
    Constraints constraints = layout.getConstraints(target);
    Alignment horizontal = constraints.getHorizontal();
    if (horizontal instanceof Leading) {
      return createHorizontalLeading(me, bounds, parent);
    } else if (horizontal instanceof Trailing) {
      return createHorizontalTrailing(me, bounds, parent);
    } else if (horizontal instanceof Bilateral) {
View Full Code Here

  @Override
  public Alignment createRightAxis(Component me, Rectangle bounds, Alignment lastAxis) {
    Container parent = target.getParent();
    GroupLayout layout = (GroupLayout) parent.getLayout();
    Constraints constraints = layout.getConstraints(target);
    Alignment horizontal = constraints.getHorizontal();
    if (lastAxis instanceof Leading) {
      if (horizontal instanceof Leading) {
        return createHorizontalLeading(me, bounds, parent);
      } else if (horizontal instanceof Trailing) {
        return createHorizontalSpring(me, bounds, parent);
View Full Code Here

  @Override
  public Alignment createLeftAxis(Component me, Rectangle bounds, Alignment lastAxis) {
    Container parent = target.getParent();
    GroupLayout layout = (GroupLayout) parent.getLayout();
    Constraints constraints = layout.getConstraints(target);
    Alignment horizontal = constraints.getHorizontal();
    if (horizontal instanceof Leading) {
      return createHorizontalLeading(me, bounds, parent);
    } else if (horizontal instanceof Trailing) {
      return createHorizontalTrailing(me, bounds, parent);
    } else if (horizontal instanceof Bilateral) {
View Full Code Here

  @Override
  public Alignment createHoveredAxis(Component me, Rectangle bounds) {
    Container parent = target.getParent();
    GroupLayout layout = (GroupLayout) parent.getLayout();
    Constraints constraints = layout.getConstraints(target);
    Alignment horizontal = constraints.getHorizontal();
    if (horizontal instanceof Leading) {
      return createHorizontalLeading(me, bounds, parent);
    } else if (horizontal instanceof Trailing) {
      return createHorizontalTrailing(me, bounds, parent);
    } else if (horizontal instanceof Bilateral) {
View Full Code Here

  @Override
  public Alignment createLeftAxis(Component me, Rectangle bounds, Alignment lastAxis) {
    Container parent = target.getParent();
    GroupLayout layout = (GroupLayout) parent.getLayout();
    Constraints constraints = layout.getConstraints(target);
    Alignment horizontal = constraints.getHorizontal();
    if (horizontal instanceof Leading) {
      if (lastAxis instanceof Leading) {
        return createHorizontalLeading(me, bounds, parent);
      } else if (lastAxis instanceof Trailing) {
        return createHorizontalSpring(me, bounds, parent);
View Full Code Here

  @Override
  public Alignment createHoveredAxis(Component me, Rectangle bounds) {
    Container parent = target.getParent();
    GroupLayout layout = (GroupLayout) parent.getLayout();
    Constraints constraints = layout.getConstraints(target);
    Alignment vertical = constraints.getVertical();
    if (vertical instanceof Leading) {
      return createVerticalLeading(me, bounds, parent);
    } else if (vertical instanceof Trailing) {
      return createVerticalTrailing(me, bounds, parent);
    } else if (vertical instanceof Bilateral) {
View Full Code Here

  @Override
  public Alignment createBottomAxis(Component me, Rectangle bounds, Alignment lastAxis) {
    Container parent = target.getParent();
    GroupLayout layout = (GroupLayout) parent.getLayout();
    Constraints constraints = layout.getConstraints(target);
    Alignment vertical = constraints.getVertical();
    if (vertical instanceof Leading) {
      return createVerticalLeading(me, bounds, parent);
    } else if (vertical instanceof Trailing) {
      return createVerticalTrailing(me, bounds, parent);
    } else if (vertical instanceof Bilateral) {
View Full Code Here

  @Override
  public Alignment createTopAxis(Component me, Rectangle bounds, Alignment lastAxis) {
    Container parent = target.getParent();
    GroupLayout layout = (GroupLayout) parent.getLayout();
    Constraints constraints = layout.getConstraints(target);
    Alignment vertical = constraints.getVertical();
    if (vertical instanceof Leading) {
      if (lastAxis instanceof Leading)
        return createVerticalLeading(me, bounds, parent);
      else if (lastAxis instanceof Trailing)
        return createVerticalSpring(me, bounds, parent);
View Full Code Here

  @Override
  public Alignment createHoveredAxis(Component me, Rectangle bounds) {
    Container parent = target.getParent();
    GroupLayout layout = (GroupLayout) parent.getLayout();
    Constraints tgtCons = layout.getConstraints(target);
    Alignment vertical = tgtCons.getVertical();
    if (vertical instanceof Leading) {
      return createVerticalLeading(me, bounds, parent);
    } else if (vertical instanceof Trailing) {
      return createVerticalTrailing(me, bounds, parent);
    } else if (vertical instanceof Bilateral) {
View Full Code Here

TOP

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

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.