Documentation of 'org.jplot2d.element.ElementFactory' Java class
ElementFactory
org.jplot2d.element

Class ElementFactory



  • public class ElementFactory
    extends java.lang.Object
    A factory to produce all kind of plot components.
    • Method Detail

      • getInstance

        public static ElementFactory getInstance()
        Returns an instance of ComponentFactory. All component created by this factory are not thread-safe.
        Returns:
        an instance of ComponentFactory
      • getThreadSafeInstance

        public static ElementFactory getThreadSafeInstance()
        Returns an instance of ComponentFactory. All component created by this factory are thread-safe.
        Returns:
        an instance of ComponentFactory
      • getInstance

        public static ElementFactory getInstance(StyleConfiguration profile)
        Returns an instance of ComponentFactory which is configured by profile. All component created by this factory are not thread-safe.
        Parameters:
        profile -
        Returns:
        an instance of ComponentFactory
      • getThreadSafeInstance

        public static ElementFactory getThreadSafeInstance(StyleConfiguration profile)
        Returns an instance of ComponentFactory which is configured by profile. All component created by this factory are thread-safe.
        Parameters:
        profile -
        Returns:
        an instance of ComponentFactory
      • proxy

        public <T extends Element> T proxy(ElementEx impl,
                                           java.lang.Class<T> clazz)
        Create proxy for the given impl
        Type Parameters:
        T - the proxy type
        Parameters:
        impl - the impl
        clazz - the class of proxy type
        Returns:
        the proxy
      • createPlot

        public Plot createPlot()
        Create a plot with the initial values
        • cacheable: true
        • color: BLACK
        • font: Serif PLAIN 12
        • margin: extra 12 on left, top, right, bottom
        • sizeMode: FillContainerSizeMode(1)
        • containerSize: 640x480
          Returns:
        • createSubplot

          public Plot createSubplot()
          Create a plot which can be added to other plot later.
          Returns:
        • createTitle

          public Title createTitle(java.lang.String text)
          Create a plot title.
          Parameters:
          text - the title text
          Returns:
          a plot title
        • createAxisTickManager

          public AxisTickManager createAxisTickManager()
          Create an AxisTickManager, which contains an AxisTransform.
          Returns:
          an AxisTickManager
        • createAxisTransform

          public AxisTransform createAxisTransform()
          Create an AxisTransform, which contains an axis range lock group.
          Returns:
          an AxisTransform
        • createAxisRangeLockGroup

          public AxisRangeLockGroup createAxisRangeLockGroup()
          Create an axis lock group.
          Returns:
          an axis lock group
        • createLayer

          public Layer createLayer(Graph graph)
        • createLayer

          public Layer createLayer()
          Create a layer
          Returns:
          a layer
        • createXYGraph

          public XYGraph createXYGraph(java.lang.Object xarray,
                                       java.lang.Object yarray)
          Create a XYGraph with the given x/y array.
          Parameters:
          xarray - the x data array, can be byte[], short[], int[], long[], float[] or double[]
          yarray - the y data array, can be byte[], short[], int[], long[], float[] or double[]
          Returns:
          a XYGraph object
        • createXYGraph

          public XYGraph createXYGraph(java.lang.Object xarray,
                                       java.lang.Object yarray,
                                       java.lang.String name)
          Create a XYGraph with the given x/y array.
          Parameters:
          xarray - the x data array, can be byte[], short[], int[], long[], float[] or double[]
          yarray - the y data array, can be byte[], short[], int[], long[], float[] or double[]
          name - the name of created XYGraph, can display in legend
          Returns:
          a XYGraph object
        • createXYGraph

          public XYGraph createXYGraph(java.lang.Object xarray,
                                       java.lang.Object yarray,
                                       java.lang.Object xErrorLow,
                                       java.lang.Object xErrorHigh,
                                       java.lang.Object yErrorLow,
                                       java.lang.Object yErrorHigh)
          Create a XYGraph with the given x/y array, x low/high error array and y low/high error array.
          Parameters:
          xarray - the x data array, can be byte[], short[], int[], long[], float[] or double[]
          yarray - the y data array, can be byte[], short[], int[], long[], float[] or double[]
          xErrorLow - the x low error array, can be byte[], short[], int[], long[], float[] or double[]
          xErrorHigh - the x high error array, can be byte[], short[], int[], long[], float[] or double[]
          yErrorLow - the y low error array, can be byte[], short[], int[], long[], float[] or double[]
          yErrorHigh - the y high error array, can be byte[], short[], int[], long[], float[] or double[]
          Returns:
          a XYGraph object
        • createXYGraph

          public XYGraph createXYGraph(java.lang.Object xarray,
                                       java.lang.Object yarray,
                                       java.lang.Object xErrorLow,
                                       java.lang.Object xErrorHigh,
                                       java.lang.Object yErrorLow,
                                       java.lang.Object yErrorHigh,
                                       java.lang.String name)
          Create a XYGraph with the given x/y array, x low/high error array and y low/high error array.
          Parameters:
          xarray - the x data array, can be byte[], short[], int[], long[], float[] or double[]
          yarray - the y data array, can be byte[], short[], int[], long[], float[] or double[]
          xErrorLow - the x low error array, can be byte[], short[], int[], long[], float[] or double[]
          xErrorHigh - the x high error array, can be byte[], short[], int[], long[], float[] or double[]
          yErrorLow - the y low error array, can be byte[], short[], int[], long[], float[] or double[]
          yErrorHigh - the y high error array, can be byte[], short[], int[], long[], float[] or double[]
          name - the name of created XYGraph, can display in legend
          Returns:
          a XYGraph object
        • createXYGraph

          public XYGraph createXYGraph(ArrayPair xy)
          Create a XYGraph with the given ArrayPair.
          Parameters:
          xy - the x/y ArrayPair
          Returns:
          a XYGraph object
        • createXYGraph

          public XYGraph createXYGraph(ArrayPair xy,
                                       java.lang.String name)
          Create a XYGraph with the given x/y ArrayPair.
          Parameters:
          xy - the x/y ArrayPair
          name - the name of created XYGraph, can display in legend
          Returns:
          a XYGraph object
        • createXYGraph

          public XYGraph createXYGraph(ArrayPair xy,
                                       ArrayPair errorX,
                                       ArrayPair errorY)
          Create a XYGraph with the given x/y ArrayPair, x low/high error ArrayPair and y low/high error ArrayPair.
          Parameters:
          xy - the x/y ArrayPair
          errorX - the x low/high error ArrayPair
          errorY - the y low/high error ArrayPair
          Returns:
          a XYGraph object
        • createXYGraph

          public XYGraph createXYGraph(ArrayPair xy,
                                       ArrayPair errorX,
                                       ArrayPair errorY,
                                       java.lang.String name)
          Create a XYGraph with the given x/y ArrayPair, x low/high error ArrayPair and y low/high error ArrayPair.
          Parameters:
          xy - the x/y ArrayPair
          errorX - the x low/high error ArrayPair
          errorY - the y low/high error ArrayPair
          name - the name of created XYGraph, can display in legend
          Returns:
          a XYGraph object
        • createXYGraph

          public XYGraph createXYGraph(XYGraphData data)
          Create a XYGraph with the given graph data
          Parameters:
          data - the graph to be plotted
          Returns:
          a XYGraph
        • createXYGraph

          public XYGraph createXYGraph(XYGraphData data,
                                       java.lang.String name)
          Create a XYGraph with the given graph data and name
          Parameters:
          data - the graph to be plotted
          name - the name of created XYGraph, can display in legend
          Returns:
          a XYGraph
        • createSymbolAnnotation

          public SymbolAnnotation createSymbolAnnotation(double x,
                                                         double y)
        • createSymbolAnnotation

          public SymbolAnnotation createSymbolAnnotation(double x,
                                                         double y,
                                                         java.lang.String text)
        • createSymbolAnnotation

          public SymbolAnnotation createSymbolAnnotation(double x,
                                                         double y,
                                                         SymbolShape symbol,
                                                         java.lang.String text)
        • createHLineAnnotation

          public HLineAnnotation createHLineAnnotation(double y)
          Create a horizontal line annotation with the given y value in world coordinate system
          Parameters:
          y - the y value in world coordinate system
          Returns:
          a horizontal line annotation
        • createVLineAnnotation

          public VLineAnnotation createVLineAnnotation(double x)
          Create a vertical line annotation with the given y value in world coordinate system
          Parameters:
          x - the y value in world coordinate system
          Returns:
          a horizontal line annotation
        • createHStripAnnotation

          public HStripAnnotation createHStripAnnotation(double start,
                                                         double end)
          Create a horizontal strip annotation with the given y value range in world coordinate system
          Parameters:
          start - the y start value in world coordinate system
          end - the y end value in world coordinate system
          Returns:
          a horizontal strip annotation
        • createVStripAnnotation

          public VStripAnnotation createVStripAnnotation(double start,
                                                         double end)
          Create a vertical strip annotation with the given x value range in world coordinate system.
          Parameters:
          start - the x start value in world coordinate system
          end - the x end value in world coordinate system
          Returns:
          a vertical strip annotation
        • createRectangleAnnotation

          public RectangleAnnotation createRectangleAnnotation(double x1,
                                                               double x2,
                                                               double y1,
                                                               double y2)
          Create a rectangle annotation with the given x and y value range in world coordinate system.
          Parameters:
          x1 - the x start value in world coordinate system
          x2 - the x end value in world coordinate system
          y1 - the y start value in world coordinate system
          y2 - the y end value in world coordinate system
          Returns:
          a rectangle annotation
        • createStroke

          public java.awt.BasicStroke createStroke(float width)
        • createStroke

          public java.awt.BasicStroke createStroke(float width,
                                                   float[] dash)
        • createImageGraph

          public ImageGraph createImageGraph(byte[][] byte2d)
        • createImageGraph

          public ImageGraph createImageGraph(short[][] short2d)
        • createImageGraph

          public ImageGraph createImageGraph(int[][] int2d)
        • createImageGraph

          public ImageGraph createImageGraph(float[][] float2d)
        • createImageGraph

          public ImageGraph createImageGraph(double[][] double2d)
        • createImageMapping

          public ImageMapping createImageMapping()
          Create an image mapping.
          Returns:
          an image mapping
        • createRGBImageGraph

          public RGBImageGraph createRGBImageGraph(byte[][] red2d,
                                                   byte[][] green2d,
                                                   byte[][] blue2d)
        • createRGBImageGraph

          public RGBImageGraph createRGBImageGraph(short[][] red2d,
                                                   short[][] green2d,
                                                   short[][] blue2d)
        • createRGBImageGraph

          public RGBImageGraph createRGBImageGraph(int[][] red2d,
                                                   int[][] green2d,
                                                   int[][] blue2d)
        • createRGBImageGraph

          public RGBImageGraph createRGBImageGraph(float[][] red2d,
                                                   float[][] green2d,
                                                   float[][] blue2d)
        • createRGBImageGraph

          public RGBImageGraph createRGBImageGraph(double[][] red2d,
                                                   double[][] green2d,
                                                   double[][] blue2d)
        • createRGBImageMapping

          public RGBImageMapping createRGBImageMapping()
          Create an image mapping.
          Returns:
          an image mapping
        • copy

          public <T extends Element> T copy(T element)
          Create a copy of the given element. All sub-element are copied together.
          Parameters:
          element - the element to be copied.
          Returns:
          the copy of given element
        • copy

          public <T extends Element> T copy(T element,
                                            java.util.Map<Element,Element> copyMap)
          Create a copy of the given element. All sub-element are copied together.
          Parameters:
          element - the element to be copied.
          copyMap - a map to be filled with mapping from original element to copy element.
          Returns:
          the copy of given element

    DMelt 3.0 © DataMelt by jWork.ORG

    Ads help maintain this website.