Venice 0.751beta

nz.org.venice.ui
Class ExpressionEditorDialog

java.lang.Object
  extended bynz.org.venice.ui.ExpressionEditorDialog

public class ExpressionEditorDialog
extends java.lang.Object

A dialog for adding, editing and viewing stored expressions. A stored expression is an expression with a name that is saved in user preferences. Stored expressions can be quickly recalled (and modified) anywhere Venice accepts expressions.

Author:
Andrew Leppard
See Also:
StoredExpression, EquationPage, Expression

Method Summary
static StoredExpression showAddDialog(java.util.List storedExpressions, java.lang.String title)
          Show a dialog which allows the user to add a new stored expression.
static StoredExpression showAddDialog(java.util.List storedExpressions, java.lang.String title, java.lang.String expression)
          Show a dialog which allows the user to add a new stored expression.
static StoredExpression showAddDialog(java.lang.String title, java.lang.String expression)
          Show a dialog which allows the user to add a new stored expression.
static StoredExpression showEditDialog(java.util.List storedExpressions, java.lang.String title, StoredExpression storedExpression)
          Show a dialog which allows the user to edit a current stored expression.
static java.lang.String showEditDialog(java.lang.String title, java.lang.String expression)
          Show a dialog which allows the user to edit a current stored expression.
static void showViewDialog(java.lang.String title, java.lang.String expression)
          Show a dialog which allows the user to view a current stored expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

showAddDialog

public static StoredExpression showAddDialog(java.util.List storedExpressions,
                                             java.lang.String title,
                                             java.lang.String expression)
Show a dialog which allows the user to add a new stored expression. Make sure you run this in its own thread - not in the swing dispatch thread!

Parameters:
storedExpressions - current stored expressions.
title - title of dialog.
expression - initial expression text
Returns:
New stored expression or null if the user cancelled the dialog.

showAddDialog

public static StoredExpression showAddDialog(java.util.List storedExpressions,
                                             java.lang.String title)
Show a dialog which allows the user to add a new stored expression. Make sure you run this in its own thread - not in the swing dispatch thread!

Parameters:
storedExpressions - current stored expressions.
title - title of dialog.
Returns:
New stored expression or null if the user cancelled the dialog.

showAddDialog

public static StoredExpression showAddDialog(java.lang.String title,
                                             java.lang.String expression)
Show a dialog which allows the user to add a new stored expression. Make sure you run this in its own thread - not in the swing dispatch thread!

Parameters:
title - title of dialog.
expression - initial expression text
Returns:
New stored expression or null if the user cancelled the dialog.

showEditDialog

public static java.lang.String showEditDialog(java.lang.String title,
                                              java.lang.String expression)
Show a dialog which allows the user to edit a current stored expression. Make sure you run this in its own thread - not in the swing dispatch thread!

Parameters:
title - title of dialog.
expression - current expression text
Returns:
Edited expression text.

showEditDialog

public static StoredExpression showEditDialog(java.util.List storedExpressions,
                                              java.lang.String title,
                                              StoredExpression storedExpression)
Show a dialog which allows the user to edit a current stored expression. Make sure you run this in its own thread - not in the swing dispatch thread!

Parameters:
storedExpressions - current stored expressions.
title - title of dialog.
storedExpression - current expression.
Returns:
Edited stored expression.

showViewDialog

public static void showViewDialog(java.lang.String title,
                                  java.lang.String expression)
Show a dialog which allows the user to view a current stored expression. Make sure you run this in its own thread - not in the swing dispatch thread!

Parameters:
title - title of dialog.
expression - expression text

Venice 0.751beta