org.opensha.sha.gui.infoTools
Class GraphiWindowAPI_Impl

java.lang.Object
  extended by org.opensha.sha.gui.infoTools.GraphiWindowAPI_Impl
All Implemented Interfaces:
GraphWindowAPI

public class GraphiWindowAPI_Impl
extends Object
implements GraphWindowAPI

This class accepts a function list and plots it using Jfreechart

Author:
vipingupta

Constructor Summary
GraphiWindowAPI_Impl(ArrayList funcs, String plotTitle)
           
GraphiWindowAPI_Impl(ArrayList funcs, String plotTitle, ArrayList<PlotCurveCharacterstics> plotChars)
           
GraphiWindowAPI_Impl(ArrayList funcs, String plotTitle, ArrayList<PlotCurveCharacterstics> plotChars, boolean setVisible)
           
GraphiWindowAPI_Impl(PlotSpec plotSpec)
           
GraphiWindowAPI_Impl(XY_DataSet func, String plotTitle)
           
 
Method Summary
protected static ArrayList<PlotCurveCharacterstics> generateDefaultChars(List funcs)
           
static List<Color> generateDefaultColors()
           
 ArrayList getCurveFunctionList()
           
 GraphWindow getGraphWindow()
           
 int getPlotLabelFontSize()
           
 ArrayList getPlottingFeatures()
           
 String getPlotTitle()
          Get plot title
 int getTickLabelFontSize()
           
 double getUserMaxX()
           
 double getUserMaxY()
           
 double getUserMinX()
           
 double getUserMinY()
           
 double getX_AxisMax()
          This returns the current X-axis maximum value
 double getX_AxisMin()
          This returns the current X-axis minimum value
 String getXAxisLabel()
           
 boolean getXLog()
           
 double getY_AxisMax()
          This returns the current Y-axis maximum value
 double getY_AxisMin()
          This returns the current Y-axis minimum value
 String getYAxisLabel()
           
 boolean getYLog()
           
 boolean isCustomAxis()
          Whether this is custom axis
static void main(String[] args)
           
 void refreshPlot()
          Plot Graph using preferences
 void saveAsPDF(String fileName)
           
 void saveAsPNG(String fileName)
           
 void setAllLineTypes(PlotLineType lineType, PlotSymbol symbol)
           
 void setAutoRange()
          set the auto range for the axis.
 void setAxisLabelFontSize(int fontSize)
          Set the axis label font size
 void setAxisRange(double xMin, double xMax, double yMin, double yMax)
          sets the range for X and Y axis
 void setPlotLabelFontSize(int fontSize)
          Set plot label font size
 void setPlottingFeatures(ArrayList<PlotCurveCharacterstics> curveCharacteristics)
           
 void setPlotTitle(String plotTitle)
          Set plot Title
 void setTickLabelFontSize(int fontSize)
          Set the tick label font size
 void setX_AxisLabel(String xAxisLabel)
           
 void setX_AxisRange(double xMin, double xMax)
          sets the range for X axis
 void setXLog(boolean xLog)
           
 void setY_AxisLabel(String yAxisLabel)
           
 void setY_AxisRange(double yMin, double yMax)
          sets the range for Y axis
 void setYLog(boolean yLog)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphiWindowAPI_Impl

public GraphiWindowAPI_Impl(ArrayList funcs,
                            String plotTitle)

GraphiWindowAPI_Impl

public GraphiWindowAPI_Impl(XY_DataSet func,
                            String plotTitle)

GraphiWindowAPI_Impl

public GraphiWindowAPI_Impl(ArrayList funcs,
                            String plotTitle,
                            ArrayList<PlotCurveCharacterstics> plotChars)

GraphiWindowAPI_Impl

public GraphiWindowAPI_Impl(ArrayList funcs,
                            String plotTitle,
                            ArrayList<PlotCurveCharacterstics> plotChars,
                            boolean setVisible)

GraphiWindowAPI_Impl

public GraphiWindowAPI_Impl(PlotSpec plotSpec)
Method Detail

generateDefaultChars

protected static ArrayList<PlotCurveCharacterstics> generateDefaultChars(List funcs)

generateDefaultColors

public static List<Color> generateDefaultColors()

refreshPlot

public void refreshPlot()
Plot Graph using preferences


setPlotTitle

public void setPlotTitle(String plotTitle)
Set plot Title

Parameters:
plotTitle -

getPlotTitle

public String getPlotTitle()
Get plot title

Returns:

getCurveFunctionList

