Class Window

  • All Implemented Interfaces:
    Cullable, Layout
    Direct Known Subclasses:
    Dialog

    public class Window
    extends Table
    A table that can be dragged and act as a modal window. The top padding is used as the window's title height.

    The preferred size of a window is the preferred size of the title text and the children as laid out by the table. After adding children to the window, it can be convenient to call WidgetGroup.pack() to size the window to the size of the children.

    • Field Detail

      • edge

        protected int edge
      • dragging

        protected boolean dragging
    • Constructor Detail

      • Window

        public Window​(java.lang.String title,
                      Skin skin)
      • Window

        public Window​(java.lang.String title,
                      Skin skin,
                      java.lang.String styleName)
    • Method Detail

      • keepWithinStage

        public void keepWithinStage()
      • draw

        public void draw​(Batch batch,
                         float parentAlpha)
        Description copied from class: WidgetGroup
        If this method is overridden, the super method or WidgetGroup.validate() should be called to ensure the widget group is laid out.
        Overrides:
        draw in class Table
        parentAlpha - The parent alpha, to be multiplied with this actor's alpha, allowing the parent's alpha to affect all children.
      • drawStageBackground

        protected void drawStageBackground​(Batch batch,
                                           float parentAlpha,
                                           float x,
                                           float y,
                                           float width,
                                           float height)
      • drawBackground

        protected void drawBackground​(Batch batch,
                                      float parentAlpha,
                                      float x,
                                      float y)
        Description copied from class: Table
        Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background drawable.
        Overrides:
        drawBackground in class Table
      • hit

        @Null
        public Actor hit​(float x,
                         float y,
                         boolean touchable)
        Description copied from class: WidgetGroup
        If this method is overridden, the super method or WidgetGroup.validate() should be called to ensure the widget group is laid out.
        Overrides:
        hit in class Table
        touchable - If true, hit detection will respect the touchability.
        See Also:
        Touchable
      • isMovable

        public boolean isMovable()
      • setMovable

        public void setMovable​(boolean isMovable)
      • isModal

        public boolean isModal()
      • setModal

        public void setModal​(boolean isModal)
      • setKeepWithinStage

        public void setKeepWithinStage​(boolean keepWithinStage)
      • isResizable

        public boolean isResizable()
      • setResizable

        public void setResizable​(boolean isResizable)
      • setResizeBorder

        public void setResizeBorder​(int resizeBorder)
      • isDragging

        public boolean isDragging()
      • getTitleTable

        public Table getTitleTable()
      • getTitleLabel

        public Label getTitleLabel()