use of com.ait.lienzo.client.core.shape.Group in project lienzo-core by ahome-it.
the class AlignAndDistributeControlImpl method removeChildrenIfIndexed.
public void removeChildrenIfIndexed(final IPrimitive<?> prim, final List<ShapePair> pairs) {
for (final IPrimitive<?> child : prim.asGroup().getChildNodes()) {
final AlignAndDistributeControl handler = m_alignAndDistribute.getControlForShape(child.uuid());
if (handler != null) {
final ShapePair pair = new ShapePair(prim.asGroup(), child, handler);
pairs.add(pair);
prim.asGroup().remove(child);
}
if (child instanceof Group) {
removeChildrenIfIndexed(child.asGroup(), pairs);
}
}
}
use of com.ait.lienzo.client.core.shape.Group in project kie-wb-common by kiegroup.
the class DMNGridLayer method addGhost.
void addGhost(final ExpressionContainerGrid container, final GridWidget gridWidget) {
// Rectangle the size of the ExpressionContainerGrid
final Rectangle r = getGhostRectangle();
r.setWidth(container.getWidth() + BaseExpressionGridTheme.STROKE_WIDTH);
r.setHeight(container.getHeight() + BaseExpressionGridTheme.STROKE_WIDTH);
r.setFillColor(ColorName.WHITE);
r.setAlpha(0.50);
r.setListening(false);
final Group g = GWT.create(Group.class);
final Transform transform = getViewport().getTransform();
g.setX(container.getX() + transform.getTranslateX());
g.setY(container.getY() + transform.getTranslateY());
g.add(r);
// LiteralExpression and UndefinedExpression are not handled as grids in
// their own right. In these circumstances use their parent GridWidget.
GridWidget gw = gridWidget;
if (gw instanceof LiteralExpressionGrid) {
gw = ((LiteralExpressionGrid) gw).getParentInformation().getGridWidget();
} else if (gw instanceof UndefinedExpressionGrid) {
gw = ((UndefinedExpressionGrid) gw).getParentInformation().getGridWidget();
}
// Clip the inner GridWidget so everything outside of it is ghosted
final IPathClipper clipper = new InverseGridWidgetClipper(container, gw);
clipper.setActive(true);
g.setPathClipper(clipper);
g.drawWithTransforms(getContext(), 1.0, getStorageBounds());
}
use of com.ait.lienzo.client.core.shape.Group in project kie-wb-common by kiegroup.
the class FunctionColumnRenderer method renderHeaderContent.
@Override
public Group renderHeaderContent(final List<GridColumn.HeaderMetaData> headerMetaData, final GridHeaderColumnRenderContext context, final int headerRowIndex, final double blockWidth, final double rowHeight) {
final Group headerGroup = GWT.create(Group.class);
if (headerRowIndex >= headerMetaData.size()) {
return headerGroup;
}
final GridColumn.HeaderMetaData headerRowMetaData = headerMetaData.get(headerRowIndex);
if (headerRowMetaData instanceof EditableHeaderMetaData) {
final EditableHeaderMetaData editableHeaderMetaData = (EditableHeaderMetaData) headerRowMetaData;
return editableHeaderMetaData.render(context, blockWidth, rowHeight);
}
return super.renderHeaderContent(headerMetaData, context, headerRowIndex, blockWidth, rowHeight);
}
use of com.ait.lienzo.client.core.shape.Group in project kie-wb-common by kiegroup.
the class RendererUtils method getNameAndDataTypeText.
private static Group getNameAndDataTypeText(final GridRendererTheme theme, final String name, final QName typeRef, final double blockWidth, final double blockHeight) {
final Group headerGroup = GWT.create(Group.class);
final Text tName = theme.getHeaderText();
tName.setText(name);
tName.setListening(false);
tName.setX(blockWidth / 2);
tName.setY(blockHeight / 2 - SPACING);
final Text tTypeRef = theme.getHeaderText();
tTypeRef.setFontStyle(FONT_STYLE_TYPE_REF);
tTypeRef.setFontSize(BaseExpressionGridTheme.FONT_SIZE - 2.0);
tTypeRef.setText("(" + typeRef.toString() + ")");
tTypeRef.setListening(false);
tTypeRef.setX(blockWidth / 2);
tTypeRef.setY(blockHeight / 2 + SPACING);
headerGroup.add(tName);
headerGroup.add(tTypeRef);
return headerGroup;
}
use of com.ait.lienzo.client.core.shape.Group in project kie-wb-common by kiegroup.
the class RendererUtils method getExpressionText.
private static Group getExpressionText(final GridRendererTheme theme, final String text) {
final Group g = GWT.create(Group.class);
final Text t = makeExpressionText(theme);
t.setText(text);
t.setListening(false);
t.setX(EXPRESSION_TEXT_PADDING);
t.setY(EXPRESSION_TEXT_PADDING);
t.setTextAlign(TextAlign.LEFT);
t.setWrapper(new TextLineBreakWrap(t));
g.add(t);
return g;
}
Aggregations