Package org.dyno.visual.swing.layouts

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


        Leading leading = new Leading(l, child.getHeight(), 10, t);
        constraints = new Constraints(constraints.getHorizontal(), leading);
        layout.setConstraints(child, constraints);
      }
    } else if (postAlignment instanceof Bilateral) {
      Bilateral postBilateral = (Bilateral)postAlignment;
      int postCenter = postBilateral.getLeading() + postChild.getHeight() / 2;
      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);
        int l = postCenter - child.getHeight() / 2;
        int t = innerHeight - postCenter - child.getHeight()/2;
        Bilateral bilateral = new Bilateral(l, t, 10);
        constraints = new Constraints(constraints.getHorizontal(), bilateral);
        layout.setConstraints(child, constraints);
      }
    } else if (postAlignment instanceof Trailing) {
      int postCenter = postChild.getY() + postChild.getHeight()/2 - insets.top;
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 Bilateral(l, t, w),
        oldconstraints.getVertical());
    container.remove(child);
    container.add(child, newconstraints);
    container.doLayout();
    container.invalidate();
View Full Code Here

        if (alignment instanceof Leading) {
          Leading leading = (Leading) alignment.clone();
          leading.setLeading(postLead);
          constraints = new Constraints(leading, constraints.getVertical());
        } else if (alignment instanceof Bilateral) {
          Bilateral bilateral = (Bilateral) alignment.clone();
          bilateral.setLeading(postLead);
          constraints = new Constraints(bilateral, constraints.getVertical());
        } else if (alignment instanceof Trailing) {
          Bilateral bilateral = new Bilateral(postLead, ((Trailing) alignment).getTrailing(), ((Trailing) alignment).getSize());
          constraints = new Constraints(bilateral, constraints.getVertical());
        }
        layout.setConstraints(child, constraints);
      }
    } else if (postAlignment instanceof Trailing) {
View Full Code Here

    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 Bilateral(l, t, 10, h));
    container.remove(child);
    container.add(child, newconstraints);
    container.doLayout();
    container.invalidate();
    WidgetAdapter adapter = WidgetAdapter.getWidgetAdapter(container);
View Full Code Here

        if (alignment instanceof Leading) {
          Leading leading = (Leading) alignment.clone();
          leading.setSize(postSize);
          constraints = new Constraints(constraints.getHorizontal(), leading);
        } else if (alignment instanceof Bilateral) {
          Bilateral bilateral = (Bilateral) alignment;
          int lead = bilateral.getLeading();
          Leading leading = new Leading(lead, postSize, 10, innerHeight - postSize - lead);
          constraints = new Constraints(constraints.getHorizontal(), leading);
        } else if (alignment instanceof Trailing) {
          Trailing trailing = (Trailing) alignment.clone();
          trailing.setSize(postSize);
          constraints = new Constraints(constraints.getHorizontal(), trailing);
        }
        layout.setConstraints(child, constraints);
      }
    } else if (postAlignment instanceof Trailing) {
      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.getVertical();
        if (alignment instanceof Leading) {
          Leading leading = (Leading) alignment.clone();
          leading.setSize(postSize);
          constraints = new Constraints(constraints.getHorizontal(), leading);
        } else if (alignment instanceof Bilateral) {
          Bilateral bilateral = (Bilateral) alignment;
          int trail = bilateral.getTrailing();
          Trailing leading = new Trailing(trail, postSize, 10, innerHeight - postSize - trail);
          constraints = new Constraints(constraints.getHorizontal(), leading);
        } else if (alignment instanceof Trailing) {
          Trailing trailing = (Trailing) alignment.clone();
          trailing.setSize(postSize);
          constraints = new Constraints(constraints.getHorizontal(), trailing);
        }
        layout.setConstraints(child, constraints);
      }
    } else if (postAlignment instanceof Bilateral) {
      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.getVertical();
        if (alignment instanceof Leading) {
          Leading leading = (Leading) alignment;
          Bilateral bilateral = (Bilateral) postAlignment.clone();
          bilateral.setLeading(leading.getLeading());
          bilateral.setTrailing(innerHeight-leading.getLeading()-child.getHeight());
          constraints = new Constraints(constraints.getHorizontal(), bilateral);
        } else if (alignment instanceof Bilateral) {
          Bilateral leading = (Bilateral) alignment;
          Bilateral bilateral = (Bilateral) postAlignment.clone();
          bilateral.setTrailing(leading.getTrailing());
          bilateral.setLeading(leading.getLeading());
          constraints = new Constraints(constraints.getHorizontal(), bilateral);
        } else if (alignment instanceof Trailing) {
          Trailing trailing = (Trailing) alignment;
          Bilateral bilateral = (Bilateral) postAlignment.clone();
          bilateral.setTrailing(trailing.getTrailing());
          bilateral.setLeading(innerHeight-trailing.getTrailing()-child.getHeight());
          constraints = new Constraints(constraints.getHorizontal(), bilateral);
        }
        layout.setConstraints(child, constraints);
      }
    }
View Full Code Here

  }

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

        Leading leading = new Leading(l, child.getWidth(), 10, t);
        constraints = new Constraints(leading, constraints.getVertical());
        layout.setConstraints(child, constraints);
      }
    } else if (postAlignment instanceof Bilateral) {
      Bilateral postBilateral = (Bilateral) postAlignment;
      int postCenter = postBilateral.getLeading() + postChild.getWidth() / 2;
      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);
        int l = postCenter - child.getWidth() / 2;
        int t = innerWidth - postCenter - child.getWidth()/2;
        Bilateral bilateral = new Bilateral(l, t, 10);
        constraints = new Constraints(bilateral, constraints.getVertical());
        layout.setConstraints(child, constraints);
      }
    } else if (postAlignment instanceof Trailing) {
      int postCenter = postChild.getX() + postChild.getWidth() / 2 - insets.left;
View Full Code Here

  }

  @Override
  public IStatus execute(IProgressMonitor monitor, IAdaptable info)
      throws ExecutionException {
    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 Leading(l, 10, t));
View Full Code Here

  }

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

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

TOP

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

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.