public class UI extends Object implements LXEngine.Dispatch
Modifier and Type | Class and Description |
---|---|
static class |
UI.CoordinateSystem |
class |
UI.Profiler |
Modifier and Type | Field and Description |
---|---|
PApplet |
applet |
static int |
BLACK
Black color
|
StringParameter |
contextualHelpText |
protected UI.CoordinateSystem |
coordinateSystem |
P3LX |
lx |
UI.Profiler |
profiler |
UITheme |
theme
UI look and feel
|
static int |
WHITE
White color
|
Constructor and Description |
---|
UI(P3LX lx) |
UI(PApplet applet)
Creates a new UI instance
|
Modifier and Type | Method and Description |
---|---|
UI |
addLayer(UI2dContext layer)
Add a 2d context to this UI
|
UI |
addLayer(UI2dContext layer,
int index)
Add a 2d context to this UI at the given index
|
UI |
addLayer(UI3dContext layer)
Add a 3d context to this UI
|
UI |
addLayer(UI3dContext layer,
int index)
Add a 3d context to this UI, at the given index
|
UI |
addLoopTask(LXLoopTask loopTask)
Add a task to be performed on every loop of the UI engine.
|
protected void |
beginDraw() |
UI |
bringToTop(UI2dContext layer)
Brings a layer to the top of the UI stack
|
void |
dispatch() |
void |
draw()
Draws the UI
|
protected void |
endDraw() |
void |
focusNext(Event event) |
void |
focusPrev(Event event) |
static UI |
get() |
int |
getHeight()
Get height of the UI
|
int |
getWidth()
Get width of the UI
|
UI |
hideContextOverlay() |
void |
keyEvent(KeyEvent keyEvent) |
PFont |
loadFont(String font)
Load a font file
|
UI |
mapModulationSource(LXModulationEngine modulationEngine,
UIModulationSource modulationSource) |
UI |
mapModulationSource(UIModulationSource modulationSource) |
UI |
mapTriggerSource(UITriggerSource triggerSource) |
void |
mouseEvent(MouseEvent mouseEvent) |
void |
onLoad(File file) |
protected void |
onResize() |
void |
onSaveAs(File file) |
void |
pre() |
void |
reflow() |
UI |
removeLayer(UI2dContext layer)
Remove a 2d context from this UI
|
UI |
removeLayer(UI3dContext layer) |
UI |
removeLoopTask(LXLoopTask loopTask)
Remove a task from the UI engine
|
void |
resize(int width,
int height) |
UI |
setBackground(boolean hasBackground) |
UI |
setBackgroundColor(int backgroundColor) |
UI |
setCoordinateSystem(UI.CoordinateSystem coordinateSystem) |
UI |
setHighlightParameterModulation(LXParameterModulation highlightParameterModulation) |
void |
setMouseoverHelpText(String helpText) |
UI |
setResizable(boolean resizable)
Sets whether the UI should be resizable.
|
UI |
setTopLevelKeyEventHandler(UIEventHandler eventHandler)
Sets an object to handle top-level input events
|
void |
showConfirmDialog(String message,
Runnable confirm) |
UI |
showContextOverlay(UI2dComponent contextOverlay) |
void |
showError() |
public final UI.Profiler profiler
public final P3LX lx
public final PApplet applet
public final StringParameter contextualHelpText
protected UI.CoordinateSystem coordinateSystem
public final UITheme theme
public static final int WHITE
public static final int BLACK
public UI(P3LX lx)
public UI(PApplet applet)
applet
- The PAppletpublic void showError()
public UI setHighlightParameterModulation(LXParameterModulation highlightParameterModulation)
public UI setCoordinateSystem(UI.CoordinateSystem coordinateSystem)
public void reflow()
public static UI get()
public UI setBackground(boolean hasBackground)
public UI setBackgroundColor(int backgroundColor)
public void focusPrev(Event event)
public void focusNext(Event event)
public void setMouseoverHelpText(String helpText)
public UI setTopLevelKeyEventHandler(UIEventHandler eventHandler)
eventHandler
- Event handlerpublic UI mapTriggerSource(UITriggerSource triggerSource)
public UI mapModulationSource(UIModulationSource modulationSource)
public UI mapModulationSource(LXModulationEngine modulationEngine, UIModulationSource modulationSource)
public UI setResizable(boolean resizable)
resizable
- Whether UI is resizablepublic int getWidth()
public int getHeight()
public UI addLoopTask(LXLoopTask loopTask)
loopTask
- Task to perform on every UI looppublic UI removeLoopTask(LXLoopTask loopTask)
loopTask
- Task to stop performing on every UI looppublic UI addLayer(UI2dContext layer)
layer
- UI layerpublic UI addLayer(UI2dContext layer, int index)
layer
- UI layerindex
- Indexpublic UI removeLayer(UI2dContext layer)
layer
- UI layerpublic UI addLayer(UI3dContext layer)
layer
- 3d contextpublic UI addLayer(UI3dContext layer, int index)
layer
- 3d contextindex
- Index in the UI stackpublic UI removeLayer(UI3dContext layer)
public UI bringToTop(UI2dContext layer)
layer
- UI layerpublic UI hideContextOverlay()
public UI showContextOverlay(UI2dComponent contextOverlay)
public PFont loadFont(String font)
font
- Font namepublic void resize(int width, int height)
public final void pre()
public final void draw()
protected void beginDraw()
protected void endDraw()
protected void onResize()
public void dispatch()
dispatch
in interface LXEngine.Dispatch
public void mouseEvent(MouseEvent mouseEvent)
public void keyEvent(KeyEvent keyEvent)
public final void onSaveAs(File file)
public final void onLoad(File file)
LX library by Mark C. Slee. © 2012-2020