public class CSGOLayout extends java.lang.Object implements ILayout, IScrollSize
Modifier and Type | Field and Description |
---|---|
protected java.util.function.Supplier<Animation> |
animation
The animation supplier.
|
protected ChildUtil.ChildMode |
colorType
The child mode to use for setting components that are containers (e.g. color components).
|
protected java.lang.String |
enabledButton
The title for module toggles.
|
protected boolean |
horizontal
Whether tab list is horizontal.
|
protected ILabeled |
label
The panel label.
|
protected boolean |
moduleColumn
Whether settings are in a separate column.
|
protected java.awt.Point |
position
The panel position.
|
protected ChildUtil |
util
The child util instance.
|
protected int |
weight
The weight of the settings column.
|
protected int |
width
The panel width.
|
Constructor and Description |
---|
CSGOLayout(ILabeled label,
java.awt.Point position,
int width,
int popupWidth,
java.util.function.Supplier<Animation> animation,
java.lang.String enabledButton,
boolean horizontal,
boolean moduleColumn,
int weight,
ChildUtil.ChildMode colorType,
PopupTuple popupType)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected <T extends IComponent> |
addContainer(ILabeled label,
java.util.stream.Stream<ILabeled> labels,
IContainer<T> window,
ThemeTuple theme,
boolean horizontal,
java.util.function.Function<RadioButton,T> container,
IBoolean visible)
Add a multiplexing radio button list to a parent container.
|
protected <T> void |
addSettingsComponent(ISetting<T> setting,
VerticalContainer container,
IComponentAdder gui,
IComponentGenerator components,
ThemeTuple theme)
Add a setting component.
|
protected boolean |
isDownKey(int key)
Keyboard predicate for navigating down.
|
protected boolean |
isLeftKey(int key)
Keyboard predicate for navigating left.
|
protected boolean |
isRightKey(int key)
Keyboard predicate for navigating right.
|
protected boolean |
isUpKey(int key)
Keyboard predicate for navigating up.
|
void |
populateGUI(IComponentAdder gui,
IComponentGenerator components,
IClient client,
ITheme theme)
Populates a GUI with modules and settings given.
|
protected HorizontalComponent<ScrollBarComponent<java.lang.Void,IComponent>> |
wrapColumn(IComponent button,
ThemeTuple theme,
int weight)
Wrap content in a scrollable horizontal component to be added as a column.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getComponentWidth, getScrollHeight
protected ILabeled label
protected java.awt.Point position
protected int width
protected java.util.function.Supplier<Animation> animation
protected java.lang.String enabledButton
protected boolean horizontal
protected boolean moduleColumn
protected int weight
protected ChildUtil.ChildMode colorType
protected ChildUtil util
public CSGOLayout(ILabeled label, java.awt.Point position, int width, int popupWidth, java.util.function.Supplier<Animation> animation, java.lang.String enabledButton, boolean horizontal, boolean moduleColumn, int weight, ChildUtil.ChildMode colorType, PopupTuple popupType)
label
- panel labelposition
- panel positionwidth
- panel widthpopupWidth
- pop-up widthanimation
- animation supplierenabledButton
- title for module toggleshorizontal
- whether tab list is horizontalmoduleColumn
- whether settings are in a separate columnweight
- weight of the module columncolorType
- child mode to use for setting components that are containers (e.g. color components)popupType
- child util instancepublic void populateGUI(IComponentAdder gui, IComponentGenerator components, IClient client, ITheme theme)
ILayout
populateGUI
in interface ILayout
gui
- the GUI to populatecomponents
- the setting widgets to useclient
- the client defining the module and setting hierarchytheme
- the theme to be usedprotected <T> void addSettingsComponent(ISetting<T> setting, VerticalContainer container, IComponentAdder gui, IComponentGenerator components, ThemeTuple theme)
T
- the setting state typesetting
- the setting to be addedcontainer
- the parent containergui
- the component adder for pop-upscomponents
- the component generatortheme
- the theme to be usedprotected <T extends IComponent> IEnumSetting addContainer(ILabeled label, java.util.stream.Stream<ILabeled> labels, IContainer<T> window, ThemeTuple theme, boolean horizontal, java.util.function.Function<RadioButton,T> container, IBoolean visible)
T
- parent container component typelabel
- the radio button labellabels
- list of items to multiplexwindow
- the parent containertheme
- the theme to be usedhorizontal
- whether radio button is horizontalcontainer
- mapping from radio button to container component type instancevisible
- radio buttons visibility predicateprotected HorizontalComponent<ScrollBarComponent<java.lang.Void,IComponent>> wrapColumn(IComponent button, ThemeTuple theme, int weight)
button
- the content containertheme
- the theme to be usedweight
- the horizontal weightprotected boolean isUpKey(int key)
key
- the key scancodeprotected boolean isDownKey(int key)
key
- the key scancodeprotected boolean isLeftKey(int key)
key
- the key scancodeprotected boolean isRightKey(int key)
key
- the key scancode