Class Dropdown.Entry
-
- All Implemented Interfaces:
-
kotlin.Cloneable
public final class Dropdown.Entry extends ContainingComponent
-
-
Field Summary
Fields Modifier and Type Field Description private final DropdownProperties.Entrypropertiesprivate final Texttextprivate final Imageimageprivate transient Dropdowndropdownprivate transient Booleanshowprivate final ArrayList<Component>childrenprivate transient PolyColor.Animatedcolorprivate transient Drawableparentprivate transient Layoutlayoutprivate transient BooleanconsumesHoverprivate Booleandisabledprivate Vec2<Unit>sizeprivate final transient HashMap<Event, Function2<Drawable, Event, Boolean>>eventHandlersprivate transient StringsimpleNameprivate transient Rendererrendererprivate transient PolyUIpolyUIprivate BooleanacceptsInputprivate final transient ByteinitStageprivate final transient BooleanmouseOverprivate Booleanrendersprivate Floatxprivate Floatyprivate Floatwidthprivate Floatheightprivate Booleanexistsprivate transient FloattrueXprivate transient FloattrueYprivate final Unit.TypeatTypeprivate final Unit.TypesizeTypeprivate final BooleanisDynamicprivate Doublerotationprivate DoubleskewXprivate DoubleskewYprivate FloatscaleXprivate FloatscaleYprivate Floatalphaprivate transient Floatacxprivate transient Floatacyprivate final Vec2<Unit>atprivate final BooleanrawResize
-
Constructor Summary
Constructors Constructor Description Dropdown.Entry(String text, PolyImage icon, Side iconSide, DropdownProperties.Entry properties, Function0<Unit> onSelected)Dropdown.Entry(String text, PolyImage icon, Side iconSide, DropdownProperties.Entry properties)Dropdown.Entry(String text, PolyImage icon, Side iconSide)Dropdown.Entry(String text, PolyImage icon)Dropdown.Entry(String text)Dropdown.Entry(Translator.Text txt, PolyImage icon, Side iconSide, DropdownProperties.Entry properties, Function0<Unit> onSelected)Dropdown.Entry(Translator.Text txt, PolyImage icon, Side iconSide, DropdownProperties.Entry properties)Dropdown.Entry(Translator.Text txt, PolyImage icon, Side iconSide)Dropdown.Entry(Translator.Text txt, PolyImage icon)Dropdown.Entry(Translator.Text txt)
-
Method Summary
Modifier and Type Method Description DropdownProperties.EntrygetProperties()final TextgetText()final ImagegetImage()final DropdowngetDropdown()final UnitsetDropdown(Dropdown dropdown)final BooleangetShow()final UnitsetShow(Boolean show)UnitonInitComplete()This function is called when initialization of a drawable is complete, so it has been fully calculated. Booleanaccept(Event event)called when this drawable receives an event. UnitcalculateBounds()Calculate the position and size of this drawable. Vec2<Unit>calculateSize()Implement this function to return the size of this drawable, if no size is specified during construction. Dropdown.Entryclone()Implement this function to enable cloning of your Drawable. Booleanequals(Object other)-
Methods inherited from class org.polyfrost.polyui.component.ContainingComponent
addComponents, calculateChildBounds, clipDrawables, debugRender, getChildren, isInside, onColorsChanged, onFontsChanged, onParentInitComplete, preRender, recolor, recolorAll, recolorRecolorsAll, removeComponents, render, rescale, reset, setup, trueX, trueY -
Methods inherited from class org.polyfrost.polyui.component.Component
addKeyframes, addOperation, canBeRemoved, draggable, every, getColor, getConsumesHover, getDisabled, getLayout, getParent, getSize, setColor, setConsumesHover, setDisabled, setLayout, setParent, setProperties, setSize, toString, wantRedraw -
Methods inherited from class org.polyfrost.polyui.component.Drawable
addEventHandler, addEventhandler, animateBy, animateTo, debugPrint, doDynamicSize, events, fadeBy, fadeTo, getAcceptsInput, getAcx, getAcy, getAlpha, getAt, getAtType, getContainingLayout, getEventHandlers, getExists, getHeight, getInitStage, getMouseOver, getPolyUI, getRawResize, getRenderer, getRenders, getRotation, getScaleX, getScaleY, getSimpleName, getSizeType, getSkewX, getSkewY, getTrueX, getTrueY, getWidth, getX, getY, intersects, isDynamic, isInside, moveBy, moveTo, postRender, removeOperation, resize, rotateBy, rotateTo, scaleBy, scaleTo, setAcceptsInput, setAcx, setAcy, setAlpha, setExists, setHeight, setPolyUI, setRenderer, setRenders, setRotation, setScaleX, setScaleY, setSimpleName, setSkewX, setSkewY, setTrueX, setTrueY, setWidth, setX, setY, skewBy, skewTo -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
Dropdown.Entry
Dropdown.Entry(String text, PolyImage icon, Side iconSide, DropdownProperties.Entry properties, Function0<Unit> onSelected)
-
Dropdown.Entry
Dropdown.Entry(String text, PolyImage icon, Side iconSide, DropdownProperties.Entry properties)
-
Dropdown.Entry
Dropdown.Entry(String text)
-
Dropdown.Entry
Dropdown.Entry(Translator.Text txt, PolyImage icon, Side iconSide, DropdownProperties.Entry properties, Function0<Unit> onSelected)
-
Dropdown.Entry
Dropdown.Entry(Translator.Text txt, PolyImage icon, Side iconSide, DropdownProperties.Entry properties)
-
Dropdown.Entry
Dropdown.Entry(Translator.Text txt, PolyImage icon, Side iconSide)
-
Dropdown.Entry
Dropdown.Entry(Translator.Text txt, PolyImage icon)
-
Dropdown.Entry
Dropdown.Entry(Translator.Text txt)
-
-
Method Detail
-
getProperties
DropdownProperties.Entry getProperties()
-
getDropdown
final Dropdown getDropdown()
-
setDropdown
final Unit setDropdown(Dropdown dropdown)
-
onInitComplete
Unit onInitComplete()
This function is called when initialization of a drawable is complete, so it has been fully calculated.
This function is called once, and only once.
- Since:
0.19.0
-
accept
Boolean accept(Event event)
called when this drawable receives an event.
make sure to call Drawable.accept!
- Returns:
true if the event should be consumed (cancelled so no more handlers are called), false otherwise.
-
calculateBounds
Unit calculateBounds()
Calculate the position and size of this drawable. Make sure to call doDynamicSize in this method to avoid issues with sizing.
This method is called once the layout is populated for children and component, and when a recalculation is requested.
The value of layout's bounds will be updated after this method is called, so do not use layout's bounds as an updated value in this method.
-
calculateSize
Vec2<Unit> calculateSize()
Implement this function to return the size of this drawable, if no size is specified during construction.
This should be so that if the drawable can determine its own size (for example, it is an image), then the size parameter in the constructor can be omitted using:
size: Vec2<org.polyfrost.polyui.unit.Unit>? = null;and this method needs to be implemented!Otherwise, the size parameter in the constructor must be specified.
-
clone
Dropdown.Entry clone()
Implement this function to enable cloning of your Drawable.
If this function is not implemented, attempts to clone the drawable will not compile due to type erasure, but if this is ignored a CloneNotSupportedException will be thrown.
- Since:
0.19.0
-
-
-
-