public class SwingMng extends GralMng.ImplAccess
gralMng, sizeCharProperties, threadGuiDispatch
Modifier | Constructor and Description |
---|---|
protected |
SwingMng(GralMng gralMng,
char displaySize,
LogMessage log)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
GralCurveView |
addCurveViewY(java.lang.String sName,
int nrofXvalues,
GralCurveView.CommonCurve common) |
void |
addFocusAction(GralWidget widgetInfo,
GralUserAction action,
java.lang.String sCmdEnter,
java.lang.String sCmdRelease) |
GralWidget |
addFocusAction(java.lang.String sName,
GralUserAction action,
java.lang.String sCmdEnter,
java.lang.String sCmdRelease) |
GralHtmlBox |
addHtmlBox(java.lang.String name) |
java.lang.Object |
addImage(java.lang.String sName,
java.io.InputStream imageStream,
int height,
int width,
java.lang.String sCmd) |
GralWidget |
addSlider(java.lang.String sName,
GralUserAction action,
java.lang.String sShowMethod,
java.lang.String sDataPath) |
GralTable |
addTable(java.lang.String sName,
int height,
int[] columnWidths) |
GralWidget |
addText(java.lang.String sText,
char size,
int color) |
GralRectangle |
calcWidgetPosAndSize(GralPos pos,
int widthwidgetNat,
int heigthWidgetNat)
Calculates the bounds of a widget with a given pos independent of this
GralMng.ImplAccess.pos() . |
protected void |
closeImplGraphic() |
protected GralMenu |
createContextMenu(GralWidget widgg)
Creates the context menu for the given widget for right-mouse pressing.
|
GralFileDialog_ifc |
createFileDialog() |
void |
createImplWidget_Gthread(GralWidget widgg)
This operation creates the proper implementation widgets due to the underlying Graphic system.
|
protected GralMenu |
createMenuBar(GralWindow windg)
Creates the menu bar for the given window.
|
protected void |
createSubWindow(GralWindow windowGral) |
GralWindow |
createWindow(java.lang.String name,
java.lang.String title,
int windProps) |
protected boolean |
dispatchOsEvents()
Calls the dispatch routine of the implementation graphic.
|
void |
finishInit() |
java.lang.Object |
getColorImpl(GralColor color)
Gets the color of the graphic implementation (swt.Color, swing.TODO)
Either the implementation color instance is stored already in the GralColor,
or it will be created, stored in GralColor and returned here.
|
java.lang.Object |
getCurrentPanel()
Forbidden.
|
java.lang.String |
getValueFromWidget(GralWidget widgd) |
protected void |
graphicThreadSleep()
Forces the graphic thread to sleep and wait for any events.
|
protected void |
initGraphic()
This method should be implemented by the graphical implementation layer.
|
protected void |
redrawWidget(java.lang.String sName)
Forces the redrawing for all set samples.
|
boolean |
remove(GralPanel_ifc compositeBox)
Creates an independent grid panel which is managed by this.
|
void |
reportContent(java.lang.Appendable out)
Reports all existing Widgets on implementation level.
|
protected GralRectangle |
resizeWidget(GralWidget widgd,
GralRectangle parentPix)
Forces the resizing of the given widged.
|
protected void |
setSampleCurveViewY(java.lang.String sName,
float[] values)
Adds a sampling value set.
|
protected boolean |
showContextMenuGthread(GralWidget widg)
Shows the context menu of any widget independent of the internal right-mouse invocation.
|
void |
wakeup()
This method should be implemented by the graphical base.
|
protected GralMenu |
XXXaddPopupMenu(java.lang.String sName) |
protected boolean |
XXXsetWindowsVisible(GralWindow_ifc window,
GralPos atPos)
Sets a given and registered window visible at the given position and size or set it invisible.
|
getPanel, idxWindows, indexNameWidgets, listVisiblePanels_add, pos, sCurrPanel, startThread, userMainKeyAction
protected SwingMng(GralMng gralMng, char displaySize, LogMessage log)
guiContainer
- The container where the elements are stored in.width
- in display-units for the window's width, the number of pixel depends from param displaySize.height
- in display-units for the window's height, the number of pixel depends from param displaySize.displaySize
- character 'A' to 'E' to determine the size of the content
(font size, pixel per cell). 'A' is the smallest, 'E' the largest size. Default: use 'C'.public java.lang.Object getCurrentPanel()
GralMng.ImplAccess
SwtMng.getWidgetsPanel(GralWidget)
.getCurrentPanel
in class GralMng.ImplAccess
public void createImplWidget_Gthread(GralWidget widgg)
GralMng.ImplAccess
SwtMng
.createImplWidget_Gthread
in class GralMng.ImplAccess
widgg
- The given instantiated GralWidget but without implementation instacne yet.protected GralMenu createContextMenu(GralWidget widgg)
GralMng.ImplAccess
GralWidget.getContextMenu()
whereby an existing
context menu is stored in the GralWidget.contextMenu
association.
The widget have to be set to panel already, an implementation widget have to be existing.
It means GralWidget#getWidgetImplementation()
should be return that instance
where the menu is to be added.
This method is package protected because it should only be called internally.createContextMenu
in class GralMng.ImplAccess
public boolean remove(GralPanel_ifc compositeBox)
GralMng.ImplAccess
remove
in class GralMng.ImplAccess
protected GralMenu createMenuBar(GralWindow windg)
GralMng.ImplAccess
GralWindow.getMenuBar()
whereby an existing
menu bar is stored in the GralWindow.menuBarGral
association.createMenuBar
in class GralMng.ImplAccess
windg
- The windowpublic GralWindow createWindow(java.lang.String name, java.lang.String title, int windProps)
createWindow
in class GralMng.ImplAccess
protected void createSubWindow(GralWindow windowGral) throws java.io.IOException
createSubWindow
in class GralMng.ImplAccess
java.io.IOException
public GralWidget addText(java.lang.String sText, char size, int color)
addText
in class GralMng.ImplAccess
public GralHtmlBox addHtmlBox(java.lang.String name)
addHtmlBox
in class GralMng.ImplAccess
public java.lang.Object addImage(java.lang.String sName, java.io.InputStream imageStream, int height, int width, java.lang.String sCmd)
addImage
in class GralMng.ImplAccess
public GralWidget addSlider(java.lang.String sName, GralUserAction action, java.lang.String sShowMethod, java.lang.String sDataPath)
addSlider
in class GralMng.ImplAccess
public GralCurveView addCurveViewY(java.lang.String sName, int nrofXvalues, GralCurveView.CommonCurve common)
addCurveViewY
in class GralMng.ImplAccess
public GralWidget addFocusAction(java.lang.String sName, GralUserAction action, java.lang.String sCmdEnter, java.lang.String sCmdRelease)
addFocusAction
in class GralMng.ImplAccess
public void addFocusAction(GralWidget widgetInfo, GralUserAction action, java.lang.String sCmdEnter, java.lang.String sCmdRelease)
addFocusAction
in class GralMng.ImplAccess
public GralTable addTable(java.lang.String sName, int height, int[] columnWidths)
addTable
in class GralMng.ImplAccess
public GralFileDialog_ifc createFileDialog()
createFileDialog
in class GralMng.ImplAccess
protected GralMenu XXXaddPopupMenu(java.lang.String sName)
XXXaddPopupMenu
in class GralMng.ImplAccess
public GralRectangle calcWidgetPosAndSize(GralPos pos, int widthwidgetNat, int heigthWidgetNat)
GralMng.ImplAccess
GralMng.ImplAccess.pos()
.
This method is a part of the implementing GralMng because the GralPos is not implemented for
any underlying graphic system and the #propertiesGuiSwt
are used.
This method is not intent to use from an application, only for implementing methods of Gral.
Therefore it isn't a member of the GralWindowMng_ifc
and GralMngBuild_ifc
It is possible to tune the bounds after calculation, for example to enhance the width if a text
is larger then the intended position.calcWidgetPosAndSize
in class GralMng.ImplAccess
pos
- The position.widthwidgetNat
- The natural size of the component.heigthWidgetNat
- The natural size of the component.public java.lang.String getValueFromWidget(GralWidget widgd)
getValueFromWidget
in class GralMng.ImplAccess
public java.lang.Object getColorImpl(GralColor color)
GralMng.ImplAccess
getColorImpl
in class GralMng.ImplAccess
color
- The Color.protected void redrawWidget(java.lang.String sName)
GralMng.ImplAccess
redrawWidget
in class GralMng.ImplAccess
sName
- The name of the widget.protected GralRectangle resizeWidget(GralWidget widgd, GralRectangle parentPix)
GralMng.ImplAccess
resizeWidget
in class GralMng.ImplAccess
widgd
- the widgetprotected void setSampleCurveViewY(java.lang.String sName, float[] values)
GralMng.ImplAccess
setSampleCurveViewY
in class GralMng.ImplAccess
sName
- The registered namevalues
- The values.protected boolean showContextMenuGthread(GralWidget widg)
GralMng.ImplAccess
showContextMenuGthread
in class GralMng.ImplAccess
widg
- The widget.public void reportContent(java.lang.Appendable out) throws java.io.IOException
GralMng.ImplAccess
GralMng.reportGralContent(Appendable)
for the Gral level.reportContent
in class GralMng.ImplAccess
out
- any output, maybe especially System.out
or LogMessage
java.io.IOException
public void finishInit()
finishInit
in class GralMng.ImplAccess
protected void initGraphic()
GralMng.ImplAccess
GralMng.runGraphicThread()
. See SwtGraphicThread
.initGraphic
in class GralMng.ImplAccess
protected void closeImplGraphic()
closeImplGraphic
in class GralMng.ImplAccess
protected boolean dispatchOsEvents()
GralMng.ImplAccess
dispatchOsEvents
in class GralMng.ImplAccess
protected void graphicThreadSleep()
GralMng.ImplAccess
GralMng.ImplAccess.wakeup()
is called or this routine returns if the operation system wakes up the graphic thread.graphicThreadSleep
in class GralMng.ImplAccess
public void wakeup()
GralMng.ImplAccess
wakeup
in class GralMng.ImplAccess
protected boolean XXXsetWindowsVisible(GralWindow_ifc window, GralPos atPos)
GralMng.ImplAccess
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 class GralMng.ImplAccess
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.