Class InsertImagePane

    • Field Detail

      • useImageSize

        protected boolean useImageSize
      • isOptionsShown

        protected boolean isOptionsShown
    • Constructor Detail

      • InsertImagePane

        public InsertImagePane()
        Creates new form InsertImage
    • Method Detail

      • initCustomComponents

        protected void initCustomComponents()
      • getTitle

        public String getTitle()
        Return localization Title Text
        Returns:
        localization Title Text
      • showDialog

        public static void showDialog​(Component parentComponent,
                                      VectorCanvas canvas,
                                      Rectangle2D imageBounds)
        Convenience static methods to display this component as a Dialog
        Parameters:
        parentComponent - parentComponent
        canvas - the VectorCanvas
        imageBounds - a Rectangle2D which is used to fill the x,y,width,and height Field
      • updateVectorCanvas

        public void updateVectorCanvas​(VectorCanvas canvas)
      • setUseImageSize

        public void setUseImageSize​(boolean b)
        If true, when the image loaded by browse, it will auto fill the field width and height with Image size, currently it is only work with raster Image. The default value is true.
        Parameters:
        b - true or false
      • isUseImageSize

        public boolean isUseImageSize()
        Return wheter the field width and height is auto fill with image size
        Returns:
        true or false
        See Also:
        setUseImageSize(boolean)
      • setImageBounds

        public void setImageBounds​(Rectangle2D imageBounds)
        Fill the attribute bounds with specified param. The width and height field will be filled is size bigger than 10 px
        Parameters:
        imageBounds - Rectangle that specify bounds
      • embed

        protected org.w3c.dom.svg.SVGElement embed​(org.w3c.dom.svg.SVGDocument doc,
                                                   File file)
                                            throws IOException
        Throws:
        IOException
      • embedAsSVG

        protected org.w3c.dom.svg.SVGElement embedAsSVG​(org.w3c.dom.svg.SVGDocument doc,
                                                        File file)
                                                 throws IOException
        Throws:
        IOException
      • embedAsBase64

        protected org.w3c.dom.svg.SVGElement embedAsBase64​(org.w3c.dom.svg.SVGDocument doc,
                                                           File file)
                                                    throws IOException
        Return SVGElement with appropriate data protocol and the file encoded as base64
        Parameters:
        doc - the SVGDocument
        file - File to be processed
        Returns:
        SVGElement with appropriate data protocol and the file encoded as base64
        Throws:
        IOException - If an I/O error occurs