Examples of LayoutConstraint


Examples of org.eclipse.gmf.runtime.notation.LayoutConstraint

  private String name = null;
  private int xPos = 0, yPos = 0;

  public Clazz(Node node) {
    this.node = node;
    LayoutConstraint layout = node.getLayoutConstraint();
    if (!(layout instanceof Location))
      // TODO
      throw new RuntimeException("wrong layout constrait"); //$NON-NLS-1$
    Location location = (Location) layout;
    EObject eObject = node.getElement();
View Full Code Here

Examples of org.geomajas.plugin.printing.component.LayoutConstraint

    this("Legend");
  }

  public LegendComponentImpl(String title) {
    this.title = title;
    setConstraint(new LayoutConstraint(LayoutConstraint.RIGHT, LayoutConstraint.BOTTOM,
        LayoutConstraint.FLOW_Y, 0, 0, 20, 20));
    LabelComponentImpl titleLabel = new LabelComponentImpl();
    titleLabel.getConstraint().setAlignmentX(LayoutConstraint.CENTER);
    titleLabel.getConstraint().setMarginY(5);
    titleLabel.setTextOnly(true);
View Full Code Here

Examples of org.geomajas.plugin.printing.component.LayoutConstraint

@Component()
@Scope(value = "prototype")
public class LegendItemComponentImpl extends AbstractPrintComponent<LegendItemComponentInfo> {

  public LegendItemComponentImpl() {
    setConstraint(new LayoutConstraint(LayoutConstraint.LEFT, LayoutConstraint.BOTTOM,
        LayoutConstraint.FLOW_X, 0, 0, 5, 5));
  }
View Full Code Here

Examples of org.geomajas.plugin.printing.component.LayoutConstraint

    setConstraint(new LayoutConstraint(LayoutConstraint.LEFT, LayoutConstraint.BOTTOM,
        LayoutConstraint.FLOW_X, 0, 0, 5, 5));
  }

  public LegendItemComponentImpl(FeatureStyleInfo def, String label, LayerType layerType, Font font) {
    setConstraint(new LayoutConstraint(LayoutConstraint.LEFT, LayoutConstraint.BOTTOM,
        LayoutConstraint.FLOW_X, 0, 0, 5, 5));
    LegendIconComponentImpl icon = new LegendIconComponentImpl();
    icon.setLabel(label);
    icon.setStyleInfo(def);
    icon.setLayerType(layerType);
View Full Code Here

Examples of org.geomajas.plugin.printing.component.LayoutConstraint

  public PrintComponentImpl() {
    this("");
  }

  public PrintComponentImpl(String id) {
    this(id, new LayoutConstraint());
  }
View Full Code Here

Examples of org.geomajas.plugin.printing.component.LayoutConstraint

  public void setConstraint(LayoutConstraint constraint) {
    this.constraint = constraint;
  }

  private void layoutChild(PrintComponent<?> child, Rectangle box) {
    LayoutConstraint layoutConstraint = child.getConstraint();
    float bx = box.getLeft();
    float by = box.getBottom();
    float bw = box.getWidth();
    float bh = box.getHeight();
    float cw = child.getBounds().getWidth();
    float ch = child.getBounds().getHeight();
    float marginX = layoutConstraint.getMarginX();
    float marginY = layoutConstraint.getMarginY();
    float absw = layoutConstraint.getWidth();
    float absh = layoutConstraint.getHeight();
    float x = 0;
    float y = 0;
    float w = cw;
    float h = ch;
    switch (layoutConstraint.getAlignmentX()) {
      case LayoutConstraint.LEFT:
        x = bx + marginX;
        break;
      case LayoutConstraint.CENTER:
        x = bx + (bw - cw) / 2;
        break;
      case LayoutConstraint.RIGHT:
        x = bx + bw - marginX - cw;
        break;
      case LayoutConstraint.JUSTIFIED:
        x = bx + marginX;
        w = bw - 2 * marginX;
        break;
      case LayoutConstraint.ABSOLUTE:
        x = marginX;
        w = absw;
        break;
    }
    switch (layoutConstraint.getAlignmentY()) {
      case LayoutConstraint.BOTTOM:
        y = by + marginY;
        break;
      case LayoutConstraint.CENTER:
        y = by + (bh - ch) / 2;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.