Search in sources :

Example 6 with RowLayout

use of org.whole.lang.ui.layout.RowLayout in project whole by wholeplatform.

the class AttributeDownFigure method initFigure.

@Override
protected void initFigure() {
    initContentPanes(3);
    EntityFigure headerFigure = new EntityFigure(new RowLayout().withSpacing(8));
    headerFigure.add(createContentPane(0));
    // headerFigure.addParenthesis(" (");
    headerFigure.add(createContentPane(1));
    // headerFigure.addParenthesis(")");
    EntityFigure shapeFigure0 = new EntityFigure(new UnderColumnLayout().withSpacing(4).withMarginLeft(12).withMinorAlignment(Alignment.CENTER));
    shapeFigure0.add(headerFigure);
    shapeFigure0.add(createContentPane(2));
    add(shapeFigure = shapeFigure0);
}
Also used : UnderColumnLayout(org.whole.lang.ui.layout.UnderColumnLayout) EntityFigure(org.whole.lang.ui.figures.EntityFigure) RowLayout(org.whole.lang.ui.layout.RowLayout)

Example 7 with RowLayout

use of org.whole.lang.ui.layout.RowLayout in project whole by wholeplatform.

the class GrammarBasedUIUtils method createSequenceFigure.

public static IEntityFigure createSequenceFigure(IEntity entity, ContentPaneFigure contentPaneFigure, boolean embed) {
    FeatureDescriptorEnum fdEnum = entity.wGetLanguageKit().getFeatureDescriptorEnum();
    IEntity multiline = entity.wGet(fdEnum.valueOf("multiline"));
    ICompositeEntityLayout layout = EntityUtils.safeBooleanValue(multiline, false) ? new ColumnLayout() : new RowLayout();
    // TODO complete optional behavior
    IEntity optional = entity.wGet(fdEnum.valueOf("optional"));
    IEntityFigure figure;
    if (embed) {
        contentPaneFigure.setLayoutManager(layout.withSpacing(5));
        figure = contentPaneFigure;
    } else
        figure = new EntityFigure(layout.withSpacing(5));
    IEntity childFigures = entity.wGet(fdEnum.valueOf("figures"));
    for (int i = 0, size = childFigures.wSize(); i < size; i++) addChildFigure(childFigures.wGet(i), contentPaneFigure, figure);
    return figure;
}
Also used : ICompositeEntityLayout(org.whole.lang.ui.layout.ICompositeEntityLayout) IEntityFigure(org.whole.lang.ui.figures.IEntityFigure) FeatureDescriptorEnum(org.whole.lang.reflect.FeatureDescriptorEnum) EntityFigure(org.whole.lang.ui.figures.EntityFigure) IEntityFigure(org.whole.lang.ui.figures.IEntityFigure) IEntity(org.whole.lang.model.IEntity) ColumnLayout(org.whole.lang.ui.layout.ColumnLayout) RowLayout(org.whole.lang.ui.layout.RowLayout)

Example 8 with RowLayout

use of org.whole.lang.ui.layout.RowLayout in project whole by wholeplatform.

the class AbstractStyledFigure method initFigure.

protected void initFigure() {
    initContentPanes(2);
    shapeFigure = new EntityFigure(new RowLayout().withSpacing(4));
    shapeFigure.add(createContentPane(0));
    shapeFigure.add(createFoldingToggle(1));
    add(shapeFigure);
    add(createContentPane(1));
}
Also used : EntityFigure(org.whole.lang.ui.figures.EntityFigure) RowLayout(org.whole.lang.ui.layout.RowLayout)

Example 9 with RowLayout

use of org.whole.lang.ui.layout.RowLayout in project whole by wholeplatform.

the class FeatureFigure method initFigure.

@Override
protected void initFigure() {
    initContentPanes(2);
    shapeFigure = new EntityFigure(new RowLayout().withSpacing(4).withMarginLeft(12));
    shapeFigure.add(createContentPane(0));
    shapeFigure.add(createFoldingToggle(1));
    add(shapeFigure);
    // TODO add view tracking support (FIXME connections painting)
    // EntityFigure trackingFigure = new EntityFigure(new MonoLayout().withMajorAlignment(Alignment.CENTER).withAutoresizeWeight(1f)).withViewportTracking(ViewportTracking.VERTICAL);
    // trackingFigure.add(shapeFigure);
    // add(trackingFigure);
    add(createContentPane(1));
}
Also used : EntityFigure(org.whole.lang.ui.figures.EntityFigure) RowLayout(org.whole.lang.ui.layout.RowLayout)

Example 10 with RowLayout

use of org.whole.lang.ui.layout.RowLayout in project whole by wholeplatform.

the class AttributeRightFigure method initFigure.

@Override
protected void initFigure() {
    initContentPanes(3);
    EntityFigure headerFigure = new EntityFigure(new RowLayout().withSpacing(8));
    headerFigure.add(createContentPane(0));
    // headerFigure.addParenthesis(" (");
    headerFigure.add(createContentPane(1));
    // headerFigure.addParenthesis(")");
    EntityFigure shapeFigure0 = new EntityFigure(new RowLayout().withSpacing(8).withMarginLeft(12));
    shapeFigure0.add(headerFigure);
    shapeFigure0.add(createContentPane(2));
    add(shapeFigure = shapeFigure0);
}
Also used : EntityFigure(org.whole.lang.ui.figures.EntityFigure) RowLayout(org.whole.lang.ui.layout.RowLayout)

Aggregations

RowLayout (org.whole.lang.ui.layout.RowLayout)14 EntityFigure (org.whole.lang.ui.figures.EntityFigure)13 IEntityFigure (org.whole.lang.ui.figures.IEntityFigure)4 Graphics (org.eclipse.draw2d.Graphics)2 IFigure (org.eclipse.draw2d.IFigure)2 EntityButton (org.whole.lang.ui.figures.EntityButton)2 EntityLabel (org.whole.lang.ui.figures.EntityLabel)2 ColumnLayout (org.whole.lang.ui.layout.ColumnLayout)2 List (java.util.List)1 MarginBorder (org.eclipse.draw2d.MarginBorder)1 Point (org.eclipse.draw2d.geometry.Point)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1 IEntity (org.whole.lang.model.IEntity)1 FeatureDescriptor (org.whole.lang.reflect.FeatureDescriptor)1 FeatureDescriptorEnum (org.whole.lang.reflect.FeatureDescriptorEnum)1 EntityToggle (org.whole.lang.ui.figures.EntityToggle)1 StringSeparatedCompositeRowFigure (org.whole.lang.ui.figures.StringSeparatedCompositeRowFigure)1 TypeNameValueTableRowFigure (org.whole.lang.ui.figures.TypeNameValueTableRowFigure)1 ICompositeEntityLayout (org.whole.lang.ui.layout.ICompositeEntityLayout)1 UnderColumnLayout (org.whole.lang.ui.layout.UnderColumnLayout)1