Package HAL.Gui
Class UIWindow
- java.lang.Object
-
- HAL.Gui.UIWindow
-
- Direct Known Subclasses:
InteractiveModel
public class UIWindow extends java.lang.Objecta JFrame wrapper that holds menu and gui items the window that the other gui items sit in
-
-
Constructor Summary
Constructors Constructor Description UIWindow()the below constructors are variants of the above constructor with default values for some of the argumentsUIWindow(boolean active)UIWindow(boolean killOnClose, GuiCloseAction CloseAction)UIWindow(boolean killOnClose, GuiCloseAction CloseAction, boolean active)UIWindow(java.lang.String title)UIWindow(java.lang.String title, boolean active)UIWindow(java.lang.String title, boolean killOnClose, GuiCloseAction CloseAction)UIWindow(java.lang.String title, boolean killOnClose, GuiCloseAction CloseAction, boolean active)
-
Method Summary
Modifier and Type Method Description voidAddCol(int col, GuiComp comp)adds component by dropping down into the specified column think connect 4 or tetrisvoidAddKeyResponses(KeyResponse OnKeyDown, KeyResponse OnKeyUp)voidClose()destroys the gui with the window closing eventbooleanGetBool(java.lang.String label)doubleGetDouble(java.lang.String label)intGetInt(java.lang.String label)java.lang.StringGetString(java.lang.String label)voidGreyOut(boolean onOff)Disables or enables all interacton with the UIWindowbooleanIsActive()booleanIsClosed()booleanIsKeyDown(char c)booleanIsKeyDown(int keyCode)booleanIsRunning()java.lang.String[]LabelStrings()voidRunGui()starts the gui thread and reveals the gui to the uservoidSetColor(int backgroundColor)sets the gui background colorvoidSetLables(java.lang.String[] labels)voidSetParam(java.lang.String label, java.lang.String value)voidSetParamChangeAction(ParamSetChangeAction paramChangeAction)voidSetParamValues(java.lang.String[] vals)voidSetValsAndLabels(java.lang.String[] labels, java.lang.String[] vals)voidTickPause(int millis)java.lang.String[]ValueStrings()
-
-
-
Constructor Detail
-
UIWindow
public UIWindow(java.lang.String title, boolean killOnClose, GuiCloseAction CloseAction, boolean active)- Parameters:
title- the title that will appear at the top of the windowkillOnClose- whether the program should terminate on closing the windowCloseAction- function that will run when the window is closedactive- if set to false, the UIWindow will not actually render and its methods will be skipped (default true)
-
UIWindow
public UIWindow()
the below constructors are variants of the above constructor with default values for some of the arguments
-
UIWindow
public UIWindow(boolean active)
-
UIWindow
public UIWindow(boolean killOnClose, GuiCloseAction CloseAction)
-
UIWindow
public UIWindow(boolean killOnClose, GuiCloseAction CloseAction, boolean active)
-
UIWindow
public UIWindow(java.lang.String title)
-
UIWindow
public UIWindow(java.lang.String title, boolean active)
-
UIWindow
public UIWindow(java.lang.String title, boolean killOnClose, GuiCloseAction CloseAction)
-
-
Method Detail
-
TickPause
public void TickPause(int millis)
-
SetColor
public void SetColor(int backgroundColor)
sets the gui background color- Parameters:
backgroundColor- default color of any empty space on the gui
-
SetParamChangeAction
public void SetParamChangeAction(ParamSetChangeAction paramChangeAction)
-
GreyOut
public void GreyOut(boolean onOff)
Disables or enables all interacton with the UIWindow- Parameters:
onOff- whether to enable or disable the gui
-
IsKeyDown
public boolean IsKeyDown(char c)
-
IsKeyDown
public boolean IsKeyDown(int keyCode)
-
AddKeyResponses
public void AddKeyResponses(KeyResponse OnKeyDown, KeyResponse OnKeyUp)
-
RunGui
public void RunGui()
starts the gui thread and reveals the gui to the user
-
IsActive
public boolean IsActive()
-
IsRunning
public boolean IsRunning()
-
IsClosed
public boolean IsClosed()
-
SetParamValues
public void SetParamValues(java.lang.String[] vals)
-
GetInt
public int GetInt(java.lang.String label)
-
GetDouble
public double GetDouble(java.lang.String label)
-
GetString
public java.lang.String GetString(java.lang.String label)
-
GetBool
public boolean GetBool(java.lang.String label)
-
SetLables
public void SetLables(java.lang.String[] labels)
-
SetParam
public void SetParam(java.lang.String label, java.lang.String value)
-
SetValsAndLabels
public void SetValsAndLabels(java.lang.String[] labels, java.lang.String[] vals)
-
ValueStrings
public java.lang.String[] ValueStrings()
-
LabelStrings
public java.lang.String[] LabelStrings()
-
AddCol
public void AddCol(int col, GuiComp comp)adds component by dropping down into the specified column think connect 4 or tetris- Parameters:
col- column to drop from. the left end of the component will occupy this columncomp- component to be added
-
Close
public void Close()
destroys the gui with the window closing event
-
-