Class UIElement

java.lang.Object
zombie.ui.UIElement
All Implemented Interfaces:
UIElementInterface
Direct Known Subclasses:
ActionProgressBar, Clock, DialogButton, FPSGraph, GenericButton, HUDButton, LoadingQueueUI, MoodlesUI, NewWindow, ObjectTooltip, RadarPanel, RadialMenu, RadialProgressBar, ScrollBar, SpeedControls, TextBox, UI_BodyPart, UI3DModel, UI3DScene, UIDialoguePanel, UINineGrid, UITextBox2, UIWorldMap, VehicleGauge

public class UIElement extends Object implements UIElementInterface
  • Field Details

    • capture

      public boolean capture
    • ignoreLossControl

      public boolean ignoreLossControl
    • clickedValue

      public String clickedValue
    • controls

      public final ArrayList<UIElement> controls
    • defaultDraw

      public boolean defaultDraw
    • followGameWorld

      public boolean followGameWorld
    • height

      public float height
    • parent

      public UIElement parent
    • visible

      public boolean visible
    • width

      public float width
    • x

      public double x
    • y

      public double y
    • table

      public se.krka.kahlua.vm.KahluaTable table
    • alwaysBack

      public boolean alwaysBack
    • scrollChildren

      public boolean scrollChildren
    • scrollWithParent

      public boolean scrollWithParent
    • anchorTop

      public boolean anchorTop
    • anchorLeft

      public boolean anchorLeft
    • anchorRight

      public boolean anchorRight
    • anchorBottom

      public boolean anchorBottom
    • playerContext

      public int playerContext
    • alwaysOnTop

      public boolean alwaysOnTop
    • maxDrawHeight

      public int maxDrawHeight
  • Constructor Details

    • UIElement

      public UIElement()
    • UIElement

      public UIElement(se.krka.kahlua.vm.KahluaTable table)
  • Method Details

    • getMaxDrawHeight

      public Double getMaxDrawHeight()
      Specified by:
      getMaxDrawHeight in interface UIElementInterface
    • setMaxDrawHeight

      public void setMaxDrawHeight(double height)
    • clearMaxDrawHeight

      public void clearMaxDrawHeight()
    • getXScroll

      public Double getXScroll()
    • setXScroll

      public void setXScroll(double x)
    • getYScroll

      public Double getYScroll()
    • setYScroll

      public void setYScroll(double y)
    • setAlwaysOnTop

      public void setAlwaysOnTop(boolean b)
    • isAlwaysOnTop

      public boolean isAlwaysOnTop()
      Specified by:
      isAlwaysOnTop in interface UIElementInterface
    • backMost

      public void backMost()
    • isBackMost

      public boolean isBackMost()
      Specified by:
      isBackMost in interface UIElementInterface
    • AddChild

      public void AddChild(UIElement el)
    • RemoveChild

      public void RemoveChild(UIElement el)
    • getScrollHeight

      public Double getScrollHeight()
    • setScrollHeight

      public void setScrollHeight(double h)
    • isConsumeMouseEvents

      public boolean isConsumeMouseEvents()
    • setConsumeMouseEvents

      public void setConsumeMouseEvents(boolean bConsume)
    • ClearChildren

      public void ClearChildren()
    • ButtonClicked

      public void ButtonClicked(String name)
    • DrawText

      public void DrawText(UIFont font, String text, double x, double y, double zoom, double r, double g, double b, double alpha)
    • DrawText

      public void DrawText(String text, double x, double y, double r, double g, double b, double alpha)
    • DrawText

      public void DrawText(String text, double x, double y, double width, double height, double r, double g, double b, double alpha)
    • DrawText

      public void DrawText(UIFont font, String text, double x, double y, double r, double g, double b, double alpha)
    • DrawTextUntrimmed

      public void DrawTextUntrimmed(UIFont font, String text, double x, double y, double r, double g, double b, double alpha)
    • DrawTextCentre

      public void DrawTextCentre(String text, double x, double y, double r, double g, double b, double alpha)
    • DrawTextCentre

      public void DrawTextCentre(UIFont font, String text, double x, double y, double r, double g, double b, double alpha)
    • DrawTextRight

      public void DrawTextRight(String text, double x, double y, double r, double g, double b, double alpha)
    • DrawTextRight

      public void DrawTextRight(UIFont font, String text, double x, double y, double r, double g, double b, double alpha)
    • drawTextWithBackground

      public void drawTextWithBackground(UIFont font, String text, double x, double y, double r, double g, double b, double a, double padX, double padY, double bgR, double bgG, double bgB, double bgA)
    • DrawTextureAngle

      public void DrawTextureAngle(Texture tex, double centerX, double centerY, double angle, double r, double g, double b, double a)
    • DrawTextureAngle

      public void DrawTextureAngle(Texture tex, double centerX, double centerY, double angle)
    • DrawTexture

      public void DrawTexture(Texture tex, double tlx, double tly, double trx, double try2, double brx, double bry, double blx, double bly, double r, double g, double b, double a)
    • DrawTexture

      public void DrawTexture(Texture tex, double x, double y, double alpha)
    • DrawTextureCol

      public void DrawTextureCol(Texture tex, double x, double y, Color col)
    • DrawTextureScaled

      public void DrawTextureScaled(Texture tex, double x, double y, double width, double height, double alpha)
    • DrawTextureScaledUniform

      public void DrawTextureScaledUniform(Texture tex, double x, double y, double scale, double r, double g, double b, double alpha)
    • DrawTextureScaledAspect

      public void DrawTextureScaledAspect(Texture tex, double x, double y, double width, double height, double r, double g, double b, double alpha)
    • DrawTextureScaledAspect2

      public void DrawTextureScaledAspect2(Texture tex, double x, double y, double width, double height, double r, double g, double b, double alpha)
    • DrawTextureScaledAspect3

      public void DrawTextureScaledAspect3(Texture tex, double x, double y, double width, double height, double r, double g, double b, double alpha)
    • DrawTextureScaledCol

      public void DrawTextureScaledCol(Texture tex, double x, double y, double width, double height, double r, double g, double b, double a)
    • DrawTextureScaledCol

      public void DrawTextureScaledCol(Texture tex, double x, double y, double width, double height, Color col)
    • DrawTextureScaledColor

      public void DrawTextureScaledColor(Texture tex, Double x, Double y, Double width, Double height, Double r, Double g, Double b, Double a)
    • DrawTextureColor

      public void DrawTextureColor(Texture tex, double x, double y, double r, double g, double b, double a)
    • DrawLine

      public void DrawLine(Texture tex, double x1, double y1, double x2, double y2, float thickness, double r, double g, double b, double a)
    • DrawPolygon

      public void DrawPolygon(Texture tex, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, double r, double g, double b, double a)
    • DrawItemIcon

      public void DrawItemIcon(InventoryItem item, double x, double y, double alpha, double width, double height)
    • DrawScriptItemIcon

      public void DrawScriptItemIcon(Item scriptItem, double x, double y, double alpha, double width, double height)
    • DrawTextureIcon

      public void DrawTextureIcon(Texture tex, double x, double y, double width, double height, double r, double g, double b, double alpha)
    • DrawTextureIconMask

      public void DrawTextureIconMask(Texture tex, double yRatio, double x, double y, double width, double height, double r, double g, double b, double alpha)
    • DrawTexturePercentage

      public void DrawTexturePercentage(Texture tex, double yRatio, double x, double y, double width, double height, double r, double g, double b, double alpha)
    • DrawTexturePercentageBottomUp

      public void DrawTexturePercentageBottomUp(Texture tex, double yRatio, double x, double y, double width, double height, double r, double g, double b, double alpha)
    • DrawSubTextureRGBA

      public void DrawSubTextureRGBA(Texture tex, double subX, double subY, double subW, double subH, double x, double y, double w, double h, double r, double g, double b, double a)
    • DrawTextureTiled

      public void DrawTextureTiled(Texture tex, double x, double y, double w, double h, double r, double g, double b, double a)
    • DrawTextureTiledX

      public void DrawTextureTiledX(Texture tex, double x, double y, double w, double h, double r, double g, double b, double a)
    • DrawTextureTiledY

      public void DrawTextureTiledY(Texture tex, double x, double y, double w, double h, double r, double g, double b, double a)
    • DrawTextureTiledYOffset

      public void DrawTextureTiledYOffset(Texture tex, double x, double y, double w, double h, double r, double g, double b, double a)
    • DrawTextureIgnoreOffset

      public void DrawTextureIgnoreOffset(Texture tex, double x, double y, int width, int height, Color col)
    • DrawTexture_FlippedX

      public void DrawTexture_FlippedX(Texture tex, double x, double y, int width, int height, Color col)
    • DrawTexture_FlippedXIgnoreOffset

      public void DrawTexture_FlippedXIgnoreOffset(Texture tex, double x, double y, int width, int height, Color col)
    • DrawUVSliceTexture

      public void DrawUVSliceTexture(Texture tex, double x, double y, double width, double height, Color col, double xStart, double yStart, double xEnd, double yEnd)
    • getScrollChildren

      public Boolean getScrollChildren()
    • setScrollChildren

      public void setScrollChildren(boolean bScroll)
    • getScrollWithParent

      public Boolean getScrollWithParent()
    • setScrollWithParent

      public void setScrollWithParent(boolean bScroll)
    • setRenderClippedChildren

      public void setRenderClippedChildren(boolean b)
    • getAbsoluteX

      public Double getAbsoluteX()
    • getAbsoluteY

      public Double getAbsoluteY()
    • getClickedValue

      public String getClickedValue()
    • setClickedValue

      public void setClickedValue(String clickedValue)
      Parameters:
      clickedValue - the clickedValue to set
    • bringToTop

      public void bringToTop()
    • onMouseUpOutside

      public void onMouseUpOutside(double x, double y)
    • onMouseDown

      public Boolean onMouseDown(double x, double y)
    • onConsumeMouseWheel

      public Boolean onConsumeMouseWheel(double del, double x, double y)
      Specified by:
      onConsumeMouseWheel in interface UIElementInterface
    • onMouseWheel

      public Boolean onMouseWheel(double del)
    • onConsumeMouseMove

      public Boolean onConsumeMouseMove(double dx, double dy, double x, double y)
      Specified by:
      onConsumeMouseMove in interface UIElementInterface
    • onMouseMove

      public Boolean onMouseMove(double dx, double dy)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • onExtendMouseMoveOutside

      public void onExtendMouseMoveOutside(double dx, double dy, double x, double y)
      Specified by:
      onExtendMouseMoveOutside in interface UIElementInterface
    • onMouseMoveOutside

      public void onMouseMoveOutside(double dx, double dy)
    • onMouseUp

      public Boolean onMouseUp(double x, double y)
    • onMouseButtonDown

      public void onMouseButtonDown(int btn, double x, double y)
    • onConsumeMouseButtonDown

      public boolean onConsumeMouseButtonDown(int btn, double x, double y)
      Specified by:
      onConsumeMouseButtonDown in interface UIElementInterface
    • onMouseButtonDownOutside

      public void onMouseButtonDownOutside(int btn, double x, double y)
      Specified by:
      onMouseButtonDownOutside in interface UIElementInterface
    • onConsumeMouseButtonUp

      public boolean onConsumeMouseButtonUp(int btn, double x, double y)
      Specified by:
      onConsumeMouseButtonUp in interface UIElementInterface
    • onMouseButtonUpOutside

      public void onMouseButtonUpOutside(int btn, double x, double y)
      Specified by:
      onMouseButtonUpOutside in interface UIElementInterface
    • onresize

      public void onresize()
    • onResize

      public void onResize()
    • onRightMouseDown

      public Boolean onRightMouseDown(double x, double y)
    • onRightMouseUp

      public Boolean onRightMouseUp(double x, double y)
    • RemoveControl

      public void RemoveControl(UIElement el)
    • render

      public void render()
      Specified by:
      render in interface UIElementInterface
    • update

      public void update()
      Specified by:
      update in interface UIElementInterface
    • BringToTop

      public void BringToTop(UIElement el)
    • isCapture

      public Boolean isCapture()
      Specified by:
      isCapture in interface UIElementInterface
      Returns:
      the capture
    • setCapture

      public void setCapture(boolean capture)
      Parameters:
      capture - the capture to set
    • isModalVisible

      public boolean isModalVisible()
      Specified by:
      isModalVisible in interface UIElementInterface
    • isIgnoreLossControl

      public Boolean isIgnoreLossControl()
      Specified by:
      isIgnoreLossControl in interface UIElementInterface
      Returns:
      the IgnoreLossControl
    • setIgnoreLossControl

      public void setIgnoreLossControl(boolean ignoreLossControl)
      Parameters:
      ignoreLossControl - the IgnoreLossControl to set
    • getControls

      public ArrayList<UIElement> getControls()
      Returns:
      the Controls
    • setControls

      public void setControls(Vector<UIElement> controls)
      Parameters:
      controls - the Controls to set
    • isDefaultDraw

      public Boolean isDefaultDraw()
      Specified by:
      isDefaultDraw in interface UIElementInterface
      Returns:
      the defaultDraw
    • setDefaultDraw

      public void setDefaultDraw(boolean defaultDraw)
      Parameters:
      defaultDraw - the defaultDraw to set
    • isFollowGameWorld

      public Boolean isFollowGameWorld()
      Specified by:
      isFollowGameWorld in interface UIElementInterface
      Returns:
      the followGameWorld
    • setFollowGameWorld

      public void setFollowGameWorld(boolean followGameWorld)
      Parameters:
      followGameWorld - the followGameWorld to set
    • getRenderThisPlayerOnly

      public int getRenderThisPlayerOnly()
      Specified by:
      getRenderThisPlayerOnly in interface UIElementInterface
    • setRenderThisPlayerOnly

      public void setRenderThisPlayerOnly(int playerIndex)
    • getHeight

      public Double getHeight()
      Specified by:
      getHeight in interface UIElementInterface
      Returns:
      the height
    • setHeight

      public void setHeight(double height)
      Parameters:
      height - the height to set
    • getParent

      public UIElement getParent()
      Specified by:
      getParent in interface UIElementInterface
      Returns:
      the Parent
    • setParent

      public void setParent(UIElement parent)
      Parameters:
      parent - the Parent to set
    • isVisible

      public Boolean isVisible()
      Specified by:
      isVisible in interface UIElementInterface
      Returns:
      the visible
    • setVisible

      public void setVisible(boolean visible)
      Parameters:
      visible - the visible to set
    • isReallyVisible

      public boolean isReallyVisible()
    • getWidth

      public Double getWidth()
      Specified by:
      getWidth in interface UIElementInterface
      Returns:
      the width
    • setWidth

      public void setWidth(double width)
      Parameters:
      width - the width to set
    • getX

      public Double getX()
      Specified by:
      getX in interface UIElementInterface
      Returns:
      the x
    • setX

      public void setX(double x)
      Parameters:
      x - the x to set
    • getXScrolled

      public Double getXScrolled(UIElement parent)
    • getYScrolled

      public Double getYScrolled(UIElement parent)
    • isEnabled

      public boolean isEnabled()
    • setEnabled

      public void setEnabled(boolean en)
    • getY

      public Double getY()
      Specified by:
      getY in interface UIElementInterface
      Returns:
      the y
    • setY

      public void setY(double y)
      Parameters:
      y - the y to set
    • isOverElement

      public boolean isOverElement(double mx, double my)
      Specified by:
      isOverElement in interface UIElementInterface
    • suspendStencil

      public void suspendStencil()
    • resumeStencil

      public void resumeStencil()
    • setStencilRect

      public void setStencilRect(double x, double y, double width, double height)
    • setStencilCircle

      public void setStencilCircle(double x, double y, double width, double height)
    • clearStencilRect

      public void clearStencilRect()
    • repaintStencilRect

      public void repaintStencilRect(double x, double y, double width, double height)
    • getTable

      public se.krka.kahlua.vm.KahluaTable getTable()
      Returns:
      the table
    • setTable

      public void setTable(se.krka.kahlua.vm.KahluaTable table)
      Parameters:
      table - the table to set
    • setHeightSilent

      public void setHeightSilent(double height)
    • setWidthSilent

      public void setWidthSilent(double width)
    • setHeightOnly

      public void setHeightOnly(double height)
    • setWidthOnly

      public void setWidthOnly(double width)
    • isAnchorTop

      public boolean isAnchorTop()
      Returns:
      the anchorTop
    • setAnchorTop

      public void setAnchorTop(boolean anchorTop)
      Parameters:
      anchorTop - the anchorTop to set
    • ignoreWidthChange

      public void ignoreWidthChange()
    • ignoreHeightChange

      public void ignoreHeightChange()
    • isAnchorLeft

      public Boolean isAnchorLeft()
      Returns:
      the anchorLeft
    • setAnchorLeft

      public void setAnchorLeft(boolean anchorLeft)
      Parameters:
      anchorLeft - the anchorLeft to set
    • isAnchorRight

      public Boolean isAnchorRight()
      Returns:
      the anchorRight
    • setAnchorRight

      public void setAnchorRight(boolean anchorRight)
      Parameters:
      anchorRight - the anchorRight to set
    • isAnchorBottom

      public Boolean isAnchorBottom()
      Returns:
      the anchorBottom
    • setAnchorBottom

      public void setAnchorBottom(boolean anchorBottom)
      Parameters:
      anchorBottom - the anchorBottom to set
    • getPlayerContext

      public int getPlayerContext()
    • setPlayerContext

      public void setPlayerContext(int nPlayer)
    • getUIName

      public String getUIName()
    • setUIName

      public void setUIName(String name)
    • clampToParentX

      public Double clampToParentX(double x)
    • clampToParentY

      public Double clampToParentY(double y)
    • isPointOver

      public Boolean isPointOver(double screenX, double screenY)
      Specified by:
      isPointOver in interface UIElementInterface
    • isMouseOver

      public Boolean isMouseOver()
      Specified by:
      isMouseOver in interface UIElementInterface
    • setWantKeyEvents

      public void setWantKeyEvents(boolean want)
    • isWantKeyEvents

      public boolean isWantKeyEvents()
      Specified by:
      isWantKeyEvents in interface UIElementInterface
    • setWantExtraMouseEvents

      public void setWantExtraMouseEvents(boolean want)
    • isWantExtraMouseEvents

      public boolean isWantExtraMouseEvents()
    • isKeyConsumed

      public boolean isKeyConsumed(int key)
    • onConsumeKeyPress

      public boolean onConsumeKeyPress(int key)
      Specified by:
      onConsumeKeyPress in interface UIElementInterface
    • onKeyPress

      public void onKeyPress(int key)
    • onConsumeKeyRepeat

      public boolean onConsumeKeyRepeat(int key)
      Specified by:
      onConsumeKeyRepeat in interface UIElementInterface
    • onKeyRepeat

      public void onKeyRepeat(int key)
    • onConsumeKeyRelease

      public boolean onConsumeKeyRelease(int key)
      Specified by:
      onConsumeKeyRelease in interface UIElementInterface
    • onKeyRelease

      public void onKeyRelease(int key)
    • isForceCursorVisible

      public boolean isForceCursorVisible()
      Specified by:
      isForceCursorVisible in interface UIElementInterface
    • setForceCursorVisible

      public void setForceCursorVisible(boolean force)
    • StartOutline

      public void StartOutline(Texture tex, float outlineThickness, float r, float g, float b, float a)
    • EndOutline

      public void EndOutline()