|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
jview.AbstractDisplayable
stella.jview.JElementDisplay
public class JElementDisplay
An element editor provides a GUI that allows easy editing of
ElementHelper instances. Basically it displays the variables known
to the element helper as a two-columned table. The first column holds
the name of the variable, while the second one holds the value. Various
displaying rules apply. Variables that are required
(UserAdjustable.getRequired()) are displayed in
KEY_MISSINGCOLOR
color if they are not defined and in KEY_DEFINEDCOLOR if they have
already a value assigned. Non-required variables are displayed in
KEY_NOTREQUIREDCOLOR. Variables that are not settable
(UserAdjustable.getSettable()) are displayed in grayed-out
labels, while settable parameters display their values in editable
fields.
| Nested Class Summary | |
|---|---|
static class |
JElementDisplay.Show
A class to test the layout. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static Color |
DEFDEFINEDCOLOR
The default missing color. |
private static Color |
DEFIDCOLOR
The default missing color. |
private static Insets |
DEFINSETS
The default insets. |
private static int |
DEFMAXLENGTH
The default maximum label length. |
private static Color |
DEFMISSINGCOLOR
The default missing color. |
private static Color |
DEFNOTREQUIREDCOLOR
The default missing color. |
private static String |
DEFNULL
The default string to display for null entries. |
private JPanel |
deliver
The component delivered for reference in the action listener. |
private UserAdjustable |
edit
The user-adjustable this editor applies to. |
static String |
KEY_DEFINEDCOLOR
The key to the color of missing required variables. |
static String |
KEY_IDCOLOR
The key to the color of missing required variables. |
static String |
KEY_MAXLENGTH
The maximum label length. |
static String |
KEY_MISSINGCOLOR
The key to the color of missing required variables. |
static String |
KEY_NOTREQUIREDCOLOR
The key to the color of missing required variables. |
static String |
KEY_NULL
The string to display on non-defined fields. |
private Map<JComponent,JLabel> |
labels
Mapping of labels to text fields as displayed. |
private JStatusField |
status
The status field messages should be piped to. |
| Fields inherited from class jview.AbstractDisplayable |
|---|
KEY_COMPONENTNAME, KEY_ICON, KEY_INSETS |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
JElementDisplay(Map prop)
Constructs a new element editor. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent ae)
Catches action events on the list-buttons and the value-fields. |
private void |
fillValues(Map<String,Object> vals,
Map<JComponent,JLabel> display)
Fills the values into the labels and text-fields (buttons) |
Component |
getRepresentation()
Delivers a panel consiting of a two-column table linking variables to their values. |
void |
registerStatusField(JStatusField writeout)
Assigns the status field for information messages. |
void |
registerUserAdjustable(UserAdjustable user)
Assigns the UserAdjustable to the editor. |
void |
updateFields()
Grabs all text entered in text fields and reports them to the underlying JUserAdjustable. |
| Methods inherited from class jview.AbstractDisplayable |
|---|
getComponentName, getIcon, getIcon |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Methods inherited from interface util.Initializable |
|---|
init |
| Field Detail |
|---|
public static final String KEY_IDCOLOR
public static final String KEY_MISSINGCOLOR
public static final String KEY_DEFINEDCOLOR
public static final String KEY_NOTREQUIREDCOLOR
public static final String KEY_NULL
public static final String KEY_MAXLENGTH
private static final Color DEFIDCOLOR
private static final Color DEFMISSINGCOLOR
private static final Color DEFDEFINEDCOLOR
private static final Color DEFNOTREQUIREDCOLOR
private static final Insets DEFINSETS
private static final int DEFMAXLENGTH
private static final String DEFNULL
private UserAdjustable edit
private Map<JComponent,JLabel> labels
private JPanel deliver
private JStatusField status
| Constructor Detail |
|---|
public JElementDisplay(Map prop)
UserAdjustable must be assigned to it.
| Method Detail |
|---|
public void registerUserAdjustable(UserAdjustable user)
UserAdjustable to the editor. Additionally
initializes the labels look-up table.
public void registerStatusField(JStatusField writeout)
public Component getRepresentation()
getRepresentation in interface Displayablepublic void actionPerformed(ActionEvent ae)
actionPerformed in interface ActionListenerpublic void updateFields()
JUserAdjustable.
private void fillValues(Map<String,Object> vals,
Map<JComponent,JLabel> display)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||