public interface GralWidget_ifc extends GralWidgetBase_ifc
org.vishia.gral.base.GralGraphicThread
.
GralWidget_ifc
or methods of an derived GralWidget
such as GralTable
, for example setText(CharSequence)
, setTextColor(GralColor)
or org.vishia.gral.base.GralTable#setColorCurrLine(GralColor)
.
GralWidget.DynamicData
GralWidget.dyda
of the widget
or in specific data of a GralWidget implementation.
redraw(int, int)
with a proper millisecond delay (usual 100).
The graphic implementation widget is not touched in this time. Usual it is not necessary to show information
in a faster time than 100 ms if it is not a high speed animated graphic. The delayed repaint request
saves calculation time if more as one property is changed on the same widget.
GralWidget#repaintRequ
(only private visible)
of GralGraphicOrder
in the central queue of requests using
org.vishia.gral.base.GralGraphicThread#addDispatchOrder(org.vishia.gral.base.GralGraphicOrder)
.
The org.vishia.gral.base.GralGraphicThread
is known by GralWidgetBase.gralMng
.
GralGraphicOrder
. Any of them may have a specific delay.
The graphic thread organizes it in a proper kind of time.
GralGraphicOrder
is dequeued in the graphic thread,
its method org.vishia.gral.base.GralGraphicOrder#executeOrder(boolean)
is invoked.
This method calls GralWidgImplAccess_ifc.redrawGthread()
via the association GralWidget._wdgImpl
.
rerepaintGthread()
method is overridden in the implementation layer
with the necessary statements to transfer the non-graphic data of this GralWidget
especially
stored in GralWidget.dyda
to the special implementation widget method invocations
such as org.eclipse.swt.widgets.Text#setText(String)
which touches the graphic widget.
Then a org.eclipse.swt.widgets.Control#update()
and org.eclipse.swt.widgets.Control#redraw()
is invoked to show the content.
GralMngBuild_ifc
.Modifier and Type | Interface and Description |
---|---|
static class |
GralWidget_ifc.ActionChange |
static class |
GralWidget_ifc.ActionChangeWhen |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
sVersion
Version, history and license.
|
Modifier and Type | Method and Description |
---|---|
GralWidget_ifc.ActionChange |
getActionChange(GralWidget_ifc.ActionChangeWhen when) |
GralColor |
getBackColor(int ix)
Gets the background color for the widget.
|
java.lang.String |
getCmd()
Any widget can have a command String, which can be quest for example in an action.
|
long |
getContentIdent()
Gets the content identification of the users data which are set with
setContentIdent(long) . |
java.lang.Object |
getContentInfo() |
java.lang.Object |
getData()
Gets the application specific info.
|
java.lang.String |
getDataPath() |
java.lang.Object |
getImplWidget()
Returns the implementation widget or its Wrapper.
|
boolean |
isChanged(boolean setUnchanged)
Returns true if the content is changed from a user action on GUI.
|
boolean |
isEditable()
Query whether this widget is able to change from user handling.
|
boolean |
isGraphicDisposed()
Returns true if the graphic implementatin widget was initialized, and then it was disposed.
|
boolean |
isNotEditableOrShouldInitialize()
Query whether this field should be written from any initial or actual data.
|
void |
redraw()
repaint request.
|
void |
redraw(int delay,
int latest)
Possible delayed repaint, can be called in any thread.
|
void |
refreshFromVariable(VariableContainer_ifc container)
Capability for any widget to update its content from its associated variables described in its sDataPath.
|
void |
refreshFromVariable(VariableContainer_ifc container,
long timeAtleast,
GralColor colorRefreshed,
GralColor colorOld)
Capability of any widget for
refreshFromVariable(VariableContainer_ifc)
but additionally the widget is shown as "too old" if the time stored with the variable is old. |
void |
setBackColor(GralColor color,
int ix)
Sets the background color for the widget.
|
GralColor |
setBackgroundColor(GralColor color)
Deprecated.
|
void |
setBoundsPixel(int x,
int y,
int dx,
int dy)
This operation is used if the pixel are calculated on gral level.
|
void |
setCmd(java.lang.String cmd)
Any widget can have a command String, which can be quest for example in an action.
|
long |
setContentIdent(long ident)
Sets a identification for the shown data.
|
void |
setData(java.lang.Object data)
Sets a application specific data.
|
void |
setDataPath(java.lang.String sDataPath)
Sets the data path.
|
void |
setEditable(boolean editable)
Sets whether it is able to edit the content of the text field or text box.
|
void |
setFocus(int delay,
int latest)
Sets the focus to the widget. .
|
GralColor |
setForegroundColor(GralColor color)
Deprecated.
|
void |
setHtmlHelp(java.lang.String url)
Sets the html help url for this widget.
|
void |
setLineColor(GralColor color,
int ix)
Sets the line color for the widget.
|
void |
setText(java.lang.CharSequence text)
Set the text of the widget.
|
void |
setTextColor(GralColor color)
Sets the text color for the widget.
|
getFocusedWidget, getImplAccess, getName, gralMng, isInFocus, isVisible, pos, setFocus, setFocused, setFocusedWidget, setVisible
static final java.lang.String sVersion
isGraphicDisposed()
especially used for GralWindow-dispose detection.
#createImplWidget_Gthread()
. It is a better name.
#createImplWidget_Gthread()
without mng as parameter.
getData()
, setData(Object)
was existent as GralWidget.setContentInfo(Object)
,
now explicit property of any widget.
setCmd(String)
and getCmd()
is present in GralWidget
since 2010 but it was not accepted as core property. But it is a core property.
getContentIdent()
, setContentIdent(long)
isNotEditableOrShouldInitialize()
to support edit fields.
setBackColor(GralColor, int)
, setLineColor(GralColor, int)
and setTextColor(GralColor)
are declared here. What methods are deprecated? I thing setBackgroundColor(GralColor)
.
GralWidgetBase_ifc.setFocus()
and setFocus(int, int)
can be called in any thread yet.
#getWidgetMultiImplementations()
. This method is not used in any widget yet,
but it may be necessary for complex widgets.
refreshFromVariable(VariableContainer_ifc)
: Capability for any widget
to update its content from its associated variables described in its sDataPath.
GralWidgetBase_ifc.isVisible()
redraw()
, can be invoked in any thread. With delay possible.
java.lang.String getDataPath()
void setCmd(java.lang.String cmd)
getCmd()
independent of its name which can be set on runtime with this method.java.lang.String getCmd()
setCmd(String)
.void setData(java.lang.Object data)
java.lang.Object getData()
#setContentInfo(Object)
.GralWidget_ifc.ActionChange getActionChange(GralWidget_ifc.ActionChangeWhen when)
void setFocus(int delay, int latest)
setFocus
in interface GralWidgetBase_ifc
delay
- latest
- boolean isGraphicDisposed()
void setEditable(boolean editable)
editable
- true then the content is going to be able to change.
False then the edit functionality is disabled.boolean isEditable()
boolean isNotEditableOrShouldInitialize()
@Deprecated GralColor setBackgroundColor(GralColor color)
setBackColor(GralColor, int)
@Deprecated GralColor setForegroundColor(GralColor color)
setLineColor(GralColor, int)
void setBackColor(GralColor color, int ix)
color
- Any colorix
- -1 for non-specific, 0 for the first color or if only one color is supported, 1, ... if the widget has more as one background.GralColor getBackColor(int ix)
ix
- 0 if only one color is supported, 1, ... if the widget has more as one background.void setLineColor(GralColor color, int ix)
color
- Any colorix
- 0 if only one color is supported, 1, ... if the widget has more as one line.void setTextColor(GralColor color)
color
- Any colorvoid setText(java.lang.CharSequence text)
setBackColor(GralColor, int)
etc.
redraw(int, int)
is invoked with the standard delay of #redrawtDelay
and #redrawDelayMax
.
With that the widget-specific private instance of #repaintRequ
is added to the queue of requests
in the GralGraphicThread#addTimeEntry(GralGraphicOrder)
. In the requested time that
dispatch order is executed in the graphic thread. It calls GralWidgImplAccess_ifc.redrawGthread()
.
That method is implemented in the graphic implementation layer of the widget. It sets the appropriate values
from the independent Gral attributes to the implementation specifics and invoke a redraw of the graphic layer.
GralGraphicOrder
is queued. All changed attributes are stored in DynamicData#whatIsChanged
and the
GralWidgImplAccess_ifc.redrawGthread()
quests all changes one after another.
It means that a thread switch is invoked only one time per widget for more as one change.
DynamicData
. That composite part of a widget stores all standard dynamic data of a widget.void setHtmlHelp(java.lang.String url)
url
- String given url, maybe a local file too with #internalLabel.void redraw()
redraw(int, int)
void redraw(int delay, int latest)
delay
- in milliseconds. If 0 or less 0, then it is executed immediately if the calling
thread is the graphic thread.latest
- The latest draw time in milliseconds. If it is <= 0, then it is unused.
Note that a new call of repaint removes an existing repaint order to the new given time.
With the latest argument for this time the repaint is always executing independent of new calls.void setBoundsPixel(int x, int y, int dx, int dy)
x
- y
- dx
- dy
- void setDataPath(java.lang.String sDataPath)
refreshFromVariable(VariableContainer_ifc)
.sDataPath
- boolean isChanged(boolean setUnchanged)
setUnchanged
- If true then set to unchanged with this call.long setContentIdent(long ident)
getContentIdent()
.ident
- any number which identifies the value of content.long getContentIdent()
setContentIdent(long)
.java.lang.Object getContentInfo()
java.lang.Object getImplWidget()
void refreshFromVariable(VariableContainer_ifc container)
container
- The container is used only if the variable is not known by direct reference
in the private GralWidget.variable
or GralWidget.variables
. If the variable(s) is/are
not known, they are searched by there data path set by setDataPath(String)
. More as one
variables are possible separated by "," in the setDataPath("variable1, variable2").
The variables are searched in the container calling VariableContainer_ifc#getVariable(String)
.void refreshFromVariable(VariableContainer_ifc container, long timeAtleast, GralColor colorRefreshed, GralColor colorOld)
refreshFromVariable(VariableContainer_ifc)
but additionally the widget is shown as "too old" if the time stored with the variable is old.
This helps to show the state of fields for updating.container
- timeAtleast
- The absolute time stamp after them the variable should be gotten a new value.
It may be for example some seconds before the current time.colorRefreshed
- show with this background color if refreshedcolorOld
- show with this background color if not refresehed.