Class CursorManager

    • Field Detail

      • cursorMap

        protected static java.util.Map cursorMap
        Maps SVG Cursor Values to Java Cursors
      • DEFAULT_CURSOR

        public static final java.awt.Cursor DEFAULT_CURSOR
        Default cursor when value is not found
      • ANCHOR_CURSOR

        public static final java.awt.Cursor ANCHOR_CURSOR
        Cursor used over anchors
      • TEXT_CURSOR

        public static final java.awt.Cursor TEXT_CURSOR
        Cursor used over text
      • DEFAULT_PREFERRED_WIDTH

        public static final int DEFAULT_PREFERRED_WIDTH
        Default preferred cursor size, used for SVG images
        See Also:
        Constant Field Values
      • DEFAULT_PREFERRED_HEIGHT

        public static final int DEFAULT_PREFERRED_HEIGHT
        See Also:
        Constant Field Values
      • ctx

        protected BridgeContext ctx
        BridgeContext associated with this CursorManager
      • cursorCache

        protected org.apache.batik.bridge.CursorManager.CursorCache cursorCache
        Cache used to hold references to cursors
    • Constructor Detail

      • CursorManager

        public CursorManager​(BridgeContext ctx)
        Creates a new CursorManager object.
        Parameters:
        ctx - the BridgeContext associated to this CursorManager
    • Method Detail

      • getPredefinedCursor

        public static java.awt.Cursor getPredefinedCursor​(java.lang.String cursorName)
        Returns a Cursor object for a given cursor value. This initial implementation does not handle user-defined cursors, so it always uses the cursor at the end of the list
      • convertCursor

        public java.awt.Cursor convertCursor​(org.w3c.dom.Element e)
        Returns the Cursor corresponding to the input element's cursor property
        Parameters:
        e - the element on which the cursor property is set
      • convertBuiltInCursor

        public java.awt.Cursor convertBuiltInCursor​(org.w3c.dom.Element e,
                                                    java.lang.String cursorStr)
      • convertSVGCursor

        public java.awt.Cursor convertSVGCursor​(org.w3c.dom.Element e,
                                                Value l)
        Returns a cursor for the given value list. Note that the code assumes that the input value has at least two entries. So the caller should check that before calling the method. For example, CSSUtilities.convertCursor performs that check.
      • convertSVGCursorElement

        public java.awt.Cursor convertSVGCursorElement​(org.w3c.dom.Element cursorElement)
        Returns a cursor for a given element
      • cursorHrefToFilter

        protected Filter cursorHrefToFilter​(org.w3c.dom.Element cursorElement,
                                            ParsedURL purl,
                                            java.awt.geom.Point2D hotSpot)
        Converts the input ParsedURL into a Filter and transforms the input hotSpot point (in image space) to cursor space
      • renderedImageToImage

        protected java.awt.Image renderedImageToImage​(java.awt.image.RenderedImage ri)
        Implementation helper: converts a RenderedImage to an Image