public class SwtMng extends GralMng.ImplAccess
mainGuiSwt.SampleGuiSwtButtonInput
GralCfgBuilder
,
but it is able to simplify the access to data and actions elsewhere too.
Modifier and Type | Class and Description |
---|---|
class |
SwtMng.NotExistException
The GUI may be determined by a external user file.
|
protected class |
SwtMng.SwtMngFocusListener
Universal focus listener to register which widgets were in focus in its order,
to set htmlHelp and to invoke the
GralWidget.setActionFocused(GralUserAction) . |
protected class |
SwtMng.SwtMngMouseMenuListener
Universal context menu listener
|
protected class |
SwtMng.XXXButtonUserAction
Action for user commands of buttons.
|
protected static interface |
SwtMng.XXXUserAction
It is a marker interface.
|
Modifier and Type | Field and Description |
---|---|
protected SwtMng.SwtMngFocusListener |
focusListener
The package private universal focus listener.
|
SwtProperties |
propertiesGuiSwt
Properties of this Dialog Window.
|
static java.lang.String |
version
Version, history and license.
|
protected org.eclipse.swt.graphics.Rectangle |
XXXXXcurrPanelPos
The graphical frame.
|
mng
Modifier | Constructor and Description |
---|---|
protected |
SwtMng(org.eclipse.swt.widgets.Display display,
char displaySize,
LogMessage log)
Creates an instance.
|
|
SwtMng(org.eclipse.swt.widgets.Display display,
SwtProperties propertiesGui,
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) |
GralTabbedPanel |
addTabbedPanel(java.lang.String namePanel,
GralPanelActivated_ifc user,
int property)
Adds a tab panel in implementation.
|
GralTable |
addTable(java.lang.String sName,
int height,
int[] columnWidths)
Deprecated.
|
GralWidget |
addText(java.lang.String sText,
char size,
int color)
Deprecated.
|
GralRectangle |
calcWidgetPosAndSize(GralPos pos,
int widthwidgetNat,
int heigthWidgetNat)
Calculates the bounds of a widget with a given pos independent of this
GralMng.ImplAccess.pos() . |
GralPanelContent |
createCompositeBox(java.lang.String name)
Creates a box inside the current panel to hold some widgets.
|
protected GralMenu |
createContextMenu(GralWidget widg)
Creates the context menu for the given widget for right-mouse pressing.
|
GralFileDialog_ifc |
createFileDialog() |
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.
|
void |
createImplWidget_Gthread(GralWidget widgg) |
protected GralMenu |
createMenuBar(GralWindow windg)
Creates the menu bar for the given window.
|
void |
createSubWindow(GralWindow windowGral) |
GralWindow |
createWindow(java.lang.String name,
java.lang.String title,
int windProps)
Deprecated.
|
org.eclipse.swt.graphics.Color |
getColorImpl(GralColor colorGral)
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.
|
org.eclipse.swt.widgets.Composite |
getCurrentPanel()
The composite of the panel in SWT.
|
java.lang.String |
getValueFromWidget(GralWidget widgd)
Deprecated.
|
org.eclipse.swt.widgets.Composite |
getWidgetsPanel(GralWidget widg) |
void |
redrawWidget(java.lang.String sName)
Forces the redrawing for all set samples.
|
boolean |
remove(GralPanelContent compositeBox) |
void |
resizeWidget(GralWidget widgd,
int xSizeParent,
int ySizeParent)
Forces the resizing of the given widged.
|
void |
setSampleCurveViewY(java.lang.String sName,
float[] values)
Adds a sampling value set.
|
boolean |
showContextMenuGthread(GralWidget widg)
Shows the context menu of any widget independent of the internal right-mouse invocation.
|
protected void |
windowClosing()
This method can be override by the user to force some actions if the dialog window is closed.
|
protected GralMenu |
XXXaddPopupMenu(java.lang.String sName) |
GralWidget |
XXXaddTextField(GralWidget widgetInfo,
boolean editable,
java.lang.String prompt,
char promptStylePosition)
Adds a text field for showing or editing a text value.
|
GralWidget |
XXXaddTextField(java.lang.String name,
boolean editable,
java.lang.String prompt,
char promptStylePosition)
Adds a text field for showing or editing a text value.
|
boolean |
XXXsetWindowsVisible(GralWindow_ifc window,
GralPos atPos)
Sets a given and registered window visible at the given position and size or set it invisible.
|
indexNameWidgets, listVisiblePanels_add, pos, sCurrPanel, userMainKeyAction
protected SwtMng.SwtMngFocusListener focusListener
public final SwtProperties propertiesGuiSwt
GralMng
contains an aggregation
to the same instance, but with type GralGridProperties
. Internally there are some more
Swt-capabilities in the derived type.public static final java.lang.String version
GralPanelContent.GralPanelContent(String, String, char)
and GralTabbedPanel.GralTabbedPanel(String, String, GralPanelActivated_ifc, int)
was invoked with "@" for the posString without any more posString information. That is false. The idea was: Set the current panel. But that does not run.
See changes on GralMng
on 2016-09-02.
createImplWidget_Gthread(GralWidget)
instanciates all widget types.
resizeWidget(GralWidget, int, int)
can work with more as one widget implementation.
But it isn't test and used yet. Size of any implementation widget?
#setPosAndSizeSwt(Control, int, int)
etc.
#setInfoGthread(GralWidget, int, int, Object, Object)
routine
uses the SwtSetValue_ifc
capability to associate cmd to types of widgets. Yet used only for SwtSubWindow
.
#setInfoGthread(GralWidget, int, int, Object, Object)
catches
any exception, before: An exception causes aborting the graphic thread.
#addLed(String, String, String)
now uses GralLed
.
#swtKeyListener
as base for all fields.
calcPositionOfWindow(GralPos)
improved
GralMng_ifc.cmdClear
used to clear a whole swt.Table, commonly using: clear a content of widget.
protected org.eclipse.swt.graphics.Rectangle XXXXXcurrPanelPos
protected SwtMng(org.eclipse.swt.widgets.Display display, 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 SwtMng(org.eclipse.swt.widgets.Display display, SwtProperties propertiesGui, 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 GralCurveView addCurveViewY(java.lang.String sName, int nrofXvalues, GralCurveView.CommonCurve common)
addCurveViewY
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 GralWidget addFocusAction(java.lang.String sName, GralUserAction action, java.lang.String sCmdEnter, java.lang.String sCmdRelease)
addFocusAction
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 GralTabbedPanel addTabbedPanel(java.lang.String namePanel, GralPanelActivated_ifc user, int property)
addTabbedPanel
in class GralMng.ImplAccess
GralMng.ImplAccess.addTabbedPanel(java.lang.String, org.vishia.gral.base.GralPanelActivated_ifc, int)
@Deprecated public GralTable addTable(java.lang.String sName, int height, int[] columnWidths)
addTable
in class GralMng.ImplAccess
@Deprecated public GralWidget addText(java.lang.String sText, char size, int color)
addText
in class GralMng.ImplAccess
public GralRectangle calcWidgetPosAndSize(GralPos pos, int widthwidgetNat, int heigthWidgetNat)
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.
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 GralPanelContent createCompositeBox(java.lang.String name)
GralMng.ImplAccess
createCompositeBox
in class GralMng.ImplAccess
protected GralMenu createContextMenu(GralWidget widg)
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 GralFileDialog_ifc createFileDialog()
createFileDialog
in class GralMng.ImplAccess
public GralPanelContent createGridPanel(java.lang.String namePanel, GralColor backGround, int xG, int yG, int xS, int yS)
GralMng.ImplAccess
createGridPanel
in class GralMng.ImplAccess
public void createImplWidget_Gthread(GralWidget widgg)
createImplWidget_Gthread
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 void createSubWindow(GralWindow windowGral)
createSubWindow
in class GralMng.ImplAccess
@Deprecated public GralWindow createWindow(java.lang.String name, java.lang.String title, int windProps)
createWindow
in class GralMng.ImplAccess
public org.eclipse.swt.graphics.Color getColorImpl(GralColor colorGral)
GralMng.ImplAccess
getColorImpl
in class GralMng.ImplAccess
colorGral
- The Color.public org.eclipse.swt.widgets.Composite getCurrentPanel()
getCurrentPanel
in class GralMng.ImplAccess
GralMng.ImplAccess.getCurrentPanel()
@Deprecated public java.lang.String getValueFromWidget(GralWidget widgd)
getValueFromWidget
in class GralMng.ImplAccess
public org.eclipse.swt.widgets.Composite getWidgetsPanel(GralWidget widg)
public void redrawWidget(java.lang.String sName)
GralMng.ImplAccess
redrawWidget
in class GralMng.ImplAccess
sName
- The name of the widget.public boolean remove(GralPanelContent compositeBox)
remove
in class GralMng.ImplAccess
public void resizeWidget(GralWidget widgd, int xSizeParent, int ySizeParent)
GralMng.ImplAccess
resizeWidget
in class GralMng.ImplAccess
widgd
- the widgetpublic void setSampleCurveViewY(java.lang.String sName, float[] values)
GralMng.ImplAccess
setSampleCurveViewY
in class GralMng.ImplAccess
sName
- The registered namevalues
- The values.public boolean showContextMenuGthread(GralWidget widg)
GralMng.ImplAccess
showContextMenuGthread
in class GralMng.ImplAccess
widg
- The widget.protected void windowClosing()
protected GralMenu XXXaddPopupMenu(java.lang.String sName)
XXXaddPopupMenu
in class GralMng.ImplAccess
public GralWidget XXXaddTextField(GralWidget widgetInfo, boolean editable, java.lang.String prompt, char promptStylePosition)
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 GralWidget XXXaddTextField(java.lang.String name, boolean editable, java.lang.String prompt, char promptStylePosition)
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 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)
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.