/** * Returns true if the graphics node has to be displayed, false * otherwise. */ public boolean getDisplay(Element e) { return CSSUtilities.convertDisplay(e); }
/** * Builds using the specified BridgeContext and element, the * specified graphics node. * * @param ctx the bridge context to use * @param e the element that describes the graphics node to build * @param node the graphics node to build */ public void buildGraphicsNode(BridgeContext ctx, Element e, GraphicsNode node) { // 'opacity' node.setComposite(CSSUtilities.convertOpacity(e)); // 'filter' node.setFilter(CSSUtilities.convertFilter(e, node, ctx)); // 'mask' node.setMask(CSSUtilities.convertMask(e, node, ctx)); // 'clip-path' node.setClip(CSSUtilities.convertClipPath(e, node, ctx)); // 'pointer-events' node.setPointerEventType(CSSUtilities.convertPointerEvents(e)); initializeDynamicSupport(ctx, e, node); }
/** * Handles the 'color-interpolation-filters' CSS property. * * @param filter the filter * @param filterElement the filter element */ protected static void handleColorInterpolationFilters(Filter filter, Element filterElement) { if (filter instanceof FilterColorInterpolation) { boolean isLinear = CSSUtilities.convertColorInterpolationFilters(filterElement); // System.out.println("IsLinear: " + isLinear + // " Filter: " + filter); ((FilterColorInterpolation)filter).setColorSpaceLinear(isLinear); } }
/** * Invoked for each CSS property that has changed. */ protected void handleCSSPropertyChanged(int property) { switch(property) { case SVGCSSEngine.IMAGE_RENDERING_INDEX: case SVGCSSEngine.COLOR_INTERPOLATION_INDEX: RenderingHints hints = CSSUtilities.convertImageRendering(e, null); hints = CSSUtilities.convertColorRendering(e, hints); if (hints != null) { node.setRenderingHints(hints); } break; default: super.handleCSSPropertyChanged(property); } }
/** * Invoked when the geometry of a graphical element has changed. */ protected void handleGeometryChanged() { node.setFilter(CSSUtilities.convertFilter(e, node, ctx)); node.setMask(CSSUtilities.convertMask(e, node, ctx)); node.setClip(CSSUtilities.convertClipPath(e, node, ctx)); if (isSVG12) { if (!SVG_USE_TAG.equals(e.getLocalName())) { // ShapeChange events get fired only for basic shapes and paths. fireShapeChangeEvent(); } fireBBoxChangeEvent(); } }
public void handleEvent(Event evt) { // // Only modify the cursor if the current target's (i.e., the <use>) cursor // property is *not* 'auto'. // Element currentTarget = (Element)evt.getCurrentTarget(); if (!CSSUtilities.isAutoCursor(currentTarget)) { Cursor cursor; cursor = CSSUtilities.convertCursor(currentTarget, ctx); if (cursor != null) { ctx.getUserAgent().setSVGCursor(cursor); } } } }
cgn.setVisible(CSSUtilities.convertVisibility(e)); if (CSSUtilities.convertOverflow(e)) { // overflow:hidden float [] offsets = CSSUtilities.convertClip(e); if (offsets == null) { // clip:auto clip = new Rectangle2D.Float(x, y, w, h); hints = CSSUtilities.convertColorRendering(e, hints); if (hints != null) cgn.setRenderingHints(hints); Rectangle2D r = CSSUtilities.convertEnableBackground(e); if (r != null) { cgn.setBackgroundEnable(r);
CSSUtilities.computeStyleAndURIs(refElement, localRefElement, uri); gn.setVisible(CSSUtilities.convertVisibility(e)); hints = CSSUtilities.convertColorRendering(e, hints); if (hints != null) gn.setRenderingHints(hints); Rectangle2D r = CSSUtilities.convertEnableBackground(e); if (r != null) gn.setBackgroundEnable(r);
int wr = CSSUtilities.convertClipRule(child); GeneralPath path = new GeneralPath(clipNode.getOutline()); path.setWindingRule(wr); ClipRable clip = CSSUtilities.convertClipPath(child, outlineNode, ctx); CSSUtilities.convertClipPath(clipElement, clipPathNode, ctx); if (clipElementClipPath != null) { clipPath.subtract(new Area(clipElementClipPath.getClipPath())); hints = CSSUtilities.convertShapeRendering(clipElement, null); if (hints != null) { Object o = hints.get(RenderingHints.KEY_ANTIALIASING);
Value val = CSSUtilities.getComputedStyle (paintedElement, SVGCSSEngine.STROKE_WIDTH_INDEX); float strokeWidth = val.getFloatValue(); if (CSSUtilities.convertOverflow(markerElement)) { // overflow:hidden Rectangle2D markerClip; float [] offsets = CSSUtilities.convertClip(markerElement); if (offsets == null) { // clip:auto markerClip
case SVGCSSEngine.TEXT_RENDERING_INDEX: { RenderingHints hints = node.getRenderingHints(); hints = CSSUtilities.convertTextRendering(e, hints); if (hints != null) { node.setRenderingHints(hints); hints = CSSUtilities.convertColorRendering(e, hints); if (hints != null) { node.setRenderingHints(hints);
if (CSSUtilities.convertOverflow(e)) { // overflow:hidden float [] offsets = CSSUtilities.convertClip(e); if (offsets == null) { // clip:auto clip = new Rectangle2D.Float(x, y, w, h);
/** * Creates a graphics node using the specified BridgeContext and * for the specified element. * * @param ctx the bridge context to use * @param e the element that describes the graphics node to build * @return a graphics node that represents the specified element */ public GraphicsNode createGraphicsNode(BridgeContext ctx, Element e) { ShapeNode shapeNode = (ShapeNode)super.createGraphicsNode(ctx, e); if (shapeNode == null) { return null; } associateSVGContext(ctx, e, shapeNode); // delegates to subclasses the shape construction buildShape(ctx, e, shapeNode); // 'shape-rendering' and 'color-rendering' RenderingHints hints = null; hints = CSSUtilities.convertColorRendering(e, hints); hints = CSSUtilities.convertShapeRendering(e, hints); if (hints != null) shapeNode.setRenderingHints(hints); return shapeNode; }
/** * Creates a <code>GraphicsNode</code> according to the specified parameters. * * @param ctx the bridge context to use * @param e the element that describes the graphics node to build * @return a graphics node that represents the specified element */ public GraphicsNode createGraphicsNode(BridgeContext ctx, Element e) { CompositeGraphicsNode gn = (CompositeGraphicsNode)super.createGraphicsNode(ctx, e); if (gn == null) return null; associateSVGContext(ctx, e, gn); // 'color-rendering' RenderingHints hints = null; hints = CSSUtilities.convertColorRendering(e, hints); if (hints != null) gn.setRenderingHints(hints); // 'enable-background' Rectangle2D r = CSSUtilities.convertEnableBackground(e); if (r != null) gn.setBackgroundEnable(r); return gn; }
imgNode.setVisible(CSSUtilities.convertVisibility(e)); Rectangle2D r = CSSUtilities.convertEnableBackground(e); if (r != null) { imgNode.setBackgroundEnable(r);
"xml:base", base); CSSUtilities.computeStyleAndURIs( (Element)refGlyphElement.getParentNode(), localFontElement, glyphUri);
/** * Handles 'mouseover' MouseEvent event type. */ public void handleEvent(Event evt) { Element target = (Element)evt.getTarget(); Cursor cursor = CSSUtilities.convertCursor(target, BridgeContext.this); if (cursor != null) { userAgent.setSVGCursor(cursor); } } }
= CSSUtilities.convertColorInterpolation(paintElement);
Rectangle2D r = CSSUtilities.convertEnableBackground(e); if (r != null) { result.setBackgroundEnable(r);
cgn.setVisible(CSSUtilities.convertVisibility(e)); if (CSSUtilities.convertOverflow(e)) { // overflow:hidden float [] offsets = CSSUtilities.convertClip(e); if (offsets == null) { // clip:auto clip = new Rectangle2D.Float(x, y, w, h); hints = CSSUtilities.convertColorRendering(e, hints); if (hints != null) cgn.setRenderingHints(hints); Rectangle2D r = CSSUtilities.convertEnableBackground(e); if (r != null) { cgn.setBackgroundEnable(r);