Class CreateMapProcessor

    • Constructor Detail

      • CreateMapProcessor

        protected CreateMapProcessor()
        Constructor.
    • Method Detail

      • adjustBoundsToScaleAndMapSize

        public static MapBounds adjustBoundsToScaleAndMapSize​(GenericMapAttribute.GenericMapAttributeValues mapValues,
                                                              java.awt.Rectangle paintArea,
                                                              MapBounds bounds,
                                                              double dpi)
        If requested, adjust the bounds to the nearest scale and the map size.
        Parameters:
        mapValues - Map parameters.
        paintArea - The size of the painting area.
        bounds - The map bounds.
        dpi - the DPI.
      • createSvgGraphics

        public static org.apache.batik.svggen.SVGGraphics2D createSvgGraphics​(java.awt.Dimension size)
                                                                       throws javax.xml.parsers.ParserConfigurationException
        Create a SVG graphic with the give dimensions.
        Parameters:
        size - The size of the SVG graphic.
        Throws:
        javax.xml.parsers.ParserConfigurationException
      • saveSvgFile

        public static void saveSvgFile​(org.apache.batik.svggen.SVGGraphics2D graphics2d,
                                       java.io.File path)
                                throws java.io.IOException
        Save a SVG graphic to the given path.
        Parameters:
        graphics2d - The SVG graphic to save.
        path - The file.
        Throws:
        java.io.IOException
      • createInputParameter

        public CreateMapProcessor.Input createInputParameter()
        Description copied from interface: Processor
        Returns a new/clean instance of a parameter object. This instance's will be inspected using reflection to find its public fields and the properties will be set from the Values object.

        The way the properties will be looked up is to

        1. take the bean property name
        2. map it using the input mapper, (if the input mapper does not have a mapping for the property then the unmapped property name is used)
        3. Look up the property value in the Values object using the mapped property name
        4. set the value on the instance created by this method. If the value is null an exception will be thrown UNLESS the HasDefaultValue annotation is on the field for the property.
        The populated instance will be passed to the execute method. It is imperative that a new instance is created each time because they will be used in a multi-threaded environment and thus the same processor instance may be ran in multiple threads with different instances of the parameter object.

        It is important to realize that super classes will also be analyzed, so care must be had with inheritance.

      • execute

        public CreateMapProcessor.Output execute​(CreateMapProcessor.Input param,
                                                 Processor.ExecutionContext context)
                                          throws java.io.IOException,
                                                 javax.xml.parsers.ParserConfigurationException,
                                                 net.sf.jasperreports.engine.JRException
        Description copied from interface: Processor
        Perform the process on the input attributes.
        Parameters:
        param - A Java object whose public fields are populated from the Values object (which is used for transferring properties between processors).
        context - The execution context for a print task.
        Returns:
        A Java object whose public fields will be put into the Values object. The key in the Values object is the name of the field or if there is a mapping in the Processor.getOutputMapperBiMap() map, the mapped name. The key is determined in a similar way as for the input object.
        Throws:
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
        net.sf.jasperreports.engine.JRException