public interface GralMngBuild_ifc
GralMng_ifc
.
GralMng
or this interface.
For example create SwtMng
.
#createGridPanel(GralColor, int, int, int, int)
and add the panel to the given
selectPanel(String)
.
setPositionSize(int, int, int, int, char)
in grid units
#setFinePositionSize(int, int, int, int, int, int, int, int, char)
#setNextPositionX()
#setPosition(float, float, float, float, char, int)
and GralWidget_ifc
.
GralWidget
Modifier and Type | Field and Description |
---|---|
static int |
propGridZoomedPanel |
static int |
propZoomedPanel |
static int |
version
The version of this interface:
2016-09-01 Hartmut chg: instead extends
ReplaceAlias_ifc now contains getReplacerAlias() . |
Modifier and Type | Method and Description |
---|---|
GralButton |
addButton(java.lang.String sName,
GralUserAction action,
java.lang.String sButtonText)
Adds a button
|
GralButton |
addButton(java.lang.String sName,
GralUserAction action,
java.lang.String sCmd,
java.lang.String sDataPath,
java.lang.String sButtonText)
Adds a button
|
GralButton |
addCheckButton(java.lang.String sName,
java.lang.String sButtonTextOn,
java.lang.String sButtonTextOff,
java.lang.String sButtonTextDisabled,
GralColor colorOn,
GralColor colorOff,
GralColor colorDisabled)
Adds a button which is switching on or off.
|
GralCurveView |
addCurveViewY(java.lang.String sName,
int nrofXvalues,
GralCurveView.CommonCurve common)
Adds a curve view for displaying values with ordinary x-coordinate.
|
GralTextField |
addFileSelectField(java.lang.String name,
java.util.List<java.lang.String> listRecentFiles,
java.lang.String startDirMask,
java.lang.String prompt,
java.lang.String promptStylePosition)
Adds a special text field to select a file.
|
void |
addFocusAction(GralWidget widgetInfo,
GralUserAction action,
java.lang.String sCmdEnter,
java.lang.String sCmdRelease)
Adds the given Focus action to the known widget.
|
GralWidget |
addFocusAction(java.lang.String sName,
GralUserAction action,
java.lang.String sCmdEnter,
java.lang.String sCmdRelease)
Adds the given Focus action to the named widget.
|
GralHtmlBox |
addHtmlBox(java.lang.String name)
Adds a box which presents html content.
|
java.lang.Object |
addImage(java.lang.String sName,
java.io.InputStream imageStream,
int height,
int width,
java.lang.String sCmd) |
GralLed |
addLed(java.lang.String sName,
java.lang.String sDataPath)
Adds a Led (round)
|
void |
addLine(GralColor color,
java.util.List<GralPoint> points)
Adds a line.
|
GralWidget |
addSlider(java.lang.String sName,
GralUserAction action,
java.lang.String sShowMethod,
java.lang.String sDataPath) |
GralButton |
addSwitchButton(java.lang.String sName,
GralUserAction action,
java.lang.String sCmd,
java.lang.String sDataPath,
java.lang.String sButtonText,
java.lang.String color0,
java.lang.String color1)
Adds a button which saves its state, pressed or non-pressed.
|
GralButton |
addSwitchButton(java.lang.String sName,
java.lang.String sButtonTextOff,
java.lang.String sButtonTextOn,
GralColor colorOff,
GralColor colorOn)
Adds a button which is switching on or off.
|
GralTabbedPanel |
addTabbedPanel(java.lang.String namePanel,
GralPanelActivated_ifc user,
int properties)
Adds a panel for tabs as child of the current panel.
|
GralWidget |
addText(java.lang.String sText)
Adds a text to the current panel at given position with standard colors, left origin.
|
GralWidget |
addText(java.lang.String sText,
int origin,
GralColor textColor,
GralColor BackColor)
Adds a simple text at the current position.
|
GralTextBox |
addTextBox(java.lang.String name,
boolean editable,
java.lang.String prompt,
char promptStylePosition)
Adds a box for editing or showing a text.
|
GralTextField |
addTextField(java.lang.String name,
boolean editable,
java.lang.String prompt,
java.lang.String promptStylePosition)
Adds a text field at the current position.
|
GralValueBar |
addValueBar(java.lang.String sName,
java.lang.String sDataPath) |
void |
buildCfg(GralCfgData data,
java.io.File fileCfg)
Sets the builder for content configuration.
|
GralPanelContent |
createCompositeBox(java.lang.String name)
Creates a box inside the current panel to hold some widgets.
|
GralFileDialog_ifc |
createFileDialog()
Creates a file or directory dialog.
|
GralPanelContent |
createGridPanel(java.lang.String namePanel,
GralColor backGround,
int xG,
int yG,
int xS,
int yS)
Creates an independent grid panel which is managed by this.
|
GralInfoBox |
createHtmlInfoBox(java.lang.String posString,
java.lang.String name,
java.lang.String title,
boolean onTop) |
void |
createImplWidget_Gthread(GralWidget widgg)
This routine is called from
GralWidget.setToPanel(GralMngBuild_ifc) . |
GralInfoBox |
createTextInfoBox(java.lang.String name,
java.lang.String title) |
GralColor |
getColor(java.lang.String sName)
Gets the named color.
|
int |
getColorValue(java.lang.String sName)
Gets the value to the named color.
|
GralUserAction |
getRegisteredUserAction(java.lang.String name) |
ReplaceAlias_ifc |
getReplacerAlias() |
java.util.Set<java.util.Map.Entry<java.lang.String,GralWidget>> |
getShowFields()
Returns a Set of all fields, which are created to show.
|
void |
registerPanel(GralPanelContent panel)
Registers a panel to place the widgets.
|
void |
registerUserAction(java.lang.String name,
GralUserAction action)
Registered any user action.
|
void |
registerWidget(GralWidget widgd)
Register all widgets, which are created in its own classes, not add here.
|
boolean |
remove(GralPanelContent compositeBox)
Removes a composite box from the graphic representation.
|
boolean |
remove(GralWidget widget) |
void |
repaint()
Forces a newly paint of the GUI-container.
|
void |
repaintCurrentPanel()
Forces a newly paint of the current panel.
|
java.lang.String |
saveCfg(java.io.Writer dest)
Saves the given configuration.
|
void |
selectPanel(GralPanelContent panel)
Selects the given panel as current panel to build some content.
|
void |
selectPanel(java.lang.String sName)
selects a registered panel for the next add-operations.
|
void |
selectPrimaryWindow()
Selects the primary window as current panel to build some content.
|
void |
setDesignMode(boolean mode)
Sets or resets the design mode.
|
void |
setFinePosition(int y,
int yFrac,
int yEnd,
int yEndFrac,
int x,
int xFrac,
int xEnd,
int xEndFrac,
int origin,
char direction,
int border,
int borderFrac,
GralPos frame)
Same as
setPositionSize(int, int, int, int, char) , but the positions can be in a fine division. |
GralUserAction |
setMainKeyAction(GralUserAction userKeyAction)
Sets the action for main keys.
|
void |
setPosition(float line,
float lineEndOrSize,
float column,
float columnEndOrSize,
int origin,
char direction)
Sets the position.
|
void |
setPosition(float line,
float lineEnd,
float column,
float columnEnd,
int origin,
char direction,
float border)
Sets the position with fine position given as float value.
|
void |
setPosition(GralPos framePos,
float line,
float lineEnd,
float column,
float columnEnd,
int origin,
char direction)
Sets the position in relation to a given position.
|
void |
setPosition(GralPos framePos,
float line,
float lineEnd,
float column,
float columnEnd,
int origin,
char direction,
float border) |
void |
setPositionSize(int line,
int column,
int height,
int length,
char direction)
Sets the position and size for the next widget to add in the container.
|
void |
setSize(int ySize,
int ySizeFrac,
int xSize,
int xSizeFrac)
Sets the next position if the position is used, but change the size.
|
static final int propGridZoomedPanel
static final int propZoomedPanel
static final int version
ReplaceAlias_ifc
now contains getReplacerAlias()
.
It is an extra class for a ReplacerAlias given independent of the graphic.
#createImplWidget_Gthread()
. It is a better name.
#addDataReplace(Map)
, #replaceDataPathPrefix(String)
.
using alias in the GralWidget.setDataPath(String)
. The resolving of the alias is done
only if the datapath is used.
addCheckButton(String, String, String, String, GralColor, GralColor, GralColor)
#setContextMenu(GralWidget, GralMenu)
.
addText(String)
simple with standards.
createWindow(String, String, int)
now not only exclusive or not
but with some control bits GralWindow_ifc.windExclusive
etc.
#addTextBox(GralWidget, boolean, String, char)
:
A Text box with more as one line. The TextField has only one line.
#createCompositeBox()
. It is a box with its own PanelMng
which is located in an area of another panel. (Composite)
#remove(GralGridBuild_ifc)
and remove(GralWidget)
to remove widgets, for dynamic views.
#createWindow(String, boolean)
instead createModalWindow(String).
This method should be used for any sub-windows in the application. The window position is determined
inside the current window with the known setPositionSize(int, int, int, int, char)
functionality.
The #createWindow(int, int, int, int, VariableContainer_ifc)
with absolute coordinates
may be deprecated. (Is it necessary to create a window outside the own borders? )
GralButton addButton(java.lang.String sName, GralUserAction action, java.lang.String sButtonText)
sButtonText
- text in the buttonheight
- in grid-unitswidth
- in grid-unigssCmd
- The command string will be transfered to the action-methodsUserAction
- The user action shoult be registered before
calling registerUserAction(String, GralUserAction)
sName
- GralButton addButton(java.lang.String sName, GralUserAction action, java.lang.String sCmd, java.lang.String sDataPath, java.lang.String sButtonText)
sButtonText
- text in the buttonheight
- in grid-unitswidth
- in grid-unigssCmd
- The command string will be transfered to the action-methodsUserAction
- The user action shoult be registered before
calling registerUserAction(String, GralUserAction)
sName
- GralButton addCheckButton(java.lang.String sName, java.lang.String sButtonTextOn, java.lang.String sButtonTextOff, java.lang.String sButtonTextDisabled, GralColor colorOn, GralColor colorOff, GralColor colorDisabled)
GralButton.isOn()
or GralWidget.getValue()
.sName
- sButtonText0
- sButtonText1
- color0
- color1
- GralCurveView addCurveViewY(java.lang.String sName, int nrofXvalues, GralCurveView.CommonCurve common)
sName
- Its registered namedyGrid
- height in grid-unitsdxGrid
- width in grid-unitsnrofXvalues
- depth of the buffer for x-values. It should be 6..20 times of dx.nrofTracks
- number of curves (tracks).GralTextField addFileSelectField(java.lang.String name, java.util.List<java.lang.String> listRecentFiles, java.lang.String startDirMask, java.lang.String prompt, java.lang.String promptStylePosition)
name
- Name of the widgetlistRecentFiles
- maybe null, a list which stores and offers selected files.defaultDir
- The start directory on open the dialog.startDirMask
- The start dir and selection mask. Both are separated with a ':' character
in this string. See GralFileDialog_ifc
.
If the last or only one char is '/' then a directory should be selected.
For example "D:/MyDir:*.txt" shows only .txt-files to select in the dialog starting from d:/MyDir.prompt
- Prompt for the text field.promptStylePosition
- void addFocusAction(GralWidget widgetInfo, GralUserAction action, java.lang.String sCmdEnter, java.lang.String sCmdRelease)
widgetInfo
- action
- sCmdEnter
- sCmdRelease
- GralWidget addFocusAction(java.lang.String sName, GralUserAction action, java.lang.String sCmdEnter, java.lang.String sCmdRelease)
sName
- The name of the widget. It should be registered calling any add... method.action
- sCmdEnter
- sCmdRelease
- GralHtmlBox addHtmlBox(java.lang.String name)
sName
- The registering namejava.lang.Object addImage(java.lang.String sName, java.io.InputStream imageStream, int height, int width, java.lang.String sCmd)
GralLed addLed(java.lang.String sName, java.lang.String sDataPath)
sName
- void addLine(GralColor color, java.util.List<GralPoint> points)
SwtCanvasStorePanel
. This class stores the line coordinates and conditions
and draws it as background if drawing is invoked.color
- points
- GralWidget addSlider(java.lang.String sName, GralUserAction action, java.lang.String sShowMethod, java.lang.String sDataPath)
GralButton addSwitchButton(java.lang.String sName, GralUserAction action, java.lang.String sCmd, java.lang.String sDataPath, java.lang.String sButtonText, java.lang.String color0, java.lang.String color1)
sName
- action
- sCmd
- sShowMethod
- sDataPath
- sButtonText
- GralButton addSwitchButton(java.lang.String sName, java.lang.String sButtonTextOff, java.lang.String sButtonTextOn, GralColor colorOff, GralColor colorOn)
GralButton.isOn()
or GralWidget.getValue()
.sName
- sButtonText0
- sButtonText1
- color0
- color1
- GralTabbedPanel addTabbedPanel(java.lang.String namePanel, GralPanelActivated_ifc user, int properties)
user
- If not null, then this user class will be notified when a tab is selected.
The user should update showed values.properties
- use or of constants propZoomedPanel
, propGridZoomedPanel
GralWidget addText(java.lang.String sText)
text
- GralWidget addText(java.lang.String sText, int origin, GralColor textColor, GralColor BackColor)
sText
- origin
- Origin, use char 1..9 for 1 top-left, 2 top-middle, ... 5 middle, 9 bottom-right.textColor
- BackColor
- GralTextBox addTextBox(java.lang.String name, boolean editable, java.lang.String prompt, char promptStylePosition)
GralMng_ifc.getValue(String)
with the given registering name.
#addActionFocused(String, GralUserAction, String)
can be called after invoking this method (any time, able to change). The GralUserAction#userActionGui(String, String, GralWidget, Map)
is called in the GUI-thread before the field gets the focus.
#addActionFocusRelease(String, GralUserAction, String)
can be called after invoking this method (any time, able to change). The adequate userActionGui is called after editing the field.
GralWidget#action
refers an instance of type GralUserAction
, than it is the action on finish editing.sName
- The registering namewidgetInfo
- The informations about the textfield.editable
- true than edit-able, false to show contentprompt
- If not null, than a description label is shownpromptStylePosition
- Position and size of description label:
upper case letter: normal font, lower case letter: small font
'l' left, 't' top (above field)GralTextField addTextField(java.lang.String name, boolean editable, java.lang.String prompt, java.lang.String promptStylePosition)
name
- The registering name to get the value from outside or set the content.editable
- true then an input field, false only for showprompt
- If not null, then this prompt text is shown above, left, rigthpromptStylePosition
- Position and size of description label:
upper case letter: normal font, lower case letter: small font
'l' left, 't' top (above field)GralValueBar addValueBar(java.lang.String sName, java.lang.String sDataPath)
void buildCfg(GralCfgData data, java.io.File fileCfg)
cfgBuilder
- GralPanelContent createCompositeBox(java.lang.String name)
GralFileDialog_ifc createFileDialog()
GralPanelContent createGridPanel(java.lang.String namePanel, GralColor backGround, int xG, int yG, int xS, int yS)
namePanel
- backGround
- xG
- yG
- xS
- yS
- GralInfoBox createHtmlInfoBox(java.lang.String posString, java.lang.String name, java.lang.String title, boolean onTop)
void createImplWidget_Gthread(GralWidget widgg)
GralWidget.setToPanel(GralMngBuild_ifc)
.
It is not intent to call from the application immediately. Use GralWidget.setToPanel(GralMngBuild_ifc)
instead.
The implementation of this routine checks the type of the widget and invokes the proper routine
for the implementation graphic in the implementation level of the GralMng
.widgg
- The widget should be initialized already.GralInfoBox createTextInfoBox(java.lang.String name, java.lang.String title)
GralColor getColor(java.lang.String sName)
sName
- supported: red, green, blue, yellowint getColorValue(java.lang.String sName)
sName
- supported: red, green, blue, yellowGralUserAction getRegisteredUserAction(java.lang.String name)
ReplaceAlias_ifc getReplacerAlias()
java.util.Set<java.util.Map.Entry<java.lang.String,GralWidget>> getShowFields()
void registerPanel(GralPanelContent panel)
selectPanel(String)
-Routine
name
- Name of the panel.panel
- The panel. It should be from the correct type of the base-graphic-system.
If it the instance is fault, a ClassCastException is thrown.void registerUserAction(java.lang.String name, GralUserAction action)
GralCfgBuilder.buildGui(org.vishia.msgDispatch.LogMessage, int)
is invoked.
The user actions can be called in any specialized context.
name
- Name of the actionaction
- what to do.void registerWidget(GralWidget widgd)
widgd
- boolean remove(GralPanelContent compositeBox)
compositeBox
- boolean remove(GralWidget widget)
void repaint()
void repaintCurrentPanel()
java.lang.String saveCfg(java.io.Writer dest)
dest
- void selectPanel(GralPanelContent panel)
void selectPanel(java.lang.String sName)
#registerPanel(String, Object)
.void selectPrimaryWindow()
void setDesignMode(boolean mode)
mode
- void setFinePosition(int y, int yFrac, int yEnd, int yEndFrac, int x, int xFrac, int xEnd, int xEndFrac, int origin, char direction, int border, int borderFrac, GralPos frame)
setPositionSize(int, int, int, int, char)
, but the positions can be in a fine division.y
- The line.yFrac
- Number between 0..9 for fine positioning in the grid step.yEnd
- yEndFrac
- Number between 0..9 for fine positioning in the grid step.x
- xFrac
- Number between 0..9 for fine positioning in the grid step.xEnd
- xEndFrac
- Number between 0..9 for fine positioning in the grid step.direction
- Direction of the next position if that is not given than or GralPos.next
is given than.
A value other then r, l, u, d let the direction unchanged from previous call.origin
- Origin of inner widgets or next widgets. Use:
1 4 7 2 5 8 3 6 9for the origin points. (origin-1) %3 is the horizontal origin, (origin-1 /3) is the vertical one. A value 0 let the origin unchanged from previous call.
GralUserAction setMainKeyAction(GralUserAction userKeyAction)
GralUserAction.userActionGui(int, GralWidget, Object...)
is invoked on any key down event,
exclusive some graphic implementation specific keys. The user should return false in this method
if the key is not used and should not be blocked for widget specific key listeners.userKeyAction
- The user action to process main keys.void setPosition(float line, float lineEndOrSize, float column, float columnEndOrSize, int origin, char direction)
framePos
- The given frame.line
- The line. Positive: from top, negative: from end.lineEndOrSize
- The position of end of widget. negative or 0: from end. 0: the end position of Panel.
see GralPos.same
etc.column
- columnEndOrSize
- void setPosition(float line, float lineEnd, float column, float columnEnd, int origin, char direction, float border)
GralPos
.line
- either position or combinded with GralPos.refer
etc.lineEnd
- column
- columnEnd
- origin
- see setFinePosition(int, int, int, int, int, int, int, int, int, char, int, int, GralPos)
direction
- border
- void setPosition(GralPos framePos, float line, float lineEnd, float column, float columnEnd, int origin, char direction)
framePos
- The given frame.line
- The linelineEnd
- column
- columnEnd
- void setPosition(GralPos framePos, float line, float lineEnd, float column, float columnEnd, int origin, char direction, float border)
void setPositionSize(int line, int column, int height, int length, char direction)
line
- y-Position in y-Units, count from top of the box.
It is either the top or bottom line of the widget, depending on height.
If < 0, then the previous position is valid furthermore.column
- x-Position in x-Units, count from left of the box.
If < 0, then the previous position is valid furthermore.heigth
- The height of the line. If <0, then the param line respectively the current line
will be used as bottom line of the next widget, and (line-height) is the top line.
If 0 then the last value of height is taken furthermore.length
- The number of columns. If <0, then the param column is the right column,
and column-length is the left column. If 0 then the last value of length is not changed.direction
- direction for a next widget, use 'r', 'l', 'u', 'd' for right, left, up, downvoid setSize(int ySize, int ySizeFrac, int xSize, int xSizeFrac)
ySize
- ySizeFrac
- xSize
- xSizeFrac
-