|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
jview.JExitFrame
jview.JConfirmExitFrame
jview.JBorderFrame
jview.JExpressionFrame
public class JExpressionFrame
An expression frame is a simple border frame that displays on its right hand side the external variables, its values plus a spinner to adjust the parameters.
| Nested Class Summary | |
|---|---|
static class |
JExpressionFrame.Show
Class to create the frame and display it. |
| Nested classes/interfaces inherited from class javax.swing.JFrame |
|---|
JFrame.AccessibleJFrame |
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
private JExpressionCanvas |
canvas
The expression canvas to put data on. |
private Map<String,NumberFormat> |
conserr
To format the constants errors. |
private Map<String,NumberFormat> |
consform
To format the constants. |
private Map<String,JLabel> |
constants
To trace constants. |
private Map<String,String> |
consunit
To units of the parameters. |
private Map<String,List<VectorG>> |
data
The original data. |
static String |
EQUAL
How I separate constant name from value in display labels. |
static String |
KEY_ADJUSTABLE
The names of the parameters that should be adjustable. |
static String |
KEY_ADJUSTINIT
The start-up values of the adjustable parameters. |
static String |
KEY_ADJUSTSTEP
The spinner-step values of the adjustable parameters. |
static String |
KEY_CANVAS
The properties of the expression canvas to show. |
static String |
KEY_FIXED
The mapping of fixed parameters to their values. |
static String |
KEY_FIXEDERROR
The mapping of fixed parameters to their errors number format. |
static String |
KEY_FIXEDFORMAT
The mapping of fixed parameters to their number format. |
static String |
KEY_FIXEDUNITS
The mapping of fixed parameters to their unit strings. |
private Map<String,MySpinner> |
spinners
To trace the new value. |
private Map<String,Number> |
vars
The mapping of variable names to their values. |
| Fields inherited from class jview.JBorderFrame |
|---|
DATACLEANSE, KEY_ABOUTURL, KEY_ACTIONCLASS, KEY_AIPLOGO, KEY_BIGGERSTRUT, KEY_DATAANALYSER, KEY_EASTALIGNMENT, KEY_FITTERS, KEY_FITTERTIPS, KEY_HELPSIZE, KEY_LESSERSTRUT, KEY_NOLOGO, KEY_NORTHALIGNMENT, KEY_SOUTHALIGNMENT, KEY_WESTALIGNMENT, MODELFITTER |
| Fields inherited from class javax.swing.JFrame |
|---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface jview.BorderLabels |
|---|
KEY_ABOUT, KEY_ABOUTACC, KEY_FILEACCS, KEY_FILEITEMS, KEY_FILEMENU, KEY_FILEMNEMONIC, KEY_HELPMENU, KEY_HELPMNEMONIC, KEY_HELPTITLE, KEY_NOHELP, KEY_NOURLACCESS, KEY_TITLE |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JExpressionFrame(LocalizedSupplying prop)
Constructs an expression frame from a property container. |
|
JExpressionFrame(Map<String,String> prop)
Constructs an expression frame from a property mapping. |
|
| Method Summary | |
|---|---|
protected boolean |
cache(String name,
Number val)
Caches a new variable value in our table. |
protected JExpressionCanvas |
createCanvas(ResourceSupplying pb)
The canvas is created from its properties here. |
protected List<VectorG> |
getData(String setname)
Gets the original data. |
private static Map<String,NumberFormat> |
getFormatMap(String token)
Propertizes the input string and parses the values as number formats. |
Component |
getRepresentation()
We return our expression canvas. |
protected List |
getRightItems()
We return the spinners and constant labels beneath to the right. |
Number |
getValue(String varname)
Returns the current value of the named variable. |
void |
init()
On init, we initialize the fixed parameter values. |
protected void |
replot(String ignore)
The later-invoked update process that can be called savely from the event-dispatch queue. |
void |
setData(String setname,
List<VectorG> plot)
Sets the data that should be displayed in the frames expression canvas. |
protected void |
updateCanvas()
Updates the canvas by ereasing all data and reconstructing it from the original data. |
private void |
updateConstant(String show,
double val,
double err)
External applications might know about constants on run-time, rather than on construct. |
private void |
updateSpinner(String name,
double val,
double step)
Re-adjusts the spinner to show these values. |
boolean |
updateVariable(String name,
double val,
double step)
We update a named variable. |
| Methods inherited from class jview.JConfirmExitFrame |
|---|
disposeAndExit, disposeImmediately |
| Methods inherited from class jview.JExitFrame |
|---|
setVisible |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
public static final String KEY_CANVAS
public static final String KEY_ADJUSTABLE
public static final String KEY_ADJUSTINIT
public static final String KEY_ADJUSTSTEP
public static final String KEY_FIXED
public static final String KEY_FIXEDFORMAT
public static final String KEY_FIXEDERROR
public static final String KEY_FIXEDUNITS
public static final String EQUAL
private JExpressionCanvas canvas
private Map<String,List<VectorG>> data
private Map<String,Number> vars
private Map<String,MySpinner> spinners
private Map<String,JLabel> constants
private Map<String,NumberFormat> consform
private Map<String,NumberFormat> conserr
private Map<String,String> consunit
| Constructor Detail |
|---|
public JExpressionFrame(Map<String,String> prop)
public JExpressionFrame(LocalizedSupplying prop)
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class JBorderFramepublic Component getRepresentation()
getRepresentation in interface DisplayablegetRepresentation in class JBorderFrame
public void setData(String setname,
List<VectorG> plot)
updateCanvas().
protected List<VectorG> getData(String setname)
public Number getValue(String varname)
protected JExpressionCanvas createCanvas(ResourceSupplying pb)
protected List getRightItems()
getRightItems in class JBorderFrame
public boolean updateVariable(String name,
double val,
double step)
protected boolean cache(String name,
Number val)
private void updateConstant(String show,
double val,
double err)
private void updateSpinner(String name,
double val,
double step)
protected void replot(String ignore)
protected void updateCanvas()
private static Map<String,NumberFormat> getFormatMap(String token)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||