Class GUIFrame


public class GUIFrame extends GUIGlassPanel
A "framed" pane object that already adds the frame elements around the object, as well as a means to make the frame resizable around its edges, and draggable at its top.
Author:
Matthew Tropiano
  • Field Details

  • Constructor Details

    • GUIFrame

      public GUIFrame(float thickness)
      Creates a new GUI panel.
      Parameters:
      thickness - the thickness of the outer frame in units.
    • GUIFrame

      public GUIFrame(float width, float height, float thickness)
      Creates a new GUI object.
      Parameters:
      width - its width.
      height - its height.
      thickness -
    • GUIFrame

      public GUIFrame(float x, float y, float width, float height, float thickness)
      Creates a new GUI object.
      Parameters:
      x - its position x.
      y - its position y.
      width - its width.
      height - its height.
      thickness - the border thickness.
  • Method Details

    • correctMouseMoveX

      protected float correctMouseMoveX(float mouseX, float width)
      Gets the corrected X coordinate for a mouse movement.
      Parameters:
      mouseX - the mouse X coordinate.
      width - the frame element width.
      Returns:
      the resultant value.
    • correctMouseMoveY

      protected float correctMouseMoveY(float mouseY, float height)
      Gets the corrected Y coordinate for a mouse movement.
      Parameters:
      mouseY - the mouse Y coordinate.
      height - the frame element height.
      Returns:
      the resultant value.
    • setLayout

      public GUIObject setLayout(GUILayout layout)
      This uses a special layout; to preserve it, this throws UnsupportedOperationException.
      Overrides:
      setLayout in class GUIObject
      Parameters:
      layout - the layout to use.
      Returns:
      itself, to chain calls.
      Throws:
      UnsupportedOperationException - if called.
    • setResizable

      public void setResizable(boolean resizable)
      Sets if this is resizable by dragging the mouse at the edges.
      Parameters:
      resizable -
    • setDraggable

      public void setDraggable(boolean draggable)
      Sets if this is draggable by dragging the mouse at the top center panel.
      Parameters:
      draggable -
    • getTopLeftPanel

      public GUIPanel getTopLeftPanel()
      Returns:
      the reference to the top-left panel in the frame.
    • getTopCenterPanel

      public GUIPanel getTopCenterPanel()
      Returns:
      the reference to the top-center panel in the frame.
    • getTopRightPanel

      public GUIPanel getTopRightPanel()
      Returns:
      the reference to the top-right panel in the frame.
    • getBottomLeftPanel

      public GUIPanel getBottomLeftPanel()
      Returns:
      the reference to the bottom-left panel in the frame.
    • getBottomCenterPanel

      public GUIPanel getBottomCenterPanel()
      Returns:
      the reference to the bottom-center panel in the frame.
    • getBottomRightPanel

      public GUIPanel getBottomRightPanel()
      Returns:
      the reference to the bottom-right panel in the frame.
    • getMiddleLeftPanel

      public GUIPanel getMiddleLeftPanel()
      Returns:
      the reference to the middle-left panel in the frame.
    • getMiddleRightPanel

      public GUIPanel getMiddleRightPanel()
      Returns:
      the reference to the middle-right panel in the frame.
    • getContentPanel

      public GUIPanel getContentPanel()
      Returns:
      the reference to the content (middle) panel in the frame.