Search in sources :

Example 16 with Bounds

use of org.uberfire.ext.wires.core.grids.client.model.Bounds in project drools-wb by kiegroup.

the class CollectionEditorDOMElement method initialise.

@Override
public void initialise(final GridBodyCellRenderContext context) {
    transform(context);
    final Bounds visibleBounds = gridLayer.getVisibleBounds();
    final double shownWidth = visibleBounds.getWidth();
    final double widgetWidth = (shownWidth * 0.5);
    final double widgetLeft = ((shownWidth - widgetWidth) / 2);
    widgetContainer.getElement().getStyle().setWidth(widgetWidth, Style.Unit.PX);
    widgetContainer.getElement().getStyle().setLeft(widgetLeft, Style.Unit.PX);
    final double shownHeight = visibleBounds.getHeight();
    final double widgetHeight = (shownHeight * 0.5);
    widget.setFixedHeight(widgetHeight, Style.Unit.PX);
    widgetContainer.getElement().getStyle().setTop(0, Style.Unit.PX);
    // Verify Collection editor is always shown on center of the widget, even when clicked cell left margin is outside of the grid
    widgetContainer.getElement().getStyle().clearProperty("clip");
}
Also used : Bounds(org.uberfire.ext.wires.core.grids.client.model.Bounds)

Aggregations

Bounds (org.uberfire.ext.wires.core.grids.client.model.Bounds)16 Test (org.junit.Test)10 BaseBounds (org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds)6 Transform (com.ait.lienzo.client.core.types.Transform)4 MultiPath (com.ait.lienzo.client.core.shape.MultiPath)1