Class QuadrantPlot

java.lang.Object
org.eclnt.jsfserver.util.quadrantplot.QuadrantPlot

public class QuadrantPlot extends Object
  • Constructor Details

    • QuadrantPlot

      public QuadrantPlot()
      Default constructor - automatically defined a width and height of 10 cm * 10 cm
  • Method Details

    • clearDrawAreaData

      public void clearDrawAreaData()
      Internally resets the data to a cleared status.
    • setXAxisDescription

      public void setXAxisDescription(String description, String color, double fontSize, double height)
      Sets the description for the horizontal axis. This text is drawn under the chart.
      Parameters:
      description - Text for the output under the chart, e. g. "Year 2000".
      color - Color for the text. Either #RRGGBB (e.g. #FF0000 for red) or valid HTML color name ("red").
      fontSize - The relative font size of the description, from 8 to 24. The default value is 12.
      height - The gap under the x axis for the description. For fontSize 12, the height should be 200.
    • setXAxis

      public void setXAxis(String[] outputXAxis)
      Set the quadrant text for the x axis.
      The color is 'black' and the font size is '12'.
      Parameters:
      outputXAxis - All text for the x axis.
    • setXAxis

      public void setXAxis(String[] outputXAxis, double[] size, String[] color)
      Set the text for the x axis with the color and the font size.
      All array's must have the same lenght.
      Parameters:
      outputXAxis - All text for the x axis.
      size - The size for each text.
      color - The color for each text.
    • setYAxisDescription

      public void setYAxisDescription(String description, String color, double fontSize, double width)
      Sets the description for the vertical axis. This text is drawn aside the chart.
      Parameters:
      description - Text for the output beside the chart, e. g. "budget".
      color - Color for the text. Either #RRGGBB (e.g. #FF0000 for red) or valid HTML color name ("red").
      fontSize - The relative font size of the description, from 8 to 24. The default value is 12.
      width - The gap on the left side of the x axis for the description. For fontSize 12, the width should be 200.
    • setYAxis

      public void setYAxis(String[] outputYAxis)
      Set the quadrant text for the y axis.
      The color is 'black' and the font size is '12'.
      Parameters:
      outputYAxis - All text for the y axis.
    • setYAxis

      public void setYAxis(String[] outputYAxis, double[] size, String[] color)
      Set the text for the y axis with the color and the font size.
      All array's must have the same lenght.
      Parameters:
      outputYAxis - All text for the y axis.
      size - The size for each text.
      color - The color for each text.
    • addQuadrantInfo

      public void addQuadrantInfo(int x, int y, String color, String id)
      Add the info for one quadrant. The quadrants are placed from left bottom to right top.
      Parameters:
      x - X axis index form 0 to the size of the x axis quadrant count minus 1.
      y - Y axis index form 0 to the size of the y axis quadrant count minus 1.
      color - Background color of the quadrant.
      id - The id for the reactOnclick method.
    • addPlotData

      public void addPlotData(double x, double y, String text, double size, String color)
      Output text in the plot area.
      The number before the dezimal point is the quadrant index, the number after is the location in the quadrant. The location is the left bottom point of the text.
      Parameters:
      x - Quadrant and location at the x axis.
      y - Quadrant and location in the y axis.
      text - Output text.
      size - Text size.
      color - Text color.
    • addPlotData

      public void addPlotData(double x, double y, String text, double size, String color, String id)
    • rotateXAxisScaleText

      public void rotateXAxisScaleText(double degrees, double height)
      Rotate the x axis scale textes. Also, you could reserve place for the text. The default rotation is 0 degrees.
      Parameters:
      degrees - Rotation of the text between -90 and +90 degrees.
      height - Additinal place for the rotated x axis texts between the plot and the x axis description.
    • setLeftYAxisDistance

      public void setLeftYAxisDistance(double width)
      Additional space at the left side of the plot.
    • printFrameAround

      public void printFrameAround(boolean printFrame)
      Print a frame araound the plot or not.
      Default is print the frame.
    • setScaleLineColor

      public void setScaleLineColor(String color)
      Set the color of the scale lines. Default color is black.
    • setBackgroundColor

      public void setBackgroundColor(String color)
      Set the background color of the hole plot area. Default color is white.
    • setSelectedID

      public void setSelectedID(String selectedID)
    • setSelectionColor

      public void setSelectionColor(String selectionColor)
      When using setSelectedID(String) then the area of the corresponding id will be marked by drawing a border with a certain color. This selection color can be defined here.
    • setSelectionStrokeWidth

      public void setSelectionStrokeWidth(int selectionStrokeWidth)
      When using setSelectedID(String) then the area of the corresponding id will be marked by drawing a border with a certain color. This width of this border can be defined here.
    • getCi

      public final long getCi()
      Internal usage only. Change index.
    • setQuadrantplotprop

      public void setQuadrantplotprop(String value)
      Internally used.
    • setSelId

      public void setSelId(String value)
      Internally used.
      For change or clear the selection use the method setSelectedID.
    • getSvg

      public String getSvg()
      Return the SVG string of the draw area.
    • computeOutputWidth

      public long computeOutputWidth(int height)
      Calculate the width for the height, so that the quadrant output is quadratic.
      Parameters:
      height - The height of the output.
      Returns:
      The widht for quadratic quadrant output.
    • setSVGOutputWidth

      public void setSVGOutputWidth(int height)
      Set the height for the SVG output. Calculate the width, that the quadrants has a quadratric output.
      Parameters:
      height - The height for the SVG output.
    • createSVGChart

      protected void createSVGChart(StringBuffer chartData)