public class GralMng extends EventTimerThread implements GralMngBuild_ifc, GralMng_ifc
GralMng
is a common approach to work with graphical interface simply.
The inner class GralMng.ImplAccess
is implemented by the several graphic-system-supporting classes.
GralPos
instances referred here are not recommended. It's the deprecated concept.
Use own instances for refPos to build the Gral Graphic.
getWidget(String)
returns the reference to the named widget.
getWidgetIter()
returns an iterator over all widgets.
runGraphicThread()
: This is called firstly on implementing the graphic.
createImplWidget_Gthread(GralWidget)
: This operation need to be overridden in the implementation graphic,
see SwtMng.createImplWidget_Gthread(GralWidget)
.
This operation checks all kinds of widget (should know all)
and selects (switch-case) and creates the proper mapping implementation widgets.
Modifier and Type | Class and Description |
---|---|
static class |
GralMng.FileSelectInfo
This class is used for a selection field for file names and paths.
|
class |
GralMng.GralMngFocusListener
This standard Gral focus listener is the base class for the common implementation layer focus listener.
|
static class |
GralMng.ImplAccess
This class is used only for the implementation level of the graphic.
|
class |
GralMng.InternalPublic
This inner class is public only because the implementation uses it.
|
static class |
GralMng.LogMsg
This class defines only static numbers for messages.
|
(package private) static class |
GralMng.PosThreadSafe |
Modifier and Type | Field and Description |
---|---|
GralMng.InternalPublic |
_implListener
Implementation specific fields.
|
GralMng.ImplAccess |
_mngImpl
The graphic specific implementation part of the GralMng
This implementation should care about the correct implementation widgets.
|
GralUserAction |
actionClose
This is one action to close the whole application.
|
GralUserAction |
actionDesignEditField
Action to edit the properties of one widget in the graphic.
|
GralUserAction |
actionFileSelect |
GralUserAction |
actionHelp |
GralPanelActivated_ifc |
actionPanelActivate |
GralUserAction |
actionReadPanelCfg
Action to edit the properties of one widget in the graphic.
|
(package private) GralUserAction |
actionShowWidgetInfos |
protected GralMngApplAdapter_ifc |
applAdapter |
private java.lang.Thread |
awakeThread |
protected boolean |
bBelow
True if the next element should be placed below the last.
|
protected boolean |
bDesignerIsInitialized
Some actions may be processed by a user implementation.
|
boolean |
bDesignMode |
private boolean |
bDispatcherSleeps
True then the dispatcher sleeps, does not work.
|
protected boolean |
bExitMain
Set to true to finish the main.
|
protected boolean |
bIsExitImplGraphic |
protected boolean |
bRigth
True if the next element should be placed below the last.
|
protected boolean |
bShouldExitImplGraphic
set to true to exit the graphic thread and dispose the implementation graphic
|
protected boolean |
bShouldExitMain
Set to true to finish the main.
|
protected boolean |
bStarted
True if the startup of the main window is done and the main window is visible.
|
private GralCfgData |
cfgData |
(package private) GralCfgWriter |
cfgWriter |
protected MinMaxTime |
checkTimes
Instance to measure execution times.
|
java.util.List<GralCurveView_ifc> |
curveContainer
Deprecated.
|
private java.util.Map<java.lang.String,java.lang.String> |
dataReplace
Map of replacements of paths to data.
|
(package private) boolean |
debugPrint |
protected GralCfgDesigner |
designer
The designer is an aggregated part of the PanelManager, but only created if necessary.
|
EventSource |
evSrc |
GralMng.GralMngFocusListener |
gralFocusListener
This instance can be used if any other focus listener is necessary for any implementation widget.
|
GralGridProperties |
gralProps
Properties of the Gui appearance.
|
protected long |
graphicThreadId
The thread id of the managing thread for graphic actions.
|
protected java.util.Map<java.lang.String,GralWidgetBase> |
idxNameWidgets
Index of all input fields to access symbolic for all panels.
|
protected java.util.Map<java.lang.String,GralPanel_ifc> |
idxPanels
Map of all panels.
|
protected java.util.Map<java.lang.String,GralWidget> |
idxShowFields
Index of all input fields to access symbolic.
|
protected java.util.Map<java.lang.String,GralWindow> |
idxWindows
Map of all windows.
|
GralInfoBox |
infoBox
Three windows as sub window for html help, info and logging created if the primary window is created.
|
GralInfoBox |
infoHelp
Three windows as sub window for html help, info and logging created if the primary window is created.
|
GralInfoBox |
infoLog
Three windows as sub window for html help, info and logging created if the primary window is created.
|
protected boolean |
isWakedUpOnly |
private GralWidget_ifc |
lastClickedWidget
Last focused widget or last selected line in a table.
|
protected java.util.concurrent.ConcurrentLinkedQueue<GralVisibleWidgets_ifc> |
listVisiblePanels
List of all panels which may be visible yet.
|
(package private) java.util.Queue<GralWidget> |
listWidgetsPermanentUpdating |
LogMessage |
log
It is possible to write any message via this class to a logging system.
|
private GralMng.PosThreadSafe |
posCurrent
The current position as helper if it is the same thread.
|
private java.util.Map<java.lang.Long,GralMng.PosThreadSafe> |
posThreadSafe |
GralGridProperties.ImplAccess |
propertiesGui
Properties of the Gui appearance.
|
private java.util.concurrent.ConcurrentLinkedQueue<GralGraphicOrder> |
queueOrdersToExecute
Queue of orders to execute in the graphic thread before dispatching system events.
|
(package private) InspcReplAlias |
replacerAlias |
private java.lang.Runnable |
runAwakeThread |
private java.lang.Runnable |
runGraphicThread |
GralPanel_ifc |
screen
Representation of the 'whole screen' as parent for a window.
|
protected java.lang.String |
sCurrPanel
Any kind of TabPanel for this PanelManager TODO make protected
|
private java.lang.String |
sHelpBase |
static java.lang.String |
sVersion
Version, history and license.
|
protected java.util.Map<java.lang.String,GralUserAction> |
userActions
Index of all user actions, which are able to use in Button etc.
|
protected GralUserAction |
userMainKeyAction |
private java.util.List<GralWidget> |
widgetsInFocus |
private GralWindow |
windPrimary
The one instance of the primary window created in the
org/vishia/ifc/GralFactory#createWindow(String, String, int) . |
(package private) GralCfgBuilder |
XXXcfgBuilder
This instance helps to create the Dialog Widget as part of the whole window.
|
private static GralMng |
XXXsingleton |
propGridZoomedPanel, propZoomedPanel, version
cmdBackColor, cmdClear, cmdCloseWindow, cmdColor, cmdInsert, cmdLineColor, cmdRedraw, cmdRemove, cmdSelect, cmdSet, cmdSetWindowVisible, cmdTextColor, version
Constructor and Description |
---|
GralMng() |
GralMng(LogMessage log)
Creates the GralMng with a given logging output,
|
Modifier and Type | Method and Description |
---|---|
GralArea9Panel |
addArea9Panel(java.lang.String posName)
Add a panel with 9 areas to any other panel or window.
|
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 |
addButton(java.lang.String sName,
java.lang.String sButtonText,
GralUserAction action) |
GralButton |
addCheckButton(java.lang.String sPosName,
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 sPosName,
int nrofXvalues,
GralCurveView.CommonCurve common,
TimedValues tracksValues)
Adds a curve view for displaying values with ordinary x-coordinate.
|
void |
addDispatchOrder(GralGraphicOrder order)
Adds the order to execute in the graphic dispatching thread.
|
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) |
void |
addInfo(java.lang.CharSequence info,
boolean show) |
GralLed |
addLed(java.lang.String sName,
java.lang.String sDataPath)
Adds a Led (round)
|
void |
addLine(GralColor color,
java.util.List<GralPoint> points)
Deprecated.
|
void |
addLine(int colorValue,
float xa,
float ya,
float xe,
float ye)
Deprecated.
|
GralPanelContent |
addPanel(java.lang.String posName)
Add a panel to any other panel or window.
|
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,
GralColor colorOff,
GralColor colorOn)
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.
|
GralPanelContent |
addTabbedPanel(java.lang.String posName)
Add a panel to any other panel or window which contains only other panels as tab
|
GralTable |
addTable(java.lang.String sPosName,
int height,
int[] columnWidths)
Adds a table, which is able to scroll.
|
GralPanelContent |
addTabPanel(java.lang.String posName,
java.lang.String nameTab)
Add a panel as tab pabel.
|
GralWidget |
addText(java.lang.String text)
Adds a text to the current panel at given position with standard colors, left origin.
|
GralWidget |
addText(java.lang.String sText,
char size,
int color)
Deprecated.
|
void |
addText(java.lang.String name,
java.lang.CharSequence text)
Deprecated.
|
GralWidget |
addText(java.lang.String sText,
int origin,
GralColor textColor,
GralColor backColor)
Adds a text to a named widget.
|
GralTextBox |
addTextBox(java.lang.String posName) |
GralTextBox |
addTextBox(java.lang.String name,
boolean editable,
java.lang.String prompt,
char promptStylePosition)
Adds a text box for showing or editing a text in multi lines.
|
GralTextField |
addTextField(java.lang.String name) |
GralTextField |
addTextField(java.lang.String name,
boolean editable) |
GralTextField |
addTextField(java.lang.String name,
boolean editable,
java.lang.String prompt,
java.lang.String promptStylePosition)
Adds a text field at the current position.
|
GralTextField |
addTextField(java.lang.String name,
GralTextField.Type property) |
GralTextField |
addTextField(java.lang.String name,
java.lang.String prompt,
java.lang.String promptStylePosition,
GralTextField.Type... property)
Adds a text field for showing or editing a text value.
|
GralValueBar |
addValueBar(java.lang.String sName,
java.lang.String sDataPath) |
GralWindow |
addWindow(java.lang.String posName,
java.lang.String sTitle)
Add a standard window remove on close, resizeable.
|
GralWindow |
addWindow(java.lang.String posName,
java.lang.String sTitle,
int props) |
void |
buildCfg(GralCfgData data,
java.io.File fileCfg)
Sets the builder for content configuration.
|
GralRectangle |
calcWidgetPosAndSize(GralPos pos,
GralRectangle parentPix,
int widthWidgetNat,
int heightWidgetNat)
Calculates the pixel position and size with a given GralPos for the given size of display appearance.
|
protected void |
checkAdmissibility(boolean value) |
void |
closeApplication() |
void |
closeImplGraphic()
Terminates the run loop of the graphic thread
|
void |
closeMainWindow() |
GralPanelContent |
createCompositeBox(java.lang.String name)
Creates a box inside the current panel to hold some widgets.
|
protected GralMenu |
createContextMenu(GralWidget widg) |
GralFileDialog_ifc |
createFileDialog()
Creates a file or directory dialog.
|
void |
createGraphic(java.lang.String implementor,
char sizeShow,
LogMessage log)
Creates the whole graphically representation with all given widgets on Gral level.
|
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 posName,
java.lang.String title,
boolean onTop) |
void |
createHtmlInfoBoxes(MainCmd mainCmd)
This routine should be called in the initializing routine in the graphic thread one time.
|
void |
createImplWidget_Gthread(GralWidget widgg)
Not that this routine must not invoked before the
GralFactory#createWindow(GralWindow, char, int, int, int, int)
was not called. |
protected GralMenu |
createMenuBar(GralWindow windg) |
GralInfoBox |
createTextInfoBox(java.lang.String name,
java.lang.String title) |
protected void |
createThread_()
Creates and starts the thread.
|
static GralMng |
createWindow(java.lang.String graphicBaseSystem)
Creates an nee Panel Manager in a new Window.
|
GralWindow |
createWindow(java.lang.String posName,
java.lang.String title,
int windProps)
Creates only the GralWindow with position in GralMng
|
boolean |
currThreadIsGraphic()
Returns true if the current thread is the graphical thread.
|
(package private) void |
deregisterPanel(GralPanel_ifc panel) |
void |
deregisterWidgetName(GralWidgetBase widg) |
(package private) void |
deregisterWindow(GralWindow wind) |
private GralWidgetBase |
findWidget(java.lang.String name) |
java.util.Map<java.lang.String,java.lang.String> |
getAllValues() |
GralMngApplAdapter_ifc |
getApplicationAdapter() |
GralColor |
getColor(java.lang.String sColorName)
Gets the named color.
|
int |
getColorValue(java.lang.String sColorName)
Gets the value to the named color.
|
GralPanelContent |
getCurrentPanel() |
GralWidget_ifc |
getLastClickedWidget()
Returns that widget which was clicked by mouse at last.
|
java.util.List<GralWidgetBase> |
getListCurrWidgets()
Deprecated.
|
GralPanel_ifc |
getPanel(java.lang.String name) |
GralPos |
getPosCheckNext() |
GralPos |
getPositionInPanel()
Gets the current position in the panel to store anywhere other.
|
GralPos |
getPosOldPositioning()
Used for deprecated style, without independent GralWidget.
|
GralWindow |
getPrimaryWindow() |
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.
|
long |
getThreadIdGui() |
java.lang.String |
getValue(java.lang.String sName)
Gets the value from a widget.
|
java.lang.String |
getValueFromWidget(GralWidget widgd)
Returns null if the widget value can only be gotten platform-depending.
|
java.util.concurrent.ConcurrentLinkedQueue<GralVisibleWidgets_ifc> |
getVisiblePanels()
Gets the list of all panels which are visible yet and should be updated with values therefore.
|
GralWidgetBase |
getWidget(java.lang.String name)
Searches a widget by name.
|
GralWidget |
getWidgetInFocus() |
java.lang.Iterable<GralWidgetBase> |
getWidgetIter() |
java.util.List<GralWidget> |
getWidgetsInFocus()
Returns a list of the last widgets in focus in there focus order.
|
GralVisibleWidgets_ifc |
getWidgetsPermanentlyUpdating()
Gets a list of widgets which should be updated permanently because they store data in any time.
|
GralWidget_ifc |
getWindow(java.lang.String name) |
void |
initCfgDesigner() |
void |
initScript(java.lang.CharSequence script)
Initialize the graphic with a script.
|
void |
initScript(java.io.File script)
Initialize the graphic with a script.
|
boolean |
isImplementationGraphicTerminated() |
boolean |
isRunning()
Returns true so long the application should run (indpendent of implementation graphic)
|
boolean |
isStarted() |
LogMessage |
log() |
void |
markWidgetForDesign(GralWidget widgg) |
void |
notifyFocus(GralWidget widgd)
Deprecated.
|
EventTimerThread |
orderList() |
(package private) GralMng.PosThreadSafe |
pos() |
void |
pressedLeftMouseDownForDesign(GralWidget widgd,
GralRectangle xy)
It will be called only at the GUI-implementation level.
|
GralGridProperties |
propertiesGui() |
void |
redrawWidget(java.lang.String sName)
Forces the redrawing for all set samples.
|
GralPos |
refPos()
Returns the current position of this thread to work with it.
|
void |
refreshCurvesFromVariable(VariableContainer_ifc container)
refresh all curve views.
|
void |
registerPanel(GralPanel_ifc panel)
Registers a panel to place the widgets.
|
void |
registerShowField(GralWidget widg) |
void |
registerUserAction(java.lang.String name,
GralUserAction action)
Registers all user actions, which are able to use in Button etc.
|
void |
registerWidget(GralWidgetBase widgd)
Register all widgets, which are created in its own classes, not add here.
|
(package private) void |
registerWidget(java.lang.String name,
GralWidgetBase widgd) |
void |
registerWindow(GralWindow window)
register a window only called in the
GralWindow.GralWindow(GralPos, String, String, int, GralMng) . |
void |
releaseLeftMouseForDesign(GralWidget widgd,
GralRectangle xy,
boolean bCopy)
It will be called only at the GUI-implementation level.
|
boolean |
remove(GralPanel_ifc compositeBox)
Removes a composite box from the graphic representation.
|
boolean |
remove(GralWidget widget) |
(package private) void |
removeWidget(java.lang.String name) |
void |
repaint()
Forces a newly paint of the GUI-container.
|
void |
repaintCurrentPanel()
Forces a newly paint of the current panel.
|
void |
reportGralContent(java.lang.Appendable out)
Reports all existing Widgets on Gral level, sorted to
GralWindow . |
void |
resizeWidget(GralWidget widgd,
GralRectangle parentPix)
Forces the resizing of the given widged.
|
protected void |
runGraphicThread()
The run method of the graphic thread.
|
java.lang.String |
saveCfg(java.io.Writer dest)
Deprecated.
should be a property only of
GuiCfg |
void |
selectPanel(GralPanel_ifc panel)
Selects the given panel as current panel to build some content.
|
GralPanel_ifc |
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 |
setApplicationAdapter(GralMngApplAdapter_ifc adapter) |
void |
setBackColor(GralWidget widg,
int ix,
int color)
Deprecated.
|
void |
setBackColor(java.lang.String name,
int ix,
int color)
Sets the background color of any widget.
|
void |
setDesignMode(boolean mode)
Sets or resets the design mode.
|
void |
setFinePosition(int line,
int yPosFrac,
int ye,
int yef,
int column,
int xPosFrac,
int xe,
int xef,
char direction,
int border,
int borderFrac,
GralPos frame)
Same as
GralMngBuild_ifc.setPositionSize(int, int, int, int, char) , but the positions can be in a fine division. |
void |
setFocus(GralWidget widgd)
Deprecated.
|
void |
setHelpBase(java.lang.String path) |
void |
setHelpUrl(java.lang.String urlSuffix)
Sets the URL for the current help situation.
|
void |
setHtmlHelp(java.lang.String url) |
void |
setInfo(java.lang.CharSequence text) |
void |
setLastClickedWidget(GralWidget_ifc lastClickedWidgetInfo)
This method is called whenever the left mouse is pressed on a widget, whiches
|
void |
setLed(GralWidget widg,
int colorBorder,
int colorInner)
Deprecated.
|
void |
setLineColor(GralWidget widg,
int ix,
int color)
Deprecated.
|
void |
setLog(LogMessage log)
Changes or sets the log output.
|
GralUserAction |
setMainKeyAction(GralUserAction userMainKeyAction)
Sets the action for main keys.
|
void |
setNextPosition()
Deprecated.
|
void |
setNextPositionUnused()
Not for user: Checks whether the position is used, sets the next position then, markes the position as used.
|
void |
setPos(GralPos pos)
Sets the position in a Thread safe kind.
|
GralPos |
setPos(java.lang.String sPosition)
Sets the position with a given String, see
GralPos.setPosition(CharSequence, GralPos)
whereby the parent is the current position value. |
void |
setPosition(float line,
float lineEndOrSize,
float column,
float columnEndOrSize,
char direction)
Sets the position.
|
void |
setPosition(float line,
float lineEndOrSize,
float column,
float columnEndOrSize,
char direction,
float border)
Sets the position with fine position given as float value.
|
void |
setPosition(GralPos framePos,
float line,
float lineEndOrSize,
float column,
float columnEndOrSize,
char direction)
Sets the position in relation to a given position.
|
void |
setPosition(GralPos framePos,
float line,
float lineEndOrSize,
float column,
float columnEndOrSize,
char direction,
float border) |
void |
setPositionSize(int line,
int column,
int height,
int width,
char direction)
Sets the position and size for the next widget to add in the container.
|
void |
setPosPanel(GralPanel_ifc panel)
Deprecated.
|
void |
setProperties(GralGridProperties.ImplAccess props) |
void |
setSampleCurveViewY(java.lang.String sName,
float[] values)
Adds a sampling value set.
|
void |
setSize(float height,
float width)
Sets the size of the position and remark it as unused.
|
void |
setTabbedPanel(GralPanel_ifc tabbedPanel)
It is a special routine for tabbedPanel.
|
void |
setText(java.lang.String name,
java.lang.CharSequence text)
Sets the text into a named widget.
|
void |
setTextColor(GralWidget widg,
int ix,
int color)
Deprecated.
|
void |
setValue(java.lang.String widget,
java.lang.Object visibleInfo,
java.lang.Object userData)
Sets the text into a named widget.
|
void |
showInfo(java.lang.CharSequence text) |
protected void |
stepAwakeThread()
This thread has only the task to wake up the graphic thread.
|
private int |
stepGraphicThread()
The step routine of the graphic thread
|
(package private) void |
stop() |
(package private) GralUserAction |
userMainKeyAction()
package private
|
void |
waitForStart() |
protected void |
wakeup_()
Necessary operation to wakeup the graphic thread.
|
void |
wakeup()
This method should wake up the execution of the graphic thread because some actions are registered..
|
void |
writeLog(int msgId,
java.lang.Exception exc)
Writes a log message instead throwing an exception or writing on standard output.
|
static boolean |
XXXcreate(LogMessage log)
Creates the singleton instance of the GralMng.
|
void |
XXXpressedRightMouseDownForDesign(GralWidget widgd,
GralRectangle xy)
It will be called only at the GUI-implementation level.
|
boolean |
XXXsetWindowsVisible(GralWindow_ifc window,
GralPos atPos)
Sets a given and registered window visible at the given position and size or set it invisible.
|
public static final java.lang.String sVersion
org.vishia.event.TimeOrder
can immediately execute its org.vishia.event.EventWithDst#evDst
. org.vishia.event.EventConsumer#processEvent(EventObject)
in the same thread, without dequeue and enqueue in the graphic thread. Lesser number of thread switches.
awakeThread
.
GralMng.LogMsg
with some constants for organization of log messages
with the LogMessage#sendMsg(int, CharSequence, Object...)
approach.
The real logged messages can be filtered with this numbers.
reportGralContent(Appendable)
for all existing windows defined here.
initScript(CharSequence)
wrapped here for more simple user programming.
refPos()
instead currPos().
createGraphic(String, char, LogMessage)
is now localized here (where else!).
actionClose
sets the property to close a main Window.
notifyFocus(GralWidget)
: Only widgets with datapath. It is only for the inspector etc. TODO: Is there a list necessary? Store only the last widget in focus!
#setPosPanel(GralPanelContent)
now invoked especially from ctor of GralPanelContent
and from ctor of GralPanelContent.ImplAccess
. If a new Panel was created with a given GralWidgetBase.pos()
then that panel
is set as current one for the next widgets. Either the widgets are created before the implementation graphic with given position string,
then the panel should have a position string too to assigned them. Or the widgets are created with creation of the implementation graphic,
then a panel should be created in the same kind, and invoke #setPosPanel(GralPanelContent)
in the ctor of its implementation.
The contract is unchanged: A created panel determines that all following widgets are created on that panel.
#registerPanel(GralPanelContent)
is only be called in the ctor of GralPanelContent
because any panel is based on GralPanelContent.
The definition of the panel in the pos()
used for the next widgets are done now in the extra routine #setPosPanel(GralPanelContent)
.
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.
pos()
with a second thread: The MainWindow- GralPos#panel
was registered in another thread
and therefore unknown in the new pos()
for that thread. Solution: If the thread-specific GralPos will be created,
it should copy the data from the posCurrent
which is valid any case for valid initial data.
createHtmlInfoBoxes(MainCmd)
should be invoked in the graphic thread while initializing the application.
GralMng.GralMngFocusListener.focusLostGral(GralWidget)
now invokes the GralWidget#actionFocused
too.
The action should distinguish between focus gained and focus lost in its action routine. That should be added to the code. Done for all vishia sources.
registerUserAction(String, GralUserAction)
now knows possibility of usage the own name with "GralWidget
via
getPosCheckNext()
. That routine sets the current position in this class to GralMng.PosThreadSafe.posUsed
for further using to increment. That is correct.
The problem before was faulty old-concept usage of org.vishia.gral.swt.SwtMng#XXXsetPosAndSizeSwt
which invokes setNextPosition()
which increments the position too, therefore twice. The usage of that routine
is prevented for Swt implementation, TODO for awt yet now.
GralMng.GralMngFocusListener
: invokes repaint() because of maybe changed outfit on focus gained
#registerWidget(GralWidget)
is obsolete now, it is empty yet.
Instead #registerWidget(String, GralWidget)
by given name and removeWidget(String)
by name.
See description of registering on GralWidget#setToPanel(GralMngBuild_ifc)
.
#selectPanel(GralPanelContent)
not only with String given
GralMng.ImplAccess
which accesses all private data of the GralMng.
createImplWidget_Gthread(GralWidget)
for all set to panel actions. That method handles all widget types.
actionFileSelect
with setText(...), now the file select field was filled.
getWidgetsPermanentlyUpdating()
created but not used yet because
refreshCurvesFromVariable(VariableContainer_ifc)
has the necessary functionality.
#widgetHelper
The widget helper is implemented in the graphic system
for example as SwtWidgetHelper
to do some widget specific things.
_implListener
.GralMng.InternalPublic.gralKeyListener
addLine(GralColor, List)
to add in a GralCanvasStorage
.
#addDataReplace(Map)
, #replaceDataPathPrefix(String)
.
using alias in the GralWidget.setDataPath(String)
. The resolving of the alias is done
only if the datapath is used. * #calcWidgetPosAndSize(GralPos, int, int)
as abstract method.
addText(String)
now uses the background color GralGridProperties.colorBackground_
.
#registerWidget(GralWidget)
: uses GralPanelContent#addWidget(GralWidget, boolean)
.
getValueFromWidget(GralWidget)
implementing here for non-platform depending values, especially GralTable.
setApplicationAdapter(GralMngApplAdapter_ifc)
to support context sensitive help by focusGained of widgets.
getLastClickedWidget()
to get the last clicked widget in any user routine.
The information about the widget can be used to capture widgets for any script.
#registerPanel(GralPanelContent)
from the SWT implementation to this.
getPanel(String)
to get a registered panel by name.
actionDesignEditField
. It is the action which is called from menu now.
#calcWidgetPosAndSize(GralPos, int, int, int, int)
: calculates dy and dx one pixel less.
GralPos
. This class contains only wrappers now.
GralWidgetChangeRequ
.
GralPos#setFinePosition(int, int, int, int, int, int, int, int, int, char, GralPos)
calculates from right or bottom with negative values.
runGraphicThread()
set the thread ID before (!) the implementation is started.
runGraphicThread()
: The GralWindow_ifc.windHasMenu
is not forced, it is set compatible
in GralArea9MainCmd#parseArgumentsAndInitGraphic(String, String, char, String)
.
GralWindow#GralWindow(String, String, String, int)
should add GralWindow_ifc.windResizeable
etc. additionally.
GralMng.ImplAccess
.
GralGraphicOrder
throws an exception,
it was started again because it was in the queue yet. The proplem occurs on build graphic. It
was repeated till all graphic handles are consumed. Now the #queueGraphicOrders
entries
are deleted first, then executed. TODO use this class only for SWT, use the adequate given mechanism
for AWT: java.awt.EventQueue.invokeAndWait(Runnable). use Runnable instead GralDispatchCallbackWorker.
private GralMng.PosThreadSafe posCurrent
private final java.util.Map<java.lang.Long,GralMng.PosThreadSafe> posThreadSafe
GralCfgBuilder XXXcfgBuilder
GralCfgWriter cfgWriter
protected GralCfgDesigner designer
#gralDevice
.private GralCfgData cfgData
public boolean bDesignMode
protected boolean bDesignerIsInitialized
public GralGridProperties.ImplAccess propertiesGui
public final GralGridProperties gralProps
protected final java.util.Map<java.lang.String,GralWidgetBase> idxNameWidgets
protected final java.util.Map<java.lang.String,GralWidget> idxShowFields
protected final java.util.Map<java.lang.String,GralPanel_ifc> idxPanels
public final GralPanel_ifc screen
protected final java.util.Map<java.lang.String,GralWindow> idxWindows
private GralWindow windPrimary
org/vishia/ifc/GralFactory#createWindow(String, String, int)
.private final java.util.List<GralWidget> widgetsInFocus
public GralInfoBox infoHelp
public GralInfoBox infoBox
public GralInfoBox infoLog
private java.lang.String sHelpBase
protected final java.util.concurrent.ConcurrentLinkedQueue<GralVisibleWidgets_ifc> listVisiblePanels
java.util.Queue<GralWidget> listWidgetsPermanentUpdating
public LogMessage log
GralMng(LogMessage)
and #setLogprotected GralMngApplAdapter_ifc applAdapter
@Deprecated public final java.util.List<GralCurveView_ifc> curveContainer
protected boolean bBelow
protected boolean bRigth
protected GralUserAction userMainKeyAction
InspcReplAlias replacerAlias
protected java.lang.String sCurrPanel
private GralWidget_ifc lastClickedWidget
getLastClickedWidget()
protected final java.util.Map<java.lang.String,GralUserAction> userActions
registerUserAction(String, GralUserAction)
.private final java.util.Map<java.lang.String,java.lang.String> dataReplace
protected long graphicThreadId
boolean debugPrint
protected boolean isWakedUpOnly
protected boolean bStarted
protected boolean bShouldExitImplGraphic
protected boolean bIsExitImplGraphic
protected boolean bExitMain
protected boolean bShouldExitMain
protected MinMaxTime checkTimes
private final java.util.concurrent.ConcurrentLinkedQueue<GralGraphicOrder> queueOrdersToExecute
#addTimeEntry(Runnable)
.
An order can be stayed in this queue for ever. It is invoked any time after the graphic thread
is woken up and before the dispatching of graphic-system-event will be started.
An order may be run only one time, than it should delete itself from this queue in its run-method.private final java.lang.Thread awakeThread
private boolean bDispatcherSleeps
awakeThread
should awake the dispatcher.public EventSource evSrc
public GralMng.ImplAccess _mngImpl
private static GralMng XXXsingleton
public GralPanelActivated_ifc actionPanelActivate
GralUserAction actionShowWidgetInfos
public GralUserAction actionFileSelect
public GralUserAction actionDesignEditField
public GralUserAction actionReadPanelCfg
private java.lang.Runnable runGraphicThread
private java.lang.Runnable runAwakeThread
public final GralUserAction actionHelp
public final GralUserAction actionClose
GralWindow_ifc.windMinimizeOnClose
.
Then close is possible only and especially here.public GralMng.GralMngFocusListener gralFocusListener
SwtMng.SwtMngFocusListener
.public final GralMng.InternalPublic _implListener
public GralMng(LogMessage log)
log
- maybe null firstly, then use setLog(LogMessage)
public GralMng()
public void initScript(java.lang.CharSequence script) throws java.text.ParseException
GralCfgZbnf.configureWithZbnf(CharSequence, GralCfgData)
.
This operation is only wrapped.script
- String given, also possible in a StringBuilder prepared.java.text.ParseException
public void initScript(java.io.File script) throws java.lang.Exception
GralCfgZbnf.configureWithZbnf(File, GralCfgData)
.
This operation is only wrapped.script
- given in filejava.lang.Exception
public void createGraphic(java.lang.String implementor, char sizeShow, LogMessage log)
GralFactory.getFactory(java.lang.String)
,
then calls GralFactory.createGraphic(GralMng, char)
.
The graphic thread will be started, see runGraphicThread()
,
and the implementation graphic is instantiated in this graphic thread.
This starts with GralWindow.createImplWidget_Gthread()
for each given window.
GralFactory
needs dependencies to the implementation graphic,
there only to the specific Factory. Whereby the specific factory can be called also via String:
Class.forName(String)
.
This class remains independent of any implementation.implementor
- "SWT" or "AWT" or (TODO) the class path of the implementor's factory class.sizeShow
- 'A' .. 'G' for the sizelog
- null if a log is already given for the GralMng,
else the log from yet. A given log will be removed.public static boolean XXXcreate(LogMessage log)
#get()
.log
- The first invocation determines the log output.public void setLog(LogMessage log)
log()
.log
- public static GralMng createWindow(java.lang.String graphicBaseSystem)
graphicBaseSystem
- GralMng.PosThreadSafe pos()
public void setPos(GralPos pos)
pos
- maybe gotten from getPositionInPanel()
any slightly variedpublic GralPos refPos()
public GralPos setPos(java.lang.String sPosition) throws java.text.ParseException
GralPos.setPosition(CharSequence, GralPos)
whereby the parent is the current position value.sPosition
- java.text.ParseException
public void setPositionSize(int line, int column, int height, int width, char direction)
GralMngBuild_ifc
setPositionSize
in interface GralMngBuild_ifc
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.width
- 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, downpublic void setPosition(float line, float lineEndOrSize, float column, float columnEndOrSize, char direction)
GralMngBuild_ifc
setPosition
in interface GralMngBuild_ifc
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.public void setPosition(float line, float lineEndOrSize, float column, float columnEndOrSize, char direction, float border)
GralMngBuild_ifc
GralPos
.setPosition
in interface GralMngBuild_ifc
line
- either position or combinded with GralPos.refer
etc.public void setPosition(GralPos framePos, float line, float lineEndOrSize, float column, float columnEndOrSize, char direction)
GralMngBuild_ifc
setPosition
in interface GralMngBuild_ifc
framePos
- The given frame.line
- The linepublic void setPosition(GralPos framePos, float line, float lineEndOrSize, float column, float columnEndOrSize, char direction, float border)
setPosition
in interface GralMngBuild_ifc
public void setFinePosition(int line, int yPosFrac, int ye, int yef, int column, int xPosFrac, int xe, int xef, char direction, int border, int borderFrac, GralPos frame)
GralMngBuild_ifc
GralMngBuild_ifc.setPositionSize(int, int, int, int, char)
, but the positions can be in a fine division.setFinePosition
in interface GralMngBuild_ifc
line
- The line.yPosFrac
- Number between 0..9 for fine positioning in the grid step.yef
- Number between 0..9 for fine positioning in the grid step.xPosFrac
- Number between 0..9 for fine positioning in the grid step.xef
- 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.public void setSize(float height, float width)
height
- width
- @Deprecated public void setNextPosition()
#posUsed
. TODO remove in AwtMngpublic void setNextPositionUnused()
#posUsed
.public void registerShowField(GralWidget widg)
public GralPos getPositionInPanel()
GralMngBuild_ifc
pos()
is reused there. Therefore the implementation of the method
returns a cloned instance.getPositionInPanel
in interface GralMngBuild_ifc
pos()
.public GralPos getPosCheckNext()
public GralPos getPosOldPositioning()
@Deprecated public java.util.List<GralWidgetBase> getListCurrWidgets()
GralMng_ifc
getListCurrWidgets
in interface GralMng_ifc
public void setProperties(GralGridProperties.ImplAccess props)
public void registerWindow(GralWindow window)
GralWindow.GralWindow(GralPos, String, String, int, GralMng)
.window
- TODO should be package privatepublic void createHtmlInfoBoxes(MainCmd mainCmd)
mainCmd
- If given the help from mainCmd will be written into the Help box.public void createImplWidget_Gthread(GralWidget widgg)
GralFactory#createWindow(GralWindow, char, int, int, int, int)
was not called.createImplWidget_Gthread
in interface GralMngBuild_ifc
widgg
- The widget should be initialized already.GralMngBuild_ifc.createImplWidget_Gthread(org.vishia.gral.base.GralWidget)
public GralUserAction setMainKeyAction(GralUserAction userMainKeyAction)
GralMngBuild_ifc
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.setMainKeyAction
in interface GralMngBuild_ifc
userMainKeyAction
- The user action to process main keys.GralUserAction userMainKeyAction()
public GralGridProperties propertiesGui()
propertiesGui
in interface GralMng_ifc
public LogMessage log()
log
in interface GralMng_ifc
public java.lang.String getValueFromWidget(GralWidget widgd)
SwtMng
.getValueFromWidget
in interface GralMng_ifc
widgd
- The widget.public void setApplicationAdapter(GralMngApplAdapter_ifc adapter)
public GralMngApplAdapter_ifc getApplicationAdapter()
public ReplaceAlias_ifc getReplacerAlias()
getReplacerAlias
in interface GralMngBuild_ifc
public void setHelpBase(java.lang.String path)
public void setHelpUrl(java.lang.String urlSuffix)
this.gralMng.createHtmlInfoBoxes(null); this.gralMng.setHelpBase(this.sHelpDir);Only then the url is effective.
urlSuffix
- it is usual a suffix to given helpBase.
Only if it is absolute than take it without helpbase.public void setHtmlHelp(java.lang.String url)
public void showInfo(java.lang.CharSequence text)
public void setInfo(java.lang.CharSequence text)
public void addInfo(java.lang.CharSequence info, boolean show)
public GralPanel_ifc selectPanel(java.lang.String sName)
selectPanel
in interface GralMngBuild_ifc
public void selectPanel(GralPanel_ifc panel)
selectPanel
in interface GralMngBuild_ifc
public void selectPrimaryWindow()
selectPrimaryWindow
in interface GralMngBuild_ifc
public boolean currThreadIsGraphic()
GralMng_ifc
org.vishia.gral.base.GralGraphicThread#runGraphicThread()
.currThreadIsGraphic
in interface GralMng_ifc
public GralWidgetBase getWidget(java.lang.String name)
GralMng_ifc
getWidget
in interface GralMng_ifc
name
- The name which is assigned on build.public java.lang.Iterable<GralWidgetBase> getWidgetIter()
public void buildCfg(GralCfgData data, java.io.File fileCfg)
GralMngBuild_ifc
buildCfg
in interface GralMngBuild_ifc
public void setDesignMode(boolean mode)
setDesignMode
in interface GralMngBuild_ifc
mode
- public java.lang.String saveCfg(java.io.Writer dest)
GuiCfg
saveCfg
in interface GralMngBuild_ifc
dest
- public void setLastClickedWidget(GralWidget_ifc lastClickedWidgetInfo)
lastClickedWidgetInfo
- public GralWidget_ifc getLastClickedWidget()
GralWidget.setDataPath(String)
is initialized
with "widgetInfo" is not captured for this operation. It means, if any user action method uses
this method to get the last clicked widget, that widget itself have to be marked with
setDataPath("widgetInfo"); to prevent getting its own widget info.public void registerUserAction(java.lang.String name, GralUserAction action)
userAction=
designation in the configuration String.registerUserAction
in interface GralMngBuild_ifc
name
- if it contains "GralUserAction.name
.
You can give "action
- public GralUserAction getRegisteredUserAction(java.lang.String name)
getRegisteredUserAction
in interface GralMngBuild_ifc
void registerWidget(java.lang.String name, GralWidgetBase widgd)
void removeWidget(java.lang.String name)
public void registerWidget(GralWidgetBase widgd)
GralMngBuild_ifc
registerWidget
in interface GralMngBuild_ifc
public void deregisterWidgetName(GralWidgetBase widg)
public void registerPanel(GralPanel_ifc panel)
GralPos.setPosition(CharSequence, GralPos)
should be used.
pos()
for this thread.
The panel can be selected with its name calling the selectPanel(String)
-routineregisterPanel
in interface GralMngBuild_ifc
key
- Name of the panel.panel
- The panel.@Deprecated public void setPosPanel(GralPanel_ifc panel)
void deregisterPanel(GralPanel_ifc panel)
void deregisterWindow(GralWindow wind)
public java.util.Set<java.util.Map.Entry<java.lang.String,GralWidget>> getShowFields()
getShowFields
in interface GralMngBuild_ifc
public java.util.Map<java.lang.String,java.lang.String> getAllValues()
public java.lang.String getValue(java.lang.String sName)
GralMng_ifc
getValue
in interface GralMng_ifc
sName
- The name of the widget. The widget will be searched per name.public void setTabbedPanel(GralPanel_ifc tabbedPanel)
GralTabbedPanel#addGridPanel(String, String, int, int, int, int)
then the mng is set to the tabbed panel.tabbedPanel
- public GralWidget_ifc getWindow(java.lang.String name)
public GralPanel_ifc getPanel(java.lang.String name)
public GralWindow getPrimaryWindow()
public GralPanelContent getCurrentPanel()
protected void wakeup_()
EventTimerThread#storeEvent(EventObject)
.
See EventTimerThread#wakeup_()
public EventTimerThread orderList()
public void addDispatchOrder(GralGraphicOrder order)
GralGraphicOrder#activate()
.order
- public long getThreadIdGui()
public void wakeup()
public void waitForStart()
public boolean isStarted()
public boolean isRunning()
public boolean isImplementationGraphicTerminated()
public void closeImplGraphic()
public void closeApplication()
protected void createThread_()
#storeEvent(EventCmdtype)
was called.
In that case the thread stops its execution if the event queue is empty and about 5 seconds
are gone.protected void runGraphicThread()
#initGraphic()
will be called firstly. It is overridden by the graphic system implementing class
and does some things necessary for the graphic system implementing level.
bShouldExitImplGraphic
is not set to false. bExit may be set to false
in a window close listener of the graphic system level. It means, it is set to false especially
if the windows will be closed from the operation system. If the window is closed because the application
is terminated by any application command the window will be closed, and the close listerer sets bReady
to false then.
#queueGraphicOrders
will be executed.
#dispatchOsEvents()
method.
#graphicThreadSleep()
.
Runnable.run()
private int stepGraphicThread()
protected void stepAwakeThread()
GralMng.ImplAccess.wakeup()
public void closeMainWindow()
protected void checkAdmissibility(boolean value)
private GralWidgetBase findWidget(java.lang.String name)
public void setBackColor(java.lang.String name, int ix, int color)
setBackColor
in interface GralMng_ifc
name
- The name of the widget, which was given by the add...()-Operationident
- A identifying number. It meaning depends on the kind of widget.
0 means, insert on top. Integer.MAXVALUE means, insert after the last element (append).content
- The content to insert.public void setText(java.lang.String name, java.lang.CharSequence text)
GralMng_ifc
setText
in interface GralMng_ifc
text
- The text is not stored by reference, it can be changed after them.public void setValue(java.lang.String widget, java.lang.Object visibleInfo, java.lang.Object userData)
GralMng_ifc
setValue
in interface GralMng_ifc
public GralWindow addWindow(java.lang.String posName, java.lang.String sTitle)
posName
- Position at the screen or related to another windowsTitle
- Title barpublic GralWindow addWindow(java.lang.String posName, java.lang.String sTitle, int props)
public GralPanelContent addPanel(java.lang.String posName)
posName
- "@panel,... = name" determines to which panel, elsewhere to the last added panel.public GralPanelContent addTabbedPanel(java.lang.String posName)
posName
- "@panel,... = name" determines to which panel, elsewhere to the last added panel.public GralPanelContent addTabPanel(java.lang.String posName, java.lang.String nameTab)
posName
- "@panel,... = name" determines to which panel, elsewhere to the last added panel.tabName
- The string shown on the tab.public GralArea9Panel addArea9Panel(java.lang.String posName)
posName
- "@panel,... = name" determines to which panel, elsewhere to the last added panel.@Deprecated public void addText(java.lang.String name, java.lang.CharSequence text)
addText
in interface GralMng_ifc
text
- The text is not stored by reference, it can be changed after them.public GralWidget addText(java.lang.String sText, int origin, GralColor textColor, GralColor backColor)
addText
in interface GralMngBuild_ifc
origin
- Origin, use char 1..9 for 1 top-left, 2 top-middle, ... 5 middle, 9 bottom-right.public GralTextField addTextField(java.lang.String name, java.lang.String prompt, java.lang.String promptStylePosition, GralTextField.Type... property)
sName
- The registering namewidth
- Number of grid units for lengtheditable
- 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)public GralTextField addTextField(java.lang.String name, boolean editable, java.lang.String prompt, java.lang.String promptStylePosition)
GralMngBuild_ifc
addTextField
in interface GralMngBuild_ifc
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)public GralTextField addTextField(java.lang.String name)
public GralTextField addTextField(java.lang.String name, boolean editable)
public GralTextField addTextField(java.lang.String name, GralTextField.Type property)
public GralTextBox addTextBox(java.lang.String name, boolean editable, java.lang.String prompt, char promptStylePosition)
addTextBox
in interface GralMngBuild_ifc
sName
- The registering namewidth
- Number of grid units for lengtheditable
- 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)public GralTextBox addTextBox(java.lang.String posName)
public GralValueBar addValueBar(java.lang.String sName, java.lang.String sDataPath)
addValueBar
in interface GralMngBuild_ifc
public GralButton addButton(java.lang.String sName, GralUserAction action, java.lang.String sButtonText)
GralMngBuild_ifc
addButton
in interface GralMngBuild_ifc
sButtonText
- text in the buttonpublic GralButton addButton(java.lang.String sName, java.lang.String sButtonText, GralUserAction action)
public GralButton addButton(java.lang.String sName, GralUserAction action, java.lang.String sCmd, java.lang.String sDataPath, java.lang.String sButtonText)
GralMngBuild_ifc
addButton
in interface GralMngBuild_ifc
sCmd
- The command string will be transfered to the action-methodsButtonText
- text in the buttonpublic GralButton addSwitchButton(java.lang.String sName, GralUserAction action, java.lang.String sCmd, java.lang.String sDataPath, java.lang.String sButtonText, GralColor colorOff, GralColor colorOn)
GralMngBuild_ifc
addSwitchButton
in interface GralMngBuild_ifc
public GralButton addSwitchButton(java.lang.String sName, java.lang.String sButtonTextOff, java.lang.String sButtonTextOn, GralColor colorOff, GralColor colorOn)
GralMngBuild_ifc
GralButton.isOn()
or GralWidget.getValue()
.addSwitchButton
in interface GralMngBuild_ifc
public GralButton addCheckButton(java.lang.String sPosName, java.lang.String sButtonTextOn, java.lang.String sButtonTextOff, java.lang.String sButtonTextDisabled, GralColor colorOn, GralColor colorOff, GralColor colorDisabled)
GralMngBuild_ifc
GralButton.isOn()
or GralWidget.getValue()
.addCheckButton
in interface GralMngBuild_ifc
public GralLed addLed(java.lang.String sName, java.lang.String sDataPath)
GralMngBuild_ifc
addLed
in interface GralMngBuild_ifc
@Deprecated public void setBackColor(GralWidget widg, int ix, int color)
GralMng_ifc
setBackColor
in interface GralMng_ifc
color
- blue, green and red in the bits 23..16, 15..8 and 7..0.
opaque in bits 31..24 if possible.@Deprecated public void setLineColor(GralWidget widg, int ix, int color)
GralMng_ifc
setLineColor
in interface GralMng_ifc
color
- blue, green and red in the bits 23..16, 15..8 and 7..0.
opaque in bits 31..24 if possible.@Deprecated public void setTextColor(GralWidget widg, int ix, int color)
GralMng_ifc
setTextColor
in interface GralMng_ifc
color
- blue, green and red in the bits 23..16, 15..8 and 7..0.
opaque in bits 31..24 if possible.@Deprecated public void addLine(int colorValue, float xa, float ya, float xe, float ye)
XXXSwtCanvasStorePanel
. This class stores the line coordinates and conditions
and draws it as background if drawing is invoked.addLine
in interface GralMngBuild_ifc
colorValue
- The value for color, 0xffffff is white, 0xff0000 is red.xa
- start of line relative to current position in grid units.
The start is relative to the given position! Not absolute in window!ya
- start of line relative to current position in grid units.xe
- end of line relative to current position in grid units.ye
- end of line relative to current position in grid units.@Deprecated public void addLine(GralColor color, java.util.List<GralPoint> points)
GralMngBuild_ifc
XXXSwtCanvasStorePanel
. This class stores the line coordinates and conditions
and draws it as background if drawing is invoked.addLine
in interface GralMngBuild_ifc
@Deprecated public void setLed(GralWidget widg, int colorBorder, int colorInner)
setLed
in interface GralMng_ifc
public void reportGralContent(java.lang.Appendable out)
GralWindow
.
It calls internally GralWindow.reportAllContent(Appendable)
for each window.
GralMng.ImplAccess.reportContent(Appendable)
for the implementation level.out
- any output, maybe especially System.out
or LogMessage
public java.util.concurrent.ConcurrentLinkedQueue<GralVisibleWidgets_ifc> getVisiblePanels()
GralMng_ifc
getVisiblePanels
in interface GralMng_ifc
public GralVisibleWidgets_ifc getWidgetsPermanentlyUpdating()
GralMng_ifc
getWidgetsPermanentlyUpdating
in interface GralMng_ifc
@Deprecated public void setFocus(GralWidget widgd)
GralMng_ifc
setFocus
in interface GralMng_ifc
@Deprecated public void notifyFocus(GralWidget widgd)
GralMng_ifc
notifyFocus
in interface GralMng_ifc
widgd
- The widget descriptorpublic GralWidget getWidgetInFocus()
getWidgetInFocus
in interface GralMng_ifc
public java.util.List<GralWidget> getWidgetsInFocus()
GralMng_ifc
getWidgetsInFocus
in interface GralMng_ifc
public int getColorValue(java.lang.String sColorName)
GralMngBuild_ifc
getColorValue
in interface GralMng_ifc
getColorValue
in interface GralMngBuild_ifc
sColorName
- supported: red, green, blue, yellowpublic GralColor getColor(java.lang.String sColorName)
GralMngBuild_ifc
getColor
in interface GralMngBuild_ifc
sColorName
- supported: red, green, blue, yellowpublic GralRectangle calcWidgetPosAndSize(GralPos pos, GralRectangle parentPix, int widthWidgetNat, int heightWidgetNat)
pos
- Given positionwidthParentPixel
- width of the container. This value will be used if the position is given
from right with negative numbers.heightParentPixel
- height of the container. This value will be used if the position is given
from bottom with negative numbers.widthWidgetNat
- natural width of the component which will be positioning.
This value is used only if the pos parameter contains GralPos.useNatSize
for the xe-valueheightWidgetNat
- natural height of the component which will be positioning.
This value is used only if the pos parameter contains GralPos.useNatSize
for the ye-valuepublic 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)
GralMngBuild_ifc
addFileSelectField
in interface GralMngBuild_ifc
name
- Name of the widgetlistRecentFiles
- maybe null, a list which stores and offers selected files.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.public void pressedLeftMouseDownForDesign(GralWidget widgd, GralRectangle xy)
widgd
- xy
- public void releaseLeftMouseForDesign(GralWidget widgd, GralRectangle xy, boolean bCopy)
widgd
- xy
- public void markWidgetForDesign(GralWidget widgg)
public void XXXpressedRightMouseDownForDesign(GralWidget widgd, GralRectangle xy)
widgd
- xy
- public void initCfgDesigner()
public GralInfoBox createTextInfoBox(java.lang.String name, java.lang.String title)
createTextInfoBox
in interface GralMngBuild_ifc
public GralInfoBox createHtmlInfoBox(java.lang.String posName, java.lang.String title, boolean onTop)
createHtmlInfoBox
in interface GralMngBuild_ifc
public GralWidget addText(java.lang.String text)
addText(String, int, GralColor, GralColor)
,
addTextField(String, boolean, String, String)
addText
in interface GralMngBuild_ifc
text
- public void repaint()
GralMngBuild_ifc
repaint
in interface GralMngBuild_ifc
public void repaintCurrentPanel()
GralMngBuild_ifc
repaintCurrentPanel
in interface GralMngBuild_ifc
public void refreshCurvesFromVariable(VariableContainer_ifc container)
GralMng_ifc
refreshCurvesFromVariable
in interface GralMng_ifc
public boolean remove(GralWidget widget)
remove
in interface GralMngBuild_ifc
public void writeLog(int msgId, java.lang.Exception exc)
GralMng_ifc
writeLog
in interface GralMng_ifc
msgId
- The ident number for dispatching and evaluation.exc
- The catched exception.void stop()
protected GralMenu createContextMenu(GralWidget widg)
protected GralMenu createMenuBar(GralWindow windg)
public GralWidget addSlider(java.lang.String sName, GralUserAction action, java.lang.String sShowMethod, java.lang.String sDataPath)
addSlider
in interface GralMngBuild_ifc
public GralTable addTable(java.lang.String sPosName, int height, int[] columnWidths)
GralMngBuild_ifc
GralWidget.setActionChange(GralUserAction)
with
GralTableLine_ifc
KeyCode
getRegisteredUserAction(String)
for "keyAction" is tried to get and then invoked with cmd = "key" and the key code in values[0].
This central keyAction may be used for application centralized keys without association to the table itself.addTable
in interface GralMngBuild_ifc
sPosName
- register name, used for GuiPanelMngWorkingIfc#insertInfo(String, int, String).
height
- The height in grid units for the appearancecolumnWidths
- Array with width of the columns.
Each column has a fix default width per construction.
It may or may not a fix widht, it may able to change by mouse actions,
adequate to the possibilities of the used graphic base system.@Deprecated public GralWidget addText(java.lang.String sText, char size, int color)
GralMngBuild_ifc
addText
in interface GralMngBuild_ifc
sText
- The textsize
- size, 'A' is small ...'E' is large.color
- The color as RGB-value in 3 Byte. 0xffffff is white, 0xff0000 is red.public java.lang.Object addImage(java.lang.String sName, java.io.InputStream imageStream, int height, int width, java.lang.String sCmd)
addImage
in interface GralMngBuild_ifc
public GralHtmlBox addHtmlBox(java.lang.String name)
GralMngBuild_ifc
addHtmlBox
in interface GralMngBuild_ifc
public GralCurveView addCurveViewY(java.lang.String sPosName, int nrofXvalues, GralCurveView.CommonCurve common, TimedValues tracksValues)
GralMngBuild_ifc
addCurveViewY
in interface GralMngBuild_ifc
nrofXvalues
- depth of the buffer for x-values. It should be 6..20 times of dx.public GralWidget addFocusAction(java.lang.String sName, GralUserAction action, java.lang.String sCmdEnter, java.lang.String sCmdRelease)
GralMngBuild_ifc
addFocusAction
in interface GralMngBuild_ifc
sName
- The name of the widget. It should be registered calling any add... method.public void addFocusAction(GralWidget widgetInfo, GralUserAction action, java.lang.String sCmdEnter, java.lang.String sCmdRelease)
GralMngBuild_ifc
addFocusAction
in interface GralMngBuild_ifc
public GralPanelContent createCompositeBox(java.lang.String name)
GralMngBuild_ifc
createCompositeBox
in interface GralMngBuild_ifc
public GralPanelContent createGridPanel(java.lang.String namePanel, GralColor backGround, int xG, int yG, int xS, int yS)
GralMngBuild_ifc
createGridPanel
in interface GralMngBuild_ifc
public boolean remove(GralPanel_ifc compositeBox)
GralMngBuild_ifc
remove
in interface GralMngBuild_ifc
public GralWindow createWindow(java.lang.String posName, java.lang.String title, int windProps)
createWindow
in interface GralMngBuild_ifc
title
- Title of the window, may be null, then without title bar.windProps
- Or of the static variables GralWindow_ifc.windExclusive
etc.GralMngBuild_ifc.createWindow(java.lang.String, java.lang.String, int)
public GralFileDialog_ifc createFileDialog()
GralMngBuild_ifc
createFileDialog
in interface GralMngBuild_ifc
public void redrawWidget(java.lang.String sName)
GralMng_ifc
redrawWidget
in interface GralMng_ifc
sName
- The name of the widget.public void resizeWidget(GralWidget widgd, GralRectangle parentPix)
GralMng_ifc
resizeWidget
in interface GralMng_ifc
widgd
- the widgetpublic boolean XXXsetWindowsVisible(GralWindow_ifc window, GralPos atPos)
GralMng_ifc
org.vishia.gral.ifc.GralMngBuild_ifc#createWindow(String, boolean)
in the build phase of the gui. It can be hidden because it is not necessary to show and operate with them.
In a adequate phase of operate it can be shown and focused.
GralPos#panel
. To get a position instance,
you can set a position invoking
GralMngBuild_ifc.selectPanel(String)
org.vishia.gral.ifc.GralMngBuild_ifc#setPosition(float, float, float, float, int, char)
GralMngBuild_ifc.getPositionInPanel()
.
GralPos.x
etc.
It is possible too to change the Panel which relates to the position. Then the grid managing instance
have to be known via the GralMngBuild_ifc
to select a panel.
The panels may be moved or resized. With the knowledge of the relative position of the window in respect to a panel
of the parent window, the window can be placed onto a proper position of the whole display.XXXsetWindowsVisible
in interface GralMng_ifc
window
- the instance of the window wrapper.atPos
- If null then hide the window. If not null then show the window.
The position and size of the window is given related to any panel of any other window.public void setSampleCurveViewY(java.lang.String sName, float[] values)
GralMng_ifc
setSampleCurveViewY
in interface GralMng_ifc
sName
- The registered namevalues
- The values.