Class KFrame

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
BattleBoard, ConnectionLogWindow, DummyFrameWithMenu, GetPlayers, NetworkClientDialog, PreferencesWindow, ShowHelpDoc, ShowReadme, WebClient, WelcomeDialog

public class KFrame extends JFrame
KFrame adds some generally useful functions to JFrame. TODO SaveWindow handling should be on this level
Author:
Clemens Katzer
See Also:
  • Field Details

  • Constructor Details

    • KFrame

      public KFrame()
      Only support the simple constructor forms of JFrame.
    • KFrame

      public KFrame(String title)
  • Method Details

    • useSaveWindow

      public void useSaveWindow(IOptions options, String windowName, Point defaultLocation)
      If, and only if, the extending class calls this useSaveWindow, then the KFrame will handle the SaveWindow work: creating it when useSaveWindow is called, and saving back always when setVisible(false) is called (and useSaveWindow was called before, of course). TODO maybe we should enforce this by calling it through the constructor
      Parameters:
      options - IOptions reference to the client for saving window size+pos in the Options data
      windowName - name/title of the window, window size+pos are stored for that name
      defaultLocation - to be used if no location was earlier stored: place there; give null to center on screen.
    • setVisible

      public void setVisible(boolean val)
      Overrides:
      setVisible in class Window
    • dispose

      public void dispose()
      Overrides:
      dispose in class Window
    • centerOnScreen

      public void centerOnScreen()
      Center this dialog on the screen. Must be called after the dialog size has been set.