public final class GralTable.TableLineData extends GralTable.NodeTableLine implements MarkMask_ifc, GralTableLine_ifc<UserData>
TreeNodeBase.data
cellTexts
colorBackground
, colorForeground
markMask
TableLineData#bChanged
.
TreeNodeBase.IteratorDerivedImpl, TreeNodeBase.IteratorDerivedNode, TreeNodeBase.IteratorImpl, TreeNodeBase.IteratorMetaNode, TreeNodeBase.IteratorOneNode, TreeNodeBase.MetaNode<DerivedNode extends TreeNodeBase<DerivedNode,Data,IfcType> & SortedTree<IfcType>,Data,IfcType extends SortedTree<IfcType>>, TreeNodeBase.TreeNode<Data>
GralWidget_ifc.ActionChange, GralWidget_ifc.ActionChangeWhen
Modifier and Type | Field and Description |
---|---|
protected boolean[] |
bChangedEdit
True if any of a cell text was changed by manual edit.
|
protected boolean[] |
bChangedSet
True if any of a cell text was changed by manual edit.
|
GralColor[] |
cellColorBack
If not null, then a special background color for the cell.
|
java.lang.String[] |
cellTexts |
GralColor |
colorBackground |
GralColor |
colorBackMarked |
GralColor |
colorBackSelect |
GralColor |
colorBackSelectMarked |
GralColor |
colorBackSelectSomeMarked |
GralColor |
colorBackSomeMarked |
GralColor |
colorForeground |
java.util.concurrent.atomic.AtomicInteger |
ctRepaintLine
If a repaint is necessary, it is changed by increment by 1.
|
data, firstChild, idxChildren, key, lastChild, leafData, next, nrofChildren, parent, prev, version
version
sVersion
Modifier and Type | Method and Description |
---|---|
void |
createImplWidget_Gthread()
Sets this widget to the current panel at the current given position.
|
GralWidget_ifc.ActionChange |
getActionChange(GralWidget_ifc.ActionChangeWhen when) |
GralColor |
getBackColor(int ix)
Gets the background color for the widget.
|
java.lang.String |
getCellText(int column)
Returns the text which is assigned to the cell of the table.
|
java.lang.String[] |
getCellTexts() |
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() |
UserData |
getData()
Gets the application specific info.
|
java.lang.String |
getDataPath() |
int |
getMark()
Returns the selection mask of this object.
|
java.lang.String |
getName() |
int |
getSelectedColumn() |
GralTable<UserData> |
getTable()
Gets the table where this line is member of.
|
UserData |
getUserData()
Returns the instance which is related to the line on #setUserData or on construction.
|
GralMng |
gralMng()
Returns the associated singleton GralMng.
|
boolean |
isChanged(boolean setUnchanged)
Returns true if the content is changed from a user action on GUI.
|
boolean |
isEditable()
Query whether the table line is able to edit: Return from the whole table.
|
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.
|
GralTable.TableLineData |
parentNode() |
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) |
boolean |
remove()
Removes all referenced data, close all opened resources, removes all graphical widgets etc.
|
void |
repaint()
repaint request.
|
void |
repaint(int delay,
int latest)
Possible delayed repaint, can be called in any thread.
|
void |
setBackColor(GralColor colorNormal,
GralColor colorSelected,
GralColor colorMarked,
GralColor colorSomeMarked,
GralColor colorSelectMarked,
int ix)
Sets the background color for a special cell of line or for all cells of this line
which has not a special cell color for the several states of the line.
|
void |
setBackColor(GralColor color,
int ix)
Sets the background color of the whole line or one cell.
|
GralColor |
setBackgroundColor(GralColor color)
Deprecated.
|
void |
setBoundsPixel(int x,
int y,
int dx,
int dy) |
java.lang.String |
setCellText(java.lang.String text,
int column) |
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 date)
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. .
|
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.
|
int |
setMarked(int mask,
java.lang.Object data)
Sets the mark status of the line.
|
int |
setNonMarked(int mask,
java.lang.Object data)
Sets the mark status of the line.
|
void |
setText(java.lang.CharSequence text)
Set the text of the widget.
|
void |
setTextColor(GralColor color)
Sets the text color for the widget.
|
void |
setToPanel(GralMngBuild_ifc mng)
Deprecated.
|
boolean |
setVisible(boolean visible)
Sets this widget visible on graphic or invisible.
|
void |
showChildren(boolean show,
boolean bLeftGrandChildrenOpen)
Opens or closes showing children of this line.
|
void |
showChildren(boolean show,
boolean bLeftGrandChildrenOpen,
boolean showReally) |
java.lang.String |
toString() |
int |
treeDepth() |
boolean |
wasCelltextSet(int column) |
addChildLine, addNextLine, addPrevLine, deleteLine
addNode, addNode, addNodeFirst, addSiblingNext, addSiblingPrev, childNodes, childNodes, detach, firstChild, getChild, getContainerChildren, getKey, getNode, getOrCreateNode, getParent, getParentData, hasChildren, iterator, iteratorChildren, iteratorChildren, iterChildren, iterChildren, lastChild, listChildren, listChildren, movetoFirstChild, movetoSiblingNext, movetoSiblingPrev, newNode, nextSibling, nrofChildren, parent, parentEquals, prevSibling, removeChildren, swap, walkTree
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addChildLine, addNextLine, addPrevLine, deleteLine
getChild, getParent, iterChildren, iterChildren, listChildren, listChildren
addNode, addNode, addNodeFirst, addSiblingNext, detach, firstChild, getKey, getNode, getOrCreateNode, getParentData, hasChildren, iteratorChildren, iteratorChildren, lastChild, nextSibling, nrofChildren, parent, parentEquals, prevSibling, removeChildren
protected final boolean[] bChangedEdit
protected final boolean[] bChangedSet
public GralColor[] cellColorBack
colorBackground
of the line
or the GralTable.colorBackMarked
etc. of the table.public final java.lang.String[] cellTexts
public GralColor colorBackground
public GralColor colorBackMarked
public GralColor colorBackSelect
public GralColor colorBackSelectMarked
public GralColor colorBackSelectSomeMarked
public GralColor colorBackSomeMarked
public GralColor colorForeground
public java.util.concurrent.atomic.AtomicInteger ctRepaintLine
public void createImplWidget_Gthread()
GralWidget_ifc
GralMng.createImplWidget_Gthread(GralWidget)
which tests the type of the derived GralWidget
to create the correct graphical widget. That method calls the implementing specific GralMng.ImplAccess#createImplWidget_Gthread(GralWidget)
which knows the implementation graphic.
ImplAccess
. With them the GralWidget
is references because it is the environment class. The core graphical widget is an aggregation in this instance. It is possible
that more as one implementation widget is used for a Gral Widget implementation. For example a text field with a prompt
consists of two implementation widgets, the text field and a label for the prompt.
GralWidget#initPosAndRegisterWidget(GralPos)
which is called either
on construction of a widget with a String-given position, before it appears on graphic, or on construction of the
graphic widget. It calls the package private GralWidget#initPosAndRegisterWidget(GralPos)
, which takes the
given position, stores it in the GralWidget.pos()
and adds the widget both to its panel which is given
with the pos and registers the widget in the GralMng for simple global access.
If the name of the widget starts with "@" its name in the panel is the part after "@" whereby the global name
is the "panelname.widgetname". If a widget's position is given from left and from right or with percent, it is resized
on resizing the window and the panel.
createImplWidget_Gthread
in interface GralWidget_ifc
public GralWidget_ifc.ActionChange getActionChange(GralWidget_ifc.ActionChangeWhen when)
getActionChange
in interface GralWidget_ifc
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 java.lang.String getCellText(int column)
GralTableLine_ifc
getCellText
in interface GralTableLine_ifc<UserData>
column
- The column of table.public java.lang.String[] getCellTexts()
getCellTexts
in interface GralTableLine_ifc<UserData>
public java.lang.String getCmd()
GralWidget_ifc
GralWidget_ifc.setCmd(String)
.getCmd
in interface GralWidget_ifc
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 UserData getData()
GralWidget_ifc
#setContentInfo(Object)
.getData
in interface GralWidget_ifc
public java.lang.String getDataPath()
getDataPath
in interface GralWidget_ifc
public int getMark()
org.vishia.util.MarkMask_ifc
getMark
in interface MarkMask_ifc
public java.lang.String getName()
getName
in interface GralWidget_ifc
public int getSelectedColumn()
getSelectedColumn
in interface GralTableLine_ifc<UserData>
public GralTable<UserData> getTable()
getTable
in interface GralTableLine_ifc<UserData>
public UserData getUserData()
GralTableLine_ifc
getUserData
in interface GralTableLine_ifc<UserData>
public GralMng gralMng()
GralWidget_ifc
GralWidget_ifc.setToPanel(GralMngBuild_ifc)
.gralMng
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 boolean isEditable()
isEditable
in interface GralWidget_ifc
GralWidget_ifc.isEditable()
public boolean isGraphicDisposed()
GralWidget_ifc
isGraphicDisposed
in interface GralWidget_ifc
public boolean isInFocus()
GralWidget_ifc
isInFocus
in interface GralWidget_ifc
public boolean isNotEditableOrShouldInitialize()
GralWidget_ifc
isNotEditableOrShouldInitialize
in interface GralWidget_ifc
public boolean isVisible()
GralWidget_ifc
isVisible
in interface GralWidget_ifc
public GralTable.TableLineData parentNode()
parentNode
in interface GralTableLine_ifc<UserData>
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)
refreshFromVariable
in interface GralWidget_ifc
public boolean remove()
org.vishia.util.Removeable
remove
in interface Removeable
public void repaint()
GralWidget_ifc
GralWidget_ifc.repaint(int, int)
repaint
in interface GralWidget_ifc
public void repaint(int delay, int latest)
GralWidget_ifc
repaint
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 less 0, then it is unused.
If it is 0 or less delay if a delay is given, then the delay isn't wound up on re-call.public void setBackColor(GralColor colorNormal, GralColor colorSelected, GralColor colorMarked, GralColor colorSomeMarked, GralColor colorSelectMarked, int ix)
setBackColor
in interface GralTableLine_ifc<UserData>
colorNormal
- non selected, non markedcolorSelected
- non marked, the selected line.colorMarked
- marked, not the selected linecolorSomeMarked
- some marked, not the selected linecolorSelectMarked
- marked or some marked, the selected line.ix
- -1 for the line, 0... for one cell of the line.public void setBackColor(GralColor color, int ix)
setBackColor
in interface GralWidget_ifc
ix
- -1 for the whole line, >=0 for one cell.color
- Any color@Deprecated public GralColor setBackgroundColor(GralColor color)
setBackgroundColor
in interface GralWidget_ifc
public void setBoundsPixel(int x, int y, int dx, int dy)
setBoundsPixel
in interface GralWidget_ifc
public java.lang.String setCellText(java.lang.String text, int column)
setCellText
in interface GralTableLine_ifc<UserData>
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 long setContentIdent(long date)
GralWidget_ifc
GralWidget_ifc.getContentIdent()
.setContentIdent
in interface GralWidget_ifc
date
- any number which identifies the value of content.public void setData(java.lang.Object data)
GralWidget_ifc
setData
in interface GralWidget_ifc
public void setDataPath(java.lang.String sDataPath)
GralWidget_ifc
GralWidget_ifc.refreshFromVariable(VariableContainer_ifc)
.setDataPath
in interface GralWidget_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 void setFocus()
GralWidget_ifc
setFocus
in interface GralWidget_ifc
public void setFocus(int delay, int latest)
GralWidget_ifc
setFocus
in interface GralWidget_ifc
@Deprecated public GralColor setForegroundColor(GralColor color)
setForegroundColor
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 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 int setMarked(int mask, java.lang.Object data)
GralTable.specifyActionOnLineMarked(MarkMask_ifc)
with the given getUserData()
of this line. It means a selection with the user data
may be done too. This method will be called especially on pressing the mark key specified with
GralTable.specifyKeysMarkUpDn(int, int)
setMarked
in interface MarkMask_ifc
mask
- This bits of the SelectMask.selectMask
will be set.data
- if null then don't invoke GralTable.specifyActionOnLineMarked(MarkMask_ifc)
SelectMask.setNonMarked(int, java.lang.Object)
public int setNonMarked(int mask, java.lang.Object data)
GralTable.specifyActionOnLineMarked(MarkMask_ifc)
with the given #setUserData(Object)
of this line. It means a selection with the user data
may be done too. This method will be called especially on pressing the mark key specified with
GralTable.specifyKeysMarkUpDn(int, int)
setNonMarked
in interface MarkMask_ifc
mask
- This bits of the SelectMask.selectMask
will be reseted.data
- if null then don't invoke GralTable.specifyActionOnLineMarked(MarkMask_ifc)
SelectMask.setNonMarked(int, java.lang.Object)
public void setText(java.lang.CharSequence text)
GralWidget_ifc
GralWidget_ifc.setBackColor(GralColor, int)
etc.
GralWidget_ifc.repaint(int, int)
is invoked with the standard delay of #repaintDelay
and #repaintDelayMax
.
With that the widget-specific private instance of #repaintRequ
is added to the queue of requests
in the GralGraphicThread#addTimeOrder(GralGraphicTimeOrder)
. In the requested time that
dispatch order is executed in the graphic thread. It calls GralWidgImpl_ifc.repaintGthread()
.
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.
GralGraphicTimeOrder
is queued. All changed attributes are stored in DynamicData#whatIsChanged
and the
GralWidgImpl_ifc.repaintGthread()
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 setTextColor(GralColor color)
GralWidget_ifc
setTextColor
in interface GralWidget_ifc
color
- Any colorpublic void setToPanel(GralMngBuild_ifc mng)
GralWidget_ifc
GralWidget_ifc.createImplWidget_Gthread()
.setToPanel
in interface GralWidget_ifc
mng
- not used. It is known as singleton. Use null as argument.public boolean setVisible(boolean visible)
GralWidget_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 GralWidget_ifc
public void showChildren(boolean show, boolean bLeftGrandChildrenOpen)
GralTableLine_ifc
showChildren
in interface GralTableLine_ifc<UserData>
show
- true then show, false then close this bough.bLeftGrandChildrenOpen
- if show==true, false then close sub children boughs of this, true left opened grand children open.
This is an important behavior of operating with a tree view. Both variants are desirable in different situations.public void showChildren(boolean show, boolean bLeftGrandChildrenOpen, boolean showReally)
showChildren
in interface GralTableLine_ifc<UserData>
public java.lang.String toString()
toString
in class TreeNodeBase<GralTable.TableLineData,UserData,GralTableLine_ifc<UserData>>
public int treeDepth()
public boolean wasCelltextSet(int column)