Class GUIDialogBackground

All Implemented Interfaces:
GUIElement, ImageObserver, MenuContainer, Serializable

public class GUIDialogBackground extends AbstractGUIElement
A background image for dialog windows.
See Also:
  • Constructor Details

    • GUIDialogBackground

      public GUIDialogBackground(@NotNull @NotNull TooltipManager tooltipManager, @NotNull @NotNull JXCWindowRenderer windowRenderer, @NotNull @NotNull GUIElementListener elementListener, @NotNull @NotNull String name, float alpha, @NotNull @NotNull Image frameNW, @NotNull @NotNull Image frameN, @NotNull @NotNull Image frameNE, @NotNull @NotNull Image frameW, @NotNull @NotNull Image frameC, @NotNull @NotNull Image frameE, @NotNull @NotNull Image frameSW, @NotNull @NotNull Image frameS, @NotNull @NotNull Image frameSE, @NotNull @NotNull GuiFactory guiFactory)
      Creates a new instance.
      Parameters:
      tooltipManager - the tooltip manager to update
      windowRenderer - the window renderer this element belongs to
      elementListener - the element listener to notify
      name - the name of this element
      alpha - the alpha value for the background, 1 is opaque, 0 full transparent
      frameNW - the north-west frame picture
      frameN - the north frame picture
      frameNE - the north-east frame picture
      frameW - the west frame picture
      frameC - the center frame picture
      frameE - the east frame picture
      frameSW - the south-west frame picture
      frameS - the south frame picture
      frameSE - the south-east frame picture
      guiFactory - the global GUI factory instance
  • Method Details

    • setOpaqueDialogBackground

      public void setOpaqueDialogBackground(boolean opaque)
      Sets whether the dialog's background is opaque.
      Parameters:
      opaque - whether the background is opaque
    • paintComponent

      public void paintComponent(@NotNull @NotNull Graphics g)
      Overrides:
      paintComponent in class JComponent
    • getPreferredSize

      @Nullable public @Nullable Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • getMinimumSize

      @Nullable public @Nullable Dimension getMinimumSize()
      Overrides:
      getMinimumSize in class JComponent
    • notifyOpen

      public void notifyOpen()
      Description copied from interface: GUIElement
      Called each time the enclosing dialog is opened (or raised).
    • getTooltip

      @Nullable public @Nullable TooltipText getTooltip()
      Description copied from class: AbstractGUIElement
      Returns the current tooltip text.
      Specified by:
      getTooltip in class AbstractGUIElement
      Returns:
      the tooltip text or null to not show a tooltip
    • getDialogBorderTop

      public int getDialogBorderTop()
      Description copied from class: AbstractGUIElement
      Returns the size of the dialog's top border.
      Overrides:
      getDialogBorderTop in class AbstractGUIElement
      Returns:
      the size in pixels or 0 if this GUI element is not a dialog
    • getDialogBorderLeft

      public int getDialogBorderLeft()
      Description copied from class: AbstractGUIElement
      Returns the size of the dialog's left border.
      Overrides:
      getDialogBorderLeft in class AbstractGUIElement
      Returns:
      the size in pixels or 0 if this GUI element is not a dialog
    • getDialogBorderRight

      public int getDialogBorderRight()
      Description copied from class: AbstractGUIElement
      Returns the size of the dialog's right border.
      Overrides:
      getDialogBorderRight in class AbstractGUIElement
      Returns:
      the size in pixels or 0 if this GUI element is not a dialog
    • getDialogBorderBottom

      public int getDialogBorderBottom()
      Description copied from class: AbstractGUIElement
      Returns the size of the dialog's bottom border.
      Overrides:
      getDialogBorderBottom in class AbstractGUIElement
      Returns:
      the size in pixels or 0 if this GUI element is not a dialog
    • mousePressed

      public void mousePressed(@NotNull @NotNull MouseEvent e)
      Description copied from interface: GUIElement
      Will be called when the user has pressed the mouse inside this element.
      Specified by:
      mousePressed in interface GUIElement
      Overrides:
      mousePressed in class AbstractGUIElement
      Parameters:
      e - the mouse event relative to this element
    • mouseReleased

      public void mouseReleased(@NotNull @NotNull MouseEvent e)
      Description copied from interface: GUIElement
      Will be called when the user has released the mouse. This event may be delivered even if no previous GUIElement.mousePressed(MouseEvent) has been delivered before.
      Specified by:
      mouseReleased in interface GUIElement
      Overrides:
      mouseReleased in class AbstractGUIElement
      Parameters:
      e - the mouse event relative to this element
    • mouseDragged

      public void mouseDragged(@NotNull @NotNull MouseEvent e)
      Description copied from interface: GUIElement
      Will be called when the mouse moves within this component while the button is pressed. This event will be delivered after GUIElement.mouseMoved(MouseEvent).

      Note: if the mouse leaves this element's bounding box while the mouse button is still pressed, further mouseDragged (but no mouseMoved) events will be generated.

      Specified by:
      mouseDragged in interface GUIElement
      Overrides:
      mouseDragged in class AbstractGUIElement
      Parameters:
      e - the mouse event relative to this element