public class StimuliSelector
extends java.lang.Object
==JZtxtcmd== List tab1 = ##content of tab1 [ { name="ident", descr="...", var="anyString", anyOtherVar="anyInfo" } , { name="ident2", descr="...", var="xyz", anyOtherVar="anyInfo" } ]; List tab2AnyIdent = ##content of tab2 [ { name="ident", descr="...", var="anyString", anyOtherVar="anyInfo" } , { name="ident2", descr="...", var="xyz", anyOtherVar="anyInfo" } ]; class ToGui ##determines how the tabs named. { List tdata1 = tab1; List tdata2 = tab2AnyIdent; } ##execute the following routine on selection button: sub btnGenSelection ( Map line1, Map line2, Map line3, Map line4, Map line5, Map line6){ <+out><&scriptdir>/<&scriptfile>: btnGenSelection (<: > <&line1.name>, <&line2.name>) ..... <.+n>; ... here some statements to create any output to use anywhere other from the selection. <.+> } sub btnGenTestcases ( String select) { if(jztc.envar.soRx) { ##hint: use definitely the script variable, not the local copy. .... }
Modifier and Type | Class and Description |
---|---|
(package private) class |
StimuliSelector.GralUserActionButton
An user action which calls
execBtnAction(String) , assigned to some Buttons. |
Modifier and Type | Field and Description |
---|---|
(package private) GralUserAction |
actionAddTestcases
Action for the button [add sel] invokes
addTestcases() |
(package private) GralUserAction |
actionCleanOut
Action for the button [clean] removes the text in the
output text box. |
(package private) GralUserAction |
actionDeselectLines
Action for the button [desel] invokes
deselectLines()() |
(package private) GralUserAction |
actionGenTestcases
Action for the button [gen test cases] invokes
genTestcases() |
(package private) GralUserAction |
actionHelp
Action for the button [help] yet improveable.
|
(package private) GralUserAction |
actionReadConfig
Action for the button [read config] calls
readConfig() |
(package private) GralUserAction |
actionSelectInTable
This action is only to remark which tables is last touched (line is selected).
|
(package private) GralUserAction |
actionShowSel
Action for the button [Show] calls
showSelectExpressionPart() |
(package private) GralUserAction |
actionTouchLine
Action for a double click on a line invokes
addTestCaseFromTable(org.vishia.gral.base.GralTable.TableLineData) |
(package private) GralUserAction |
actionTouchTestcaseString
Action is invoked if the text box was touched or changed, yet not used.
|
GralButton |
btnAddTestcase |
GralButton |
btnCleanOut |
GralButton |
btnDeselectLines |
GralButton |
btnExampleSel |
GralButton[] |
btnExecSelection |
GralButton |
btnGenSelection |
GralButton |
btnGenTestcases |
GralButton |
btnHelp |
GralButton |
btnReadConfig |
(package private) java.io.PrintStream |
errNew |
(package private) java.io.PrintStream |
errOld |
private JZtxtcmdExecuter |
executer |
java.io.File |
fileConfig |
(package private) GralMng |
gralMng |
(package private) boolean |
isTableInitialized |
private JZtxtcmd |
jzcmd |
(package private) LogMessage |
log |
(package private) java.io.PrintStream |
outNew |
(package private) java.io.PrintStream |
outOld |
GralTextBox |
output |
private JZtxtcmdScript |
script |
private java.util.Map<java.lang.String,<any>> |
selectorVariables
container to offer to the JZtxtcmd script.
|
private <any> |
soRxVar
This variable is accessible from JZtxtcmd execution.
|
private <any> |
thisVar
This variable is accessible from JZtxtcmd execution to access all elements in the graphic.
|
(package private) java.lang.String |
version
Version, history and license.
|
(package private) GralTable<java.util.Map<java.lang.String,<any>>> |
wdgLastSelectedTable
Set on selection of a line in a table, the last touched one.
|
GralTextBox |
wdgSelects |
(package private) GralTable<java.util.Map<java.lang.String,<any>>>[] |
wdgTables |
(package private) GralWindow |
window
The main window
|
Constructor and Description |
---|
StimuliSelector(java.lang.String fileConfig)
local ctor only from main
|
Modifier and Type | Method and Description |
---|---|
(package private) int |
addLineToSegm(java.lang.StringBuilder sbselect,
int nCursor,
GralTable.TableLineData line,
java.util.Map<java.lang.String,java.lang.String> alreadyContained)
Adds the key of the given line in this part of selection string
but only if it is not contained.
|
(package private) int |
addTestCaseAllTables(java.lang.StringBuilder sbselect,
int nCursor)
Adds the selection from all tables as initial string, called if the selection (part) is empty.
|
(package private) void |
addTestCaseFromTable(GralTable.TableLineData line)
Double click on one line
|
(package private) void |
addTestcases()
routine for Button [add sel]
It analyzes the given content in the
wdgSelects text box and marked lines in the tables
and produces the proper part of the selection expression. |
(package private) void |
deselectLines()
Routine for the button [desel] remove the mark in all table lines.
|
(package private) void |
execBtnAction(java.lang.String subroutine)
This is the common routine for all buttons which should call a sub routine from the JZtxtcmd control script.
|
(package private) void |
genTestcases()
Routine called from the button [gen test cases].
|
private java.lang.String |
getKeyfromLine(GralTable.TableLineData line)
Reads the key from the line of the table, internal.
|
(package private) int |
insertTestCase(java.lang.StringBuilder sbselect,
int nCursor,
boolean bNewTableEntry,
int nTable,
GralTable.TableLineData line)
Add the entry for one line of a table exactly on the cursor position.
|
static void |
main(java.lang.String[] args)
Start
|
static void |
openWindow() |
private void |
openWindow1(char size)
Initializes/creates the main window
|
(package private) int |
prcTablesInSelectionPart(java.lang.StringBuilder sbselect,
int nCursor,
int nTable,
GralTable.TableLineData lineSel,
boolean bMarkLinesInTable)
Processes the selected lines of all tables but only in the found part of the selection expression.
|
(package private) void |
readConfig()
Read and translate the JZtxtcmd to config the GUI
It is also invoked from the button [read config] on the opened GUI.
|
(package private) void |
showSelectExpressionPart()
Routine for button [show] shows the lines which are contained in the current part (cursor)
of the selection expression.
|
void |
waitForClosePrimaryWindow() |
java.lang.String version
soRxVar
and selectorVariables
accessible from the jzTc script via envar.
sub execSelection(Map line1, Map line2, Map line3, Map line4, Map line5, Map line6){...\it is more simple to build the output.
final LogMessage log
GralMng gralMng
GralWindow window
GralTable<java.util.Map<java.lang.String,<any>>>[] wdgTables
volatile GralTable<java.util.Map<java.lang.String,<any>>> wdgLastSelectedTable
public GralButton btnReadConfig
public GralButton btnGenSelection
public GralButton btnCleanOut
public GralButton btnGenTestcases
public GralButton btnAddTestcase
public GralButton btnDeselectLines
public GralButton btnExampleSel
public GralButton btnHelp
public GralButton[] btnExecSelection
public GralTextBox wdgSelects
public GralTextBox output
private final JZtxtcmd jzcmd
private JZtxtcmdExecuter executer
private JZtxtcmdScript script
boolean isTableInitialized
public final java.io.File fileConfig
private <any> soRxVar
org.vishia.communication.SocketCmd_InterProcessComm
using emC/soCmd/SocketCmd.exe on the other side as command line program.
private <any> thisVar
private final java.util.Map<java.lang.String,<any>> selectorVariables
java.io.PrintStream outOld
java.io.PrintStream errOld
java.io.PrintStream outNew
java.io.PrintStream errNew
GralUserAction actionReadConfig
readConfig()
GralUserAction actionGenTestcases
genTestcases()
GralUserAction actionAddTestcases
addTestcases()
GralUserAction actionDeselectLines
deselectLines()()
GralUserAction actionCleanOut
output
text box.GralUserAction actionTouchLine
addTestCaseFromTable(org.vishia.gral.base.GralTable.TableLineData)
GralUserAction actionSelectInTable
GralUserAction actionTouchTestcaseString
GralUserAction actionShowSel
showSelectExpressionPart()
GralUserAction actionHelp
StimuliSelector(java.lang.String fileConfig)
fileConfig
- immediately the command line argumentpublic static void main(java.lang.String[] args)
args
- only the JZtxcmd script path/to/config.jzt.cmdpublic static void openWindow()
private void openWindow1(char size)
size
- public void waitForClosePrimaryWindow()
void readConfig()
void execBtnAction(java.lang.String subroutine)
subroutine
- name of the sub routine in the JZtxtcmd script for this button.void genTestcases()
void addTestcases()
wdgSelects
text box and marked lines in the tables
and produces the proper part of the selection expression.
Calls addTestCaseAllTables(StringBuilder, int)
for an empty part in the expression
or calls prcTablesInSelectionPart(StringBuilder, int, int, org.vishia.gral.base.GralTable.TableLineData, boolean)
if some info are contained already.
int prcTablesInSelectionPart(java.lang.StringBuilder sbselect, int nCursor, int nTable, GralTable.TableLineData lineSel, boolean bMarkLinesInTable)
sbselect
- contains the content of the select textboxnCursor
- position of the cursor therenTable
- if given (>=0) then only this table is handled (because of double clicked of its line).
if -1, then check any table of selectionlineSel
- only used if nTable >=0, then this line.bMarkLinesInTable
- true then the found keys marks the lines in the table (other direction).private java.lang.String getKeyfromLine(GralTable.TableLineData line)
line
- int addLineToSegm(java.lang.StringBuilder sbselect, int nCursor, GralTable.TableLineData line, java.util.Map<java.lang.String,java.lang.String> alreadyContained)
sbselect
- contains the select expression, will be changednCursor
- cursor position where exactly should be inserted.line
- alreadyContained
- Map of all found keys (contained in the part of the select expression)int addTestCaseAllTables(java.lang.StringBuilder sbselect, int nCursor)
addTestcases()
if there is detected that the part is empty.
If some lines are marked, only this lines are used.
If no mark is given, the current lines of all tables are added.sbselect
- contains the select expression, will be changednCursor
- cursor position where exactly should be inserted. It is 0 if the field is empty,
or it can be after a ':' character.int insertTestCase(java.lang.StringBuilder sbselect, int nCursor, boolean bNewTableEntry, int nTable, GralTable.TableLineData line)
sbselect
- The StringBuffer contains the current content, will be changednCursor
- position where to insertbNewTableEntry
- true then write "<&nTable>=" for a new table, false then write ", "nTable
- The table number counted from 1 for the first.line
- The line of table, get key from therevoid addTestCaseFromTable(GralTable.TableLineData line)
line
- void deselectLines()
void showSelectExpressionPart()