Class StaticChartMathExpression

All Implemented Interfaces:
IJLChartActionListener, ActionListener, MouseListener, MouseMotionListener, MouseWheelListener, ImageObserver, MenuContainer, Serializable, EventListener

public class StaticChartMathExpression extends AdvancedJLChart implements IJLChartActionListener
See Also:
  • Field Details

  • Constructor Details

    • StaticChartMathExpression

      public StaticChartMathExpression()
  • Method Details

    • showExpressionDialog

      public void showExpressionDialog()
      Display the expression dialog.
    • applyExpressionToChart

      public JLDataView applyExpressionToChart(String expression, JLDataView expressionDataView, int selectedAxis, String[] variables, boolean x)
      Call this method to evaluate an expression and have the result represented by a DataView you previously parametered
      Parameters:
      expression - The String representing your expression. It must not be null. Example: "cos(x1) + 2*sin(x2)/exp(x3)"
      expressionDataView - The JLDataView in which you want to put your expression evaluation result. It can be null. In this case, a JLDataView is automatically created.
      selectedAxis - The axis on which you want to put your DataView. It can be X_AXIS, Y1_AXIS or Y2_AXIS
      variables - A String[] representing the dataview names associated with your variables in order of the variables index. Example : You have two variables x1 and x2 in your expression. x1 is associated with the JLDataView named "theCurve", and x2 with the JLDataView named "theBar". Then, variables must be {"theCurve", "theBar"}.
      x - A boolean to know whether your expression looks like "f(x)". If your expression looks like "f(x1,...,xn)" then set x to false. If it looks like "f(x)", set x to true.
      Returns:
      The JLDataView used to draw the expression result (the one given in parameter if not null, the automatically created one otherwise). Returns null if you try to put an expression on x axis when it is not allowed
      See Also:
    • applyExpression

      protected JLDataView applyExpression(String expression, JLDataView expressionDataView, String[] variables, boolean x)
    • prepareViews

      public Vector<JLDataView> prepareViews()
    • clearExpressions

      public void clearExpressions()
    • updateExpressions

      protected void updateExpressions(JLDataView view)
    • actionPerformed

      public void actionPerformed(JLChartActionEvent evt)
      Description copied from interface: IJLChartActionListener
      Called when the user select a user action (available from contextual chart menu)
      Specified by:
      actionPerformed in interface IJLChartActionListener
      Parameters:
      evt - Event object (containing acion name and state)
      See Also:
    • getActionState

      public boolean getActionState(JLChartActionEvent evt)
      Description copied from interface: IJLChartActionListener
      Called when the the action name starting with 'chk' (displayed as check box menu item) and each time the chart menu is shown. if several listener handle the same action, the result will be a logical and of all results.
      Specified by:
      getActionState in interface IJLChartActionListener
      Parameters:
      evt - Event object (containing acion name)
      Returns:
      Action state (true to execute)
      See Also:
    • getConfiguration

      public String getConfiguration()
      Description copied from class: JLChart
      Build a configuration string that can be write into a file and is compatible with CfFileReader.
      Overrides:
      getConfiguration in class JLChart
      Returns:
      A string containing param.
      See Also:
    • applyConfiguration

      public void applyConfiguration(CfFileReader f)
      Description copied from class: JLChart
      Apply graph configuration. This includes all global settings. The CfFileReader object must have been filled by the caller.
      Overrides:
      applyConfiguration in class JLChart
      Parameters:
      f - Handle to CfFileReader object that contains global graph param
      See Also:
    • reset

      public void reset(boolean showConfirmDialog)
      Overrides:
      reset in class JLChart
    • main

      public static void main(String[] args)
    • isUseXViewsWithExpressions

      public boolean isUseXViewsWithExpressions()
      Returns:
      the useXViewsWithExpressions
    • setUseXViewsWithExpressions

      public void setUseXViewsWithExpressions(boolean useXViewsWithExpressions)
      Parameters:
      useXViewsWithExpressions - the useXViewsWithExpressions to set
    • isCanPutExpressionOnX

      public boolean isCanPutExpressionOnX()
      Returns:
      the canSetExpressionOnX
    • setCanPutExpressionOnX

      public void setCanPutExpressionOnX(boolean canSetExpressionOnX)
      Parameters:
      canSetExpressionOnX - the canSetExpressionOnX to set
    • removeDataView

      public void removeDataView(JLDataView view)
      Overrides:
      removeDataView in class JLChart