public ArrayList getCurveFunctionList()
Specified by:
getCurveFunctionList in interface GraphWindowAPI
Returns:
the List for all the ArbitrarilyDiscretizedFunctions and Weighted Function list.

setXLog

public void setXLog(boolean xLog)

setYLog

public void setYLog(boolean yLog)

getXLog

public boolean getXLog()
Specified by:
getXLog in interface GraphWindowAPI
Returns:
the boolean: Log for X-Axis Selected

getYLog

public boolean getYLog()
Specified by:
getYLog in interface GraphWindowAPI
Returns:
the boolean: Log for Y-Axis Selected

setX_AxisLabel

public void setX_AxisLabel(String xAxisLabel)

getXAxisLabel

public String getXAxisLabel()
Specified by:
getXAxisLabel in interface GraphWindowAPI

setY_AxisLabel

public void setY_AxisLabel(String yAxisLabel)

getYAxisLabel

public String getYAxisLabel()
Specified by:
getYAxisLabel in interface GraphWindowAPI

getPlottingFeatures

public ArrayList getPlottingFeatures()
Specified by:
getPlottingFeatures in interface GraphWindowAPI
Returns:
the plotting feature like width, color and shape type of each curve in list.

setPlottingFeatures

public void setPlottingFeatures(ArrayList<PlotCurveCharacterstics> curveCharacteristics)

setAllLineTypes

public void setAllLineTypes(PlotLineType lineType,
                            PlotSymbol symbol)

setAxisRange

public void setAxisRange(double xMin,
                         double xMax,
                         double yMin,
                         double yMax)
sets the range for X and Y axis

Parameters:
xMin - : minimum value for X-axis
xMax - : maximum value for X-axis
yMin - : minimum value for Y-axis
yMax - : maximum value for Y-axis

setX_AxisRange

public void setX_AxisRange(double xMin,
                           double xMax)
sets the range for X axis

Parameters:
xMin - : minimum value for X-axis
xMax - : maximum value for X-axis

setY_AxisRange

public void setY_AxisRange(double yMin,
                           double yMax)
sets the range for Y axis

Parameters:
yMin - : minimum value for Y-axis
yMax - : maximum value for Y-axis

isCustomAxis

public boolean isCustomAxis()
Whether this is custom axis

Specified by:
isCustomAxis in interface GraphWindowAPI
Returns:
boolean: Checks if Custom Axis is selected

setAutoRange

public void setAutoRange()
set the auto range for the axis.


getUserMinX

public double getUserMinX()
Specified by:
getUserMinX in interface GraphWindowAPI
Returns:
the Min X-Axis Range Value, if custom Axis is choosen

getUserMaxX

public double getUserMaxX()
Specified by:
getUserMaxX in interface GraphWindowAPI
Returns:
the Max X-Axis Range Value, if custom axis is choosen

getUserMinY

public double getUserMinY()
Specified by:
getUserMinY in interface GraphWindowAPI
Returns:
the Min Y-Axis Range Value, if custom axis is choosen

getUserMaxY

public double getUserMaxY()
Specified by:
getUserMaxY in interface GraphWindowAPI
Returns:
the Max Y-Axis Range Value, if custom axis is choosen

getY_AxisMin

public double getY_AxisMin()
This returns the current Y-axis minimum value

Returns:

getY_AxisMax

public double getY_AxisMax()
This returns the current Y-axis maximum value

Returns:

getX_AxisMin

public double getX_AxisMin()
This returns the current X-axis minimum value

Returns:

getX_AxisMax

public double getX_AxisMax()
This returns the current X-axis maximum value

Returns:

setPlotLabelFontSize

public void setPlotLabelFontSize(int fontSize)
Set plot label font size

Parameters:
fontSize -

setTickLabelFontSize

public void setTickLabelFontSize(int fontSize)
Set the tick label font size

Parameters:
fontSize -

setAxisLabelFontSize

public void setAxisLabelFontSize(int fontSize)
Set the axis label font size

Parameters:
fontSize -

getTickLabelFontSize

public int getTickLabelFontSize()
Returns:
the tick label font Default is 10

getPlotLabelFontSize

public int getPlotLabelFontSize()
Returns:
the axis label font size Default is 12

main

public static void main(String[] args)

saveAsPDF

public void saveAsPDF(String fileName)
               throws IOException
Throws:
IOException

saveAsPNG

public void saveAsPNG(String fileName)
               throws IOException
Throws:
IOException

getGraphWindow

public GraphWindow getGraphWindow()