Search in sources :

Example 11 with EntityFigure

use of org.whole.lang.ui.figures.EntityFigure 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 12 with EntityFigure

use of org.whole.lang.ui.figures.EntityFigure 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 13 with EntityFigure

use of org.whole.lang.ui.figures.EntityFigure 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 14 with EntityFigure

use of org.whole.lang.ui.figures.EntityFigure 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)

Example 15 with EntityFigure

use of org.whole.lang.ui.figures.EntityFigure in project whole by wholeplatform.

the class FeatureFigureWithAttributes method initFigure.

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

Aggregations

EntityFigure (org.whole.lang.ui.figures.EntityFigure)20 RowLayout (org.whole.lang.ui.layout.RowLayout)13 IEntityFigure (org.whole.lang.ui.figures.IEntityFigure)6 IFigure (org.eclipse.draw2d.IFigure)5 EntityButton (org.whole.lang.ui.figures.EntityButton)4 Graphics (org.eclipse.draw2d.Graphics)3 Dimension (org.eclipse.draw2d.geometry.Dimension)2 IEntity (org.whole.lang.model.IEntity)2 EntityLabel (org.whole.lang.ui.figures.EntityLabel)2 ColumnLayout (org.whole.lang.ui.layout.ColumnLayout)2 EntityXYLayout (org.whole.lang.ui.layout.EntityXYLayout)2 TableRowLayout (org.whole.lang.ui.layout.TableRowLayout)2 MarginBorder (org.eclipse.draw2d.MarginBorder)1 Point (org.eclipse.draw2d.geometry.Point)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1 RootFragment (org.whole.lang.commons.model.RootFragment)1 FeatureDescriptor (org.whole.lang.reflect.FeatureDescriptor)1 FeatureDescriptorEnum (org.whole.lang.reflect.FeatureDescriptorEnum)1 CompositeFigure (org.whole.lang.ui.figures.CompositeFigure)1 EntityToggle (org.whole.lang.ui.figures.EntityToggle)1