public class GralScreen extends java.lang.Object implements GralPanel_ifc
GralWidget_ifc.ActionChange, GralWidget_ifc.ActionChangeWhen
Modifier and Type | Field and Description |
---|---|
private GralWindow |
focusedWindow |
private GralMng |
gralMng |
sVersion
Constructor and Description |
---|
GralScreen(GralMng gralMng) |
Modifier and Type | Method and Description |
---|---|
GralCanvasStorage |
canvas() |
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
GralWidget_ifc.setContentIdent(long) . |
java.lang.Object |
getContentInfo() |
java.lang.Object |
getData()
Gets the application specific info.
|
java.lang.String |
getDataPath() |
GralWidgetBase_ifc |
getFocusedWidget()
Returns the widget which is in focus of a panel or comprehensive widget.
|
GralWidget.ImplAccess |
getImplAccess()
This is used to access to the implementation widget instance.
|
java.lang.Object |
getImplWidget()
Returns the implementation widget or its Wrapper.
|
java.lang.String |
getName()
Access to the name of the widget.
|
GralWidget |
getPanelWidget() |
java.util.List<GralWidgetBase> |
getWidgetList() |
GralMng |
gralMng()
Returns the associated GralMng.
|
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 |
isInFocus()
Returns true if this widget is the focused one.
|
boolean |
isNotEditableOrShouldInitialize()
Query whether this field should be written from any initial or actual data.
|
boolean |
isVisible()
Returns whether the widget is visible or not.
|
GralPos |
pos()
Position of the widget, which refers also the
GralPos.parent . |
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
GralWidget_ifc.refreshFromVariable(VariableContainer_ifc)
but additionally the widget is shown as "too old" if the time stored with the variable is old. |
boolean |
remove() |
void |
removeWidget(GralWidget widg)
Only used internally
|
void |
setBackColor(GralColor color,
int ix)
Sets the background color for the widget.
|
GralColor |
setBackgroundColor(GralColor color) |
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()
Sets the focus to the widget. .
|
void |
setFocus(int delay,
int latest)
Sets the focus to the widget. .
|
void |
setFocused(boolean bGained)
This operation can be called from the implementation graphic if the focus is gained for an implementation widget.
|
void |
setFocusedWidget(GralWidgetBase_ifc widg)
If this widget is a comprehensive widget or a panel, it sets one of the content as focused.
|
GralColor |
setForegroundColor(GralColor color) |
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.
|
boolean |
setVisible(boolean visible)
Sets this widget visible on graphic or invisible.
|
private final GralMng gralMng
private GralWindow focusedWindow
public GralScreen(GralMng gralMng)
public java.lang.String getName()
GralWidgetBase_ifc
GralWidgetBase.name
immediately.getName
in interface GralWidgetBase_ifc
public java.lang.String getDataPath()
getDataPath
in interface GralWidget_ifc
public void setCmd(java.lang.String cmd)
GralWidget_ifc
GralWidget_ifc.getCmd()
independent of its name which can be set on runtime with this method.setCmd
in interface GralWidget_ifc
public java.lang.String getCmd()
GralWidget_ifc
GralWidget_ifc.setCmd(String)
.getCmd
in interface GralWidget_ifc
public void setData(java.lang.Object data)
GralWidget_ifc
setData
in interface GralWidget_ifc
public java.lang.Object getData()
GralWidget_ifc
#setContentInfo(Object)
.getData
in interface GralWidget_ifc
public GralWidget_ifc.ActionChange getActionChange(GralWidget_ifc.ActionChangeWhen when)
getActionChange
in interface GralWidget_ifc
public GralMng gralMng()
GralWidgetBase_ifc
gralMng
in interface GralWidgetBase_ifc
public void setFocus()
GralWidgetBase_ifc
setFocus
in interface GralWidgetBase_ifc
public void setFocus(int delay, int latest)
GralWidget_ifc
setFocus
in interface GralWidget_ifc
setFocus
in interface GralWidgetBase_ifc
public boolean isInFocus()
GralWidgetBase_ifc
isInFocus
in interface GralWidgetBase_ifc
public void setFocused(boolean bGained)
setFocused
in interface GralWidgetBase_ifc
bGained
- public boolean isGraphicDisposed()
GralWidget_ifc
isGraphicDisposed
in interface GralWidget_ifc
public boolean setVisible(boolean visible)
GralWidgetBase_ifc
GralWindow
, its the visibility of the whole window.
Note that a window which is invisible is not shown in the task bar of the operation system.
Note that an application can have more as one window.
Note that a dialog window can be set to invisible if it is not need yet instead destroy and build newly.setVisible
in interface GralWidgetBase_ifc
public boolean isVisible()
GralWidgetBase_ifc
isVisible
in interface GralWidgetBase_ifc
public void setEditable(boolean editable)
GralWidget_ifc
setEditable
in interface GralWidget_ifc
editable
- true then the content is going to be able to change.
False then the edit functionality is disabled.public boolean isEditable()
GralWidget_ifc
isEditable
in interface GralWidget_ifc
public boolean isNotEditableOrShouldInitialize()
GralWidget_ifc
isNotEditableOrShouldInitialize
in interface GralWidget_ifc
public GralColor setBackgroundColor(GralColor color)
setBackgroundColor
in interface GralWidget_ifc
public GralColor setForegroundColor(GralColor color)
setForegroundColor
in interface GralWidget_ifc
public void setBackColor(GralColor color, int ix)
GralWidget_ifc
setBackColor
in interface GralWidget_ifc
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.public GralColor getBackColor(int ix)
GralWidget_ifc
getBackColor
in interface GralWidget_ifc
ix
- 0 if only one color is supported, 1, ... if the widget has more as one background.public void setLineColor(GralColor color, int ix)
GralWidget_ifc
setLineColor
in interface GralWidget_ifc
color
- Any colorix
- 0 if only one color is supported, 1, ... if the widget has more as one line.public void setTextColor(GralColor color)
GralWidget_ifc
setTextColor
in interface GralWidget_ifc
color
- Any colorpublic void setText(java.lang.CharSequence text)
GralWidget_ifc
GralWidget_ifc.setBackColor(GralColor, int)
etc.
GralWidget_ifc.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.setText
in interface GralWidget_ifc
public void setHtmlHelp(java.lang.String url)
GralWidget_ifc
setHtmlHelp
in interface GralWidget_ifc
url
- String given url, maybe a local file too with #internalLabel.public GralWidget.ImplAccess getImplAccess()
GralWidgetBase_ifc
getImplAccess
in interface GralWidgetBase_ifc
public void redraw()
GralWidget_ifc
GralWidget_ifc.redraw(int, int)
redraw
in interface GralWidget_ifc
public void redraw(int delay, int latest)
GralWidget_ifc
redraw
in interface GralWidget_ifc
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.public void setBoundsPixel(int x, int y, int dx, int dy)
GralWidget_ifc
setBoundsPixel
in interface GralWidget_ifc
public void setDataPath(java.lang.String sDataPath)
GralWidget_ifc
GralWidget_ifc.refreshFromVariable(VariableContainer_ifc)
.setDataPath
in interface GralWidget_ifc
public boolean isChanged(boolean setUnchanged)
GralWidget_ifc
isChanged
in interface GralWidget_ifc
setUnchanged
- If true then set to unchanged with this call.public long setContentIdent(long ident)
GralWidget_ifc
GralWidget_ifc.getContentIdent()
.setContentIdent
in interface GralWidget_ifc
ident
- any number which identifies the value of content.public long getContentIdent()
GralWidget_ifc
GralWidget_ifc.setContentIdent(long)
.getContentIdent
in interface GralWidget_ifc
public java.lang.Object getContentInfo()
getContentInfo
in interface GralWidget_ifc
public void refreshFromVariable(VariableContainer_ifc container)
GralWidget_ifc
refreshFromVariable
in interface GralWidget_ifc
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 GralWidget_ifc.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)
.public void refreshFromVariable(VariableContainer_ifc container, long timeAtleast, GralColor colorRefreshed, GralColor colorOld)
GralWidget_ifc
GralWidget_ifc.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.refreshFromVariable
in interface GralWidget_ifc
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.public boolean remove()
public void setFocusedWidget(GralWidgetBase_ifc widg)
GralWidgetBase_ifc
setFocusedWidget
in interface GralWidgetBase_ifc
widg
- The sub widget which should be focused.
It influences for example the current tab of a tabbed panel,
or influences which widget of a comprehensive widget is first focused.
On a panel it determines which widget should get the focus if the panel gets the focus.public GralWidgetBase_ifc getFocusedWidget()
GralWidgetBase_ifc
getFocusedWidget
in interface GralWidgetBase_ifc
public GralWidget getPanelWidget()
getPanelWidget
in interface GralPanel_ifc
public java.util.List<GralWidgetBase> getWidgetList()
getWidgetList
in interface GralPanel_ifc
public GralPos pos()
GralWidgetBase_ifc
GralPos.parent
.
The parent in a GralPos has usual the reference to the GralMng
.pos
in interface GralPanel_ifc
pos
in interface GralWidgetBase_ifc
public GralCanvasStorage canvas()
canvas
in interface GralPanel_ifc
public void removeWidget(GralWidget widg)
GralPanel_ifc
removeWidget
in interface GralPanel_ifc
public java.lang.Object getImplWidget()
GralWidget_ifc
getImplWidget
in interface GralWidget_ifc