public class BaseConfig extends WidgetConfig
All the positional fields in the class hold either characters or pixels. The character fields
are: initColumn
, initRow
, column
, row
,
clientColumn
, clientRow
, widthChars
, heightChars
. The pixel
fields are: initX
, initY
, x
, y
, clientX
,
clientY
, widthPixels
, heightPixels
.
In addition to character and pixel units the client also deals with native (also called
physical) units. Native units are used by the output subsystems. The conversion from
pixels/characters to native units and also between character and pixel values is handled by
CoordinatesConversion
class. Also, assignments to the positional fields in this class
are converted automatically by SyncCoordinatesAspect
, for
example character value assigned to column
is automatically converted to pixel value
and assigned to x
.
Do we need to convert character to pixel values in ChUI mode and pixel to character values in GUI mode? Yes we do. In 4GL character attributes are synchronized with the pixel counterpart attributes and vice versa regardless whether in ChUI or GUI mode.
Why is there so many derivatives of the positional fields? Why is there initColumn
,
column
, clientColumn
and not just one "column" field? The reason is the
ability to encapsulate all the layout inputs in config instances and to honor the "single
responsibility principle". That is, limit the number of different semantics for the positional
fields depending on actual context.
The initial* fields hold the values assigned during frame definition. They must be stored separately from values assigned to positional 4GL attributes outside of frame definition as they have special meaning during frame layout. The client* fields are used to communicate the actual client widget location back to server, which may differ from the server-assigned location.
Modifier and Type | Field and Description |
---|---|
int |
align
Widget alignment.
|
int |
bgcolor
BGCOLOR option
|
int |
bgcolorRgb
BGCOLOR-RGB option
|
double |
clientColumn
The client COLUMN position of the widget.
|
double |
clientHeightChars
The height of the widget as calculated by the client.
|
int |
clientHeightPixels
The height of the widget as calculated by the client.
|
double |
clientRow
The client ROW position of the widget.
|
double |
clientWidthChars
The width of the widget as calculated by the client.
|
int |
clientWidthPixels
The width of the widget as calculated by the client.
|
int |
clientX
The client X position of the widget in pixel units.
|
int |
clientY
The client Y position of the widget in pixel units.
|
double |
column
The server-assigned COLUMN position of the widget.
|
Color |
dcolor
The color is used to render the widget.
|
boolean |
dynamic
Set to true if component is created dynamically by the runtime.
|
int |
fgcolor
FGCOLOR option
|
int |
fgcolorRgb
FGCOLOR-RGB option
|
boolean |
fixedHeight
This flag is set to true when HEIGHT-CHARS or HEIGHT-PIXELS attribute is set outside of the
frame setup phase.
|
boolean |
fixedWidth
This flag is set to true when WIDTH-CHARS or WIDTH-PIXELS attribute is set outside of the
frame setup phase.
|
int |
font
Font number.
|
boolean |
fontChanged
Flag indicating if font has been set via the widget's FONT attribute.
|
double |
frameColumnOffset
An offset from the left-side of the frame from which the widget is determined to be drawn,
at initial frame layout.
|
double |
frameRowOffset
An offset from the top of the frame from which the widget is determined to be drawn,
at initial frame layout.
|
int |
frameXOffset
An offset from the left-side of the frame from which the widget is determined to be drawn,
at initial frame layout.
|
int |
frameYOffset
An offset from the top of the frame from which the widget is determined to be drawn,
at initial frame layout.
|
double |
heightChars
The height of the widget.
|
int |
heightPixels
Rectangle height pixels
|
double |
initColumn
The initial COLUMN position of the widget set during frame setup
phase.
|
double |
initRow
The initial ROW position of the widget set during frame setup
phase.
|
int |
initX
The initial X position of the widget set during frame setup
phase.
|
int |
initY
The initial Y position of the widget set during frame setup
phase.
|
static int |
INV_COORD
Invalid coordinate value.
|
boolean |
locationChanged
Flag indicating if the location has been set by the server-side.
|
boolean |
movable
MOVABLE attribute.
|
java.lang.String |
name
The name attribute.
|
int |
parentId
The integer index of the parent in the array of configs.
|
Color |
pfcolor
The color of the widget under the focus.
|
boolean |
resizable
RESIZABLE attribute.
|
double |
row
The server-assigned ROW position of the widget.
|
boolean |
selected
SELECTED attribute.
|
int |
sysbgcolor
default BGCOLOR option
|
int |
sysfgcolor
default FGCOLOR option
|
boolean |
tabStop
The tab-stop attribute.
|
java.lang.String |
title
The title of the container.
|
Color |
titleDColor
TITLE-DCOLOR attribute variable.
|
int |
titleFont
The title font of the container.
|
java.lang.String |
tooltip
TOOLTIP option
|
boolean |
widgetPlaced
Flag indicating if the widget has been placed by the layout.
|
double |
widthChars
The width of the widget.
|
int |
widthPixels
Rectangle width pixels
|
int |
x
The server-assigned X position of the widget in pixel units.
|
int |
y
The server-assigned Y position of the widget in pixel units.
|
cfgClass, contextHelpId, disableRedraw, enabled, frameDefValue, frameId, header, hidden, id, manualHightlight, menuKey, menuMouse, modified, popupMenuId, realized, selectable, state, visible, wasRealized, zorder
Modifier | Constructor and Description |
---|---|
|
BaseConfig()
Default constructor (only used in deserialization).
|
protected |
BaseConfig(int id)
Create a new config and associate it with the given widget.
|
protected |
BaseConfig(WidgetId id)
Create a new config and associate it with the given widget.
|
Modifier and Type | Method and Description |
---|---|
void |
applyConfig(WidgetConfig config)
Set new values from the provided configuration instance.
|
void |
readExternal(java.io.ObjectInput in)
Replacement for the default object reading method.
|
void |
writeExternal(java.io.ObjectOutput out)
Replacement for the default object writing method.
|
getConfigManager, getDynamicColumnLabel, getDynamicFormat, getDynamicHelp, getDynamicLabel, setDynamicFormat, setDynamicHeader, setDynamicHelp, setDynamicLabel, setDynamicLabels, toString
public static final int INV_COORD
public int parentId
public boolean locationChanged
public double initColumn
Use ConfigHelper
to access the positional fields.
public double initRow
Use ConfigHelper
to access the positional fields.
public int initX
Use ConfigHelper
to access the positional fields.
public int initY
Use ConfigHelper
to access the positional fields.
public double column
Use ConfigHelper
to access the positional fields.
public double row
Use ConfigHelper
to access the positional fields.
public int x
Use ConfigHelper
to access the positional fields.
public int y
Use ConfigHelper
to access the positional fields.
public int frameXOffset
public double frameColumnOffset
public int frameYOffset
public double frameRowOffset
public double clientColumn
The "client" positional fields reflect the actual position set by client. This covers the cases when the server-assigned (and reported) position differs with the position calculated by client. The "client" positional fields are never assigned by server.
Use ConfigHelper
to access the positional fields.
public double clientRow
The "client" positional fields reflect the actual position set by client. This covers the cases when the server-assigned (and reported) position differs with the position calculated by client. The "client" positional fields are never assigned by server.
Use ConfigHelper
to access the positional fields.
public int clientX
The "client" positional fields reflect the actual position set by client. This covers the cases when the server-assigned (and reported) position differs with the position calculated by client. The "client" positional fields are never assigned by server.
Use ConfigHelper
to access the positional fields.
public int clientY
The "client" positional fields reflect the actual position set by client. This covers the cases when the server-assigned (and reported) position differs with the position calculated by client. The "client" positional fields are never assigned by server.
Use ConfigHelper
to access the positional fields.
public boolean fixedWidth
public boolean fixedHeight
public Color dcolor
public Color pfcolor
public double heightChars
public double widthChars
public double clientHeightChars
public double clientWidthChars
public int widthPixels
public int heightPixels
public int clientWidthPixels
public int clientHeightPixels
public boolean dynamic
public boolean tabStop
public java.lang.String name
public java.lang.String title
public int titleFont
public Color titleDColor
public int align
public int font
public boolean fontChanged
public java.lang.String tooltip
public int fgcolor
public int bgcolor
public int fgcolorRgb
public int bgcolorRgb
public int sysfgcolor
public int sysbgcolor
public boolean selected
public boolean movable
public boolean resizable
public transient boolean widgetPlaced
public BaseConfig()
protected BaseConfig(int id)
id
- The ID of the widget to which this configuration belongs.protected BaseConfig(WidgetId id)
id
- The ID of the widget to which this configuration belongs.public void applyConfig(WidgetConfig config)
applyConfig
in class WidgetConfig
config
- The instance from which to take values.public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class WidgetConfig
in
- 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.Externalizable
writeExternal
in class WidgetConfig
out
- The output destination to which fields will be saved.java.io.IOException
- In case of I/O errors.