public class ScreenDefinition
extends java.lang.Object
implements java.io.Externalizable
| Modifier and Type | Field and Description |
|---|---|
private int |
id
Root frame ID.
|
private java.util.Map<java.lang.Integer,java.lang.Integer> |
sideLabelParents
For each side-label, specify its parent.
|
private java.util.Map<java.lang.Integer,WidgetConfig> |
sideLabels
Map with the registered side-labels in this frame.
|
private boolean |
suppressRedraw
Suppress redraw on push of screen definition.
|
private java.util.LinkedHashMap<java.lang.Integer,WidgetConfig> |
widgets
The widget configuration data.
|
| Constructor and Description |
|---|
ScreenDefinition()
Default constructor (only used for serialization).
|
ScreenDefinition(int id)
The constructor creates a screen definition with the given root frame
ID.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConfig(WidgetConfig config)
Add a widget configuration to the current screen definition.
|
void |
addConfig(WidgetConfig config,
int widgetID)
Add a widget configuration (to the current screen definition) and
assign that widget the specified ID.
|
private void |
addConfigInt(WidgetConfig config)
Common worker to add a widget configuration to the screen definition.
|
void |
addSideLabel(int sideLabelId,
int widgetId)
Add a new side-label and associate it with the given widget.
|
boolean |
containsSideLabel(int widgetId)
Returns
true when the the screen side label ids contain the supplied widget id,
false otherwise. |
boolean |
containsWidget(int widgetId)
Returns
true when the the screen definition widget ids contain the supplied widget id,
false otherwise. |
WidgetConfig |
getConfig(int id)
Gets a specific widget configuration instance for the widget with the
ID provided.
|
java.util.Iterator<WidgetConfig> |
getConfigsIterator()
Get an iterator to enumerate all widget configurations inside this
screen definition.
|
int |
getRootFrameID()
Get the root frame ID.
|
int |
getSideLabelParent(int sideLabelId)
Get the parent widget for the given side-label.
|
java.util.Iterator<WidgetConfig> |
getSideLabelsIterator()
Get an iterator to enumerate all widget configurations inside this
screen definition.
|
java.util.ArrayList<java.lang.Integer> |
getWidgetsInFrame(int frameId)
Gets an array of all widget IDs in a given frame including any child
frames.
|
boolean |
isSideLabel(int widgetId)
Check if the given widget ID is for a side-label.
|
boolean |
isSuppressRedraw()
Get current value of 'suppress redraw' flag.
|
void |
readExternal(java.io.ObjectInput in)
Replacement for the default object reading method.
|
void |
removeConfig(WidgetConfig config)
Removes a widget configuration from the current screen definition.
|
void |
setSuppressRedraw(boolean suppressRedraw)
Set new value for 'suppress redraw' flag.
|
void |
writeExternal(java.io.ObjectOutput out)
Replacement for the default object writing method.
|
private java.util.LinkedHashMap<java.lang.Integer,WidgetConfig> widgets
private int id
private boolean suppressRedraw
private java.util.Map<java.lang.Integer,WidgetConfig> sideLabels
private java.util.Map<java.lang.Integer,java.lang.Integer> sideLabelParents
public ScreenDefinition()
public ScreenDefinition(int id)
id - Identifies the root frame (or the only frame if this is not
going to hold the configuration of a frame family).public int getRootFrameID()
public java.util.ArrayList<java.lang.Integer> getWidgetsInFrame(int frameId)
frameId - ID of the frame for which widget IDs are requested.public java.util.Iterator<WidgetConfig> getConfigsIterator()
public java.util.Iterator<WidgetConfig> getSideLabelsIterator()
public boolean containsWidget(int widgetId)
true when the the screen definition widget ids contain the supplied widget id,
false otherwise.widgetId - Widget id to check.public boolean containsSideLabel(int widgetId)
true when the the screen side label ids contain the supplied widget id,
false otherwise.widgetId - Widget id to check.public WidgetConfig getConfig(int id)
id - The widget ID.null otherwise.public void addConfig(WidgetConfig config)
config - New config to be added to the current screen definition.public void addConfig(WidgetConfig config, int widgetID)
config - New config to be added to the current screen definition.widgetID - Widget ID.public void removeConfig(WidgetConfig config)
config - The config to be removed from the current screen definition.public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablein - The input source from which fields will be restored.java.io.IOException - In case of I/O errors.java.lang.ClassNotFoundException - If payload can't be instantiated.public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizableout - The output destination to which fields will be saved.java.io.IOException - In case of I/O errors.public void setSuppressRedraw(boolean suppressRedraw)
suppressRedraw - New value of flag.public boolean isSuppressRedraw()
public void addSideLabel(int sideLabelId,
int widgetId)
sideLabelId - The label's ID.widgetId - The ID of the widget to which this label belongs.public boolean isSideLabel(int widgetId)
widgetId - The widget ID to be checked.true if the sideLabels maps contains an entry for this
widget ID.public int getSideLabelParent(int sideLabelId)
sideLabelId - The ID of the side label.sideLabelParents map.private void addConfigInt(WidgetConfig config)
config - Widget configuration.