Search in sources :

Example 16 with Layer

use of com.ait.lienzo.client.core.shape.Layer in project drools-wb by kiegroup.

the class NodeLabel method setLabel.

public void setLabel(final String label) {
    final Layer scratchLayer = new Layer();
    final LienzoPanel scratchPanel = new LienzoPanel(100, 100);
    scratchPanel.add(scratchLayer);
    text.setText(label);
    final TextMetrics tm = text.measure(scratchLayer.getContext());
    final double cw = tm.getWidth() + 10;
    final double ch = tm.getHeight() + 10;
    container.setWidth(cw);
    container.setHeight(ch);
    container.setLocation(new Point2D(-cw / 2, -ch / 2));
}
Also used : LienzoPanel(com.ait.lienzo.client.widget.LienzoPanel) Point2D(com.ait.lienzo.client.core.types.Point2D) TextMetrics(com.ait.lienzo.client.core.types.TextMetrics) Layer(com.ait.lienzo.client.core.shape.Layer)

Example 17 with Layer

use of com.ait.lienzo.client.core.shape.Layer in project lienzo-core by ahome-it.

the class ImageProxy method setColorKey.

public final void setColorKey(final String ckey) {
    if (null == ckey) {
        m_k_color = ckey;
        m_ignores = new ClearFilter();
    } else if (false == ckey.equals(m_k_color)) {
        m_k_color = ckey;
        m_ignores = new RGBIgnoreAlphaImageDataFilter(m_k_color);
    } else {
        return;
    }
    if (isLoaded()) {
        doFiltering(m_filterImage, m_selectImage, m_ignores);
        if (m_image.isVisible()) {
            final Layer layer = m_image.getLayer();
            if (null != layer) {
                layer.batch();
            }
        }
    }
}
Also used : Layer(com.ait.lienzo.client.core.shape.Layer) RGBIgnoreAlphaImageDataFilter(com.ait.lienzo.client.core.image.filter.RGBIgnoreAlphaImageDataFilter)

Aggregations

Layer (com.ait.lienzo.client.core.shape.Layer)17 LienzoPanel (com.ait.lienzo.client.widget.LienzoPanel)7 Group (com.ait.lienzo.client.core.shape.Group)5 Test (org.junit.Test)4 TextMetrics (com.ait.lienzo.client.core.types.TextMetrics)3 WiresLayer (com.ait.lienzo.client.core.shape.wires.WiresLayer)2 GridWidget (org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget)2 RGBIgnoreAlphaImageDataFilter (com.ait.lienzo.client.core.image.filter.RGBIgnoreAlphaImageDataFilter)1 IPathClipper (com.ait.lienzo.client.core.shape.IPathClipper)1 Rectangle (com.ait.lienzo.client.core.shape.Rectangle)1 WiresShape (com.ait.lienzo.client.core.shape.wires.WiresShape)1 Point2D (com.ait.lienzo.client.core.types.Point2D)1 Transform (com.ait.lienzo.client.core.types.Transform)1 ColorName (com.ait.lienzo.shared.core.types.ColorName)1 NFastArrayList (com.ait.tooling.nativetools.client.collection.NFastArrayList)1 GWT (com.google.gwt.core.client.GWT)1 Command (com.google.gwt.user.client.Command)1 HashSet (java.util.HashSet)1 Objects (java.util.Objects)1 Optional (java.util.Optional)1