private static com.ait.lienzo.client.core.image.ImageStrip convert(final ImageStrip strip) { return new com.ait.lienzo.client.core.image.ImageStrip(ImageStripRegistry.getName(strip), strip.getImage().getSafeUri().asString(), strip.getWide(), strip.getHigh(), strip.getPadding(), convert(strip.getOrientation())); }
@Override public IsElement render(final ImageStripGlyph glyph, final double width, final double height) { final ImageStrip strip = stripRegistry.get(glyph.getStripType()); final int index = glyph.getIndex(); final boolean isHorizontal = ImageStrip.Orientation.HORIZONTAL.equals(strip.getOrientation()); final int clipX = isHorizontal ? (strip.getWide() + strip.getPadding()) * index : 0; final int clipY = !isHorizontal ? (strip.getHigh() + strip.getPadding()) * index : 0; final WidgetElementRendererView view = views.get(); strip.getCss().getCssResource().ensureInjected(); view.setWidget(panelBuilder.apply(strip.getCss().getClassName(), new Integer[]{clipX, clipY * -1})); return view; }