GuiFactorypublic abstract class SimpleGuiFactory extends Object implements GuiFactory
| Modifier and Type | Field | Description |
|---|---|---|
protected Size |
screenSize |
Contains the screen size data.
|
| Modifier | Constructor | Description |
|---|---|---|
protected |
SimpleGuiFactory(Size screenSize) |
| Modifier and Type | Method | Description |
|---|---|---|
SimpleButton |
buildButton(String name,
BaseCoordinate coordinates,
ButtonMaterial material,
SimpleContainer container) |
Build a new widget button.
|
SimpleCheckBox |
buildCheckBox(String name,
BaseCoordinate coordinates,
Material background,
Material hover,
Material check,
Font font,
SimpleContainer container) |
Build a new check box widget.
|
abstract SimpleContainer |
buildContainerElement(String name,
BaseCoordinate coordinates,
Material background) |
Build a container base element in implementation.
|
abstract SimpleContainer |
buildContainerElement(String name,
BaseCoordinate coordinates,
Material background,
Container parent,
boolean widget) |
Build a container base element with a container parent in implementation.
|
EmptyRectangleImage |
buildEmptyRectangleImage(String name,
BaseCoordinate coordinates,
Material background,
int border,
SimpleContainer container) |
Build a new image widget.
|
EmptyRectangleImage |
buildEmptyUnderlineImage(String name,
BaseCoordinate coordinates,
Material background,
int border,
SimpleContainer container) |
|
SimpleContainer |
buildFullScreenOverlayContainer(String name,
Material background) |
Build a new full screen GUI container, the position is set to (0, 0) and the size is the screen size, a GUI container is not meant to be used alone, it must be element of a view.
|
protected abstract AbstractIconElement |
buildIconElement(String name,
BaseCoordinate coordinates,
Material material,
Container container) |
Build an image base element in implementation.
|
Image |
buildImage(String name,
BaseCoordinate coordinates,
Material background,
SimpleContainer container) |
Build a new image widget.
|
InputBox |
buildInputBox(Position position,
InputBoxTemplate def,
SimpleContainer container) |
Build a new input box widget.
|
SimpleInputBox |
buildInputBox(String name,
BaseCoordinate coordinates,
Font defaultFont,
Font captionFont,
Material background,
Material backgroundHlight,
Material cursorMaterial,
Container container) |
Build a new input box widget.
|
SimpleInputBox |
buildInputBox(String name,
BaseCoordinate coordinates,
Font font,
Material background,
Material backgroundHlight,
Material cursorMaterial,
Container container) |
Build a new input box widget.
|
InputBox |
buildInputBox(String name,
BaseCoordinate coordinates,
ButtonMaterial material,
Material cursorMaterial,
SimpleContainer container) |
Build a new input box widget.
|
InputBox |
buildInputBox(String name,
Position position,
InputBoxTemplate def,
SimpleContainer container) |
|
SimpleContainer |
buildOverlayContainer(String name,
Material background,
BaseCoordinate coordinates) |
Build a new GUI container, a GUI container is not meant to be used alone, it must be element of a view.
|
SimpleContainer |
buildOverlayContainer(String name,
Material background,
Coordinates coordinates,
SimpleContainer container) |
|
ProgressBar |
buildProgressBar(BaseCoordinate coordinates,
Material empty,
Material filled,
SimpleContainer container) |
Build a new simple progress bar widget with a random unique name.
|
ProgressBar |
buildProgressBar(String name,
BaseCoordinate coordinates,
Material empty,
Material filled,
SimpleContainer container) |
Build a new simple progress bar widget.
|
ProgressBar |
buildProgressBar(String name,
BaseCoordinate coordinates,
Material leftMat,
Material middleMat,
Material rightMat,
Material emptyMiddleMat,
Material emptyRightMat,
int borderWidth,
SimpleContainer container) |
Build a new progress bar widget.
|
ProgressBar |
buildProgressBar(String name,
Image background,
Image filled,
SimpleContainer parent) |
Build a new progress bar widget.
|
ProgressBar |
buildProgressBar(String name,
SimpleContainer container) |
Build a new progress bar widget, all parameter are set to empty.
|
TabContainer |
buildTabcontainer(String name,
String[] titles,
BaseCoordinate coordinates,
int tabWidth,
int tabHeight,
Material background,
Material tabMaterial,
Material highlight,
Material pushed,
Font font,
SimpleContainer container) |
Build a new tab container.
|
TextArea |
buildTextArea(String name,
BaseCoordinate coordinates,
Font font,
Material background,
int textPadding,
SimpleContainer container) |
Build a new multiple line text widget.
|
protected abstract AbstractTextElement |
buildTextElement(BaseCoordinate coordinates,
Font font,
Container container) |
Build an text base element in implementation.
|
SimpleTextLine |
buildTextLine(String name,
Coordinates coordinates,
Font font,
SimpleContainer container) |
Build a new line of text widget.
|
ButtonBuilder |
button() |
|
CheckBoxBuilder |
checkbox() |
|
ContainerBuilder |
container() |
|
void |
delete(Button button) |
Delete a button.
|
void |
delete(CheckBox checkBox) |
Delete a check box.
|
void |
delete(Image image) |
Delete an image.
|
void |
delete(InputBox inputBox) |
Delete an input box.
|
void |
delete(SimpleContainer container) |
Delete a container.
|
void |
delete(ProgressBar progressBar) |
Delete a progress bar.
|
void |
delete(TextArea textArea) |
Delete a text area.
|
void |
delete(TextLine textLine) |
Delete a text line.
|
Optional<Button> |
findButton(String name) |
Try to retrieve a GuiButton from its name.
|
Optional<Image> |
findImage(String name) |
try to retrieve an Image from its name.
|
GuiAnimationManager |
getAnimationManager() |
|
Button |
getButton(String name) |
Retrieve a GuiButton from its name.
|
CheckBox |
getCheckBox(String name) |
Retrieve a CheckBoxGui from its name, if no name matches, an
IllegalArgumentException is thrown. |
SimpleContainer |
getContainer(String name) |
Retrieve a GuiContainer from its name, if no name matches, an
IllegalArgumentException is thrown. |
Image |
getImage(String name) |
Retrieve an Image from its name, throw
IllegalArgumentException if no matching name is found. |
InputBox |
getInputBox(String name) |
Retrieve a InputBoxGui from its name, if no name matches, an
IllegalArgumentException is thrown. |
ProgressBar |
getProgressBar(String name) |
Retrieve a ProgressBar from its name, if no name matches, an
IllegalArgumentException is thrown. |
Size |
getScreenSize() |
|
SimpleContainer |
getSimpleContainer(String name) |
|
TextLine |
getTextLine(String name) |
Retrieve a GuiTextLine from its name, throw
IllegalArgumentException if no matching name is found. |
ImageBuilder |
image() |
|
InputBoxBuilder |
inputBox() |
|
TextAreaBuilder |
textArea() |
|
TextLineBuilder |
textLine() |
protected final Size screenSize
protected SimpleGuiFactory(Size screenSize)
public final ContainerBuilder container()
container in interface GuiFactorypublic final ButtonBuilder button()
button in interface GuiFactorypublic final TextLineBuilder textLine()
textLine in interface GuiFactorypublic final TextAreaBuilder textArea()
textArea in interface GuiFactorypublic final CheckBoxBuilder checkbox()
checkbox in interface GuiFactorypublic final ImageBuilder image()
image in interface GuiFactorypublic final InputBoxBuilder inputBox()
inputBox in interface GuiFactorypublic final SimpleButton buildButton(String name, BaseCoordinate coordinates, ButtonMaterial material, SimpleContainer container)
name - Unique button name.coordinates - GuiButton coordinates.material - GuiButton materials.container - Container holding the button.public final Button getButton(String name)
name - Name of the button to retrieve.IllegalArgumentException - If no match is done.public final Optional<Button> findButton(String name)
name - Name of the button to search for.public final void delete(Button button)
button - GuiButton to delete.public final Image buildImage(String name, BaseCoordinate coordinates, Material background, SimpleContainer container)
name - Unique image name.coordinates - Image coordinates.background - Image background material.container - Container holding the image.public final EmptyRectangleImage buildEmptyRectangleImage(String name, BaseCoordinate coordinates, Material background, int border, SimpleContainer container)
name - Unique image name.coordinates - Image coordinates.background - Image background material.border - Size of the border, in pixels.container - Container holding the image.public final EmptyRectangleImage buildEmptyUnderlineImage(String name, BaseCoordinate coordinates, Material background, int border, SimpleContainer container)
public final Image getImage(String name)
IllegalArgumentException if no matching name is found.name - Image name to retrieve.public final Optional<Image> findImage(String name)
name - Image name to retrieve.public final void delete(Image image)
image - Image to delete.public final SimpleTextLine buildTextLine(String name, Coordinates coordinates, Font font, SimpleContainer container)
name - Text line unique name.coordinates - Text line size and position.font - Font used for the text.container - Container holding the text line.public final TextLine getTextLine(String name)
IllegalArgumentException if no matching name is found.name - GuiTextLine name to retrieve.public final void delete(TextLine textLine)
textLine - Text line to delete.public final TextArea buildTextArea(String name, BaseCoordinate coordinates, Font font, Material background, int textPadding, SimpleContainer container)
name - Unique text area name.coordinates - Text area coordinates.font - Font used for the text.background - Background image.textPadding - Padding value for the text.container - Container holding the text area.public final void delete(TextArea textArea)
textArea - Text area to delete.public final ProgressBar buildProgressBar(String name, BaseCoordinate coordinates, Material leftMat, Material middleMat, Material rightMat, Material emptyMiddleMat, Material emptyRightMat, int borderWidth, SimpleContainer container)
name - Unique progress bar name.coordinates - Progress bar coordinates.leftMat - Material for the left corner.middleMat - Material for extensible part(will be stretched when the progress bar progress increase).rightMat - Material for the right corner.emptyMiddleMat - Material for the middle part to fill when still empty.emptyRightMat - Material for the right border part to fill when still empty.borderWidth - Width of the border element.container - Container holding the progress bar.public final ProgressBar buildProgressBar(String name, Image background, Image filled, SimpleContainer parent)
name - Unique progress bar name.background - Image to use as empty background.filled - Image to use as filled background.parent - Container holding the progress bar.public final ProgressBar buildProgressBar(String name, SimpleContainer container)
name - Unique progress bar name.container - Container holding the progress bar.public final ProgressBar buildProgressBar(String name, BaseCoordinate coordinates, Material empty, Material filled, SimpleContainer container)
name - Unique progress bar name.coordinates - Progress bar coordinates.empty - Material to use on empty part.filled - Material to use on filled part.container - Container holding the progress bar.public final ProgressBar buildProgressBar(BaseCoordinate coordinates, Material empty, Material filled, SimpleContainer container)
coordinates - Progress bar coordinates.empty - Material to use on empty part.filled - Material to use on filled part.container - Container holding the progress bar.public final ProgressBar getProgressBar(String name)
IllegalArgumentException is thrown.name - Name of the ProgressBar to retrieve.public final void delete(ProgressBar progressBar)
progressBar - Progress bar to delete.public final SimpleInputBox buildInputBox(String name, BaseCoordinate coordinates, Font font, Material background, Material backgroundHlight, Material cursorMaterial, Container container)
name - Unique input box name.coordinates - Input box coordinates.font - Font used for the caption.background - Background material.backgroundHlight - Background material when the widget is focused.cursorMaterial - Material to use for the cursor.container - Container holding the input box.public final SimpleInputBox buildInputBox(String name, BaseCoordinate coordinates, Font defaultFont, Font captionFont, Material background, Material backgroundHlight, Material cursorMaterial, Container container)
name - Unique input box name.coordinates - Input box coordinates.defaultFont - Font used for the default message.captionFont - Font used for the text and the caption.background - Background material.backgroundHlight - Background material when the widget is focused.cursorMaterial - Material to use for the cursor.container - Container holding the input box.public final InputBox buildInputBox(String name, BaseCoordinate coordinates, ButtonMaterial material, Material cursorMaterial, SimpleContainer container)
name - Unique input box name.coordinates - Input box coordinates.material - Background materials.cursorMaterial - Material to use for the cursor.container - Container holding the input box.public final InputBox buildInputBox(Position position, InputBoxTemplate def, SimpleContainer container)
position - Input box position.def - Input box data.container - Container holding the input box.public final InputBox buildInputBox(String name, Position position, InputBoxTemplate def, SimpleContainer container)
public final InputBox getInputBox(String name)
IllegalArgumentException is thrown.name - Name of the InputBoxGui to retrieve.public final void delete(InputBox inputBox)
inputBox - Input box to delete.public final SimpleCheckBox buildCheckBox(String name, BaseCoordinate coordinates, Material background, Material hover, Material check, Font font, SimpleContainer container)
name - Unique check box name.coordinates - Check box coordinates.background - Background material.hover - Hover material.check - Material when checked.font - Font to use for caption.container - Container holding the check box widget.public final CheckBox getCheckBox(String name)
IllegalArgumentException is thrown.name - Name of the CheckBoxGui to retrieve.public final void delete(CheckBox checkBox)
checkBox - Check box to delete.public final SimpleContainer buildOverlayContainer(String name, Material background, BaseCoordinate coordinates)
name - Unique container name.background - Material to use as background.coordinates - Container size and position.public SimpleContainer buildOverlayContainer(String name, Material background, Coordinates coordinates, SimpleContainer container)
public final SimpleContainer buildFullScreenOverlayContainer(String name, Material background)
name - Unique container name.background - Container background material.public final SimpleContainer getContainer(String name)
IllegalArgumentException is thrown.name - Name of the GuiContainer to retrieve.public final void delete(SimpleContainer container)
container - Gui container to delete.public final TabContainer buildTabcontainer(String name, String[] titles, BaseCoordinate coordinates, int tabWidth, int tabHeight, Material background, Material tabMaterial, Material highlight, Material pushed, Font font, SimpleContainer container)
name - Container name, must be unique.titles - Tab titles.coordinates - Container position and size.tabWidth - Tab width size.tabHeight - Tab height size.background - Container background material.tabMaterial - Material on inactive tab.highlight - Material on tab with mouse over.pushed - Material on active tab.font - Font to use on the tabs.container - Container holding the element.public Size getScreenSize()
getScreenSize in interface GuiFactorypublic GuiAnimationManager getAnimationManager()
getAnimationManager in interface GuiFactorypublic final SimpleContainer getSimpleContainer(String name)
protected abstract AbstractIconElement buildIconElement(String name, BaseCoordinate coordinates, Material material, Container container)
name - Unique image name.coordinates - Image size and position.material - Material to set to the image.container - Container holding the image.protected abstract AbstractTextElement buildTextElement(BaseCoordinate coordinates, Font font, Container container)
coordinates - Text size and position.font - Font to set to the text.container - Container holding the text.public abstract SimpleContainer buildContainerElement(String name, BaseCoordinate coordinates, Material background)
name - Unique container name.coordinates - Container size and position.background - Container background material.public abstract SimpleContainer buildContainerElement(String name, BaseCoordinate coordinates, Material background, Container parent, boolean widget)
name - Unique container name.coordinates - Container size and position.background - Container background material.parent - Parent container.widget - true to use this container as part of a widget instead of widget container.Copyright © 2014–2018. All rights reserved.