package nxm.sys.inc;

import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ComponentListener;
import java.awt.event.WindowListener;

import nxm.sys.libg.MBox;
import nxm.sys.libg.MWindow;

/** ******************** STANDARD VERSION ****************
    Defines a class that will act as a top-level window for NeXtMidas. While any
    class that implements this interface may act as a top-level window it does
    not need to be an actual top-level window (as is the case with the
    nxm.sys.libg.MJPanel class). <br>
    <br>
    This is an interface to permit nxm.sys.libg.MWindow to work with frames that may
    be implemented using either AWT or swing components.

    @see nxm.sys.libg.MWindow
    @author  J. Czechowski IV
    @since   NeXtMidas 1.9.2
 */
@LimitedFutureSupport("Being replaced by nxm.sys.libg.MidasFrame. See JDK_Modularity_User_Action_Required.xlxs for more details - since 3.9.2")
public interface MidasFrame extends WindowListener, ComponentListener {
  /** Moves and resizes this component. The new location of the top-left
      corner is specified by <code>pos.x</code> and <code>pos.y</code>, and the
      new size is specified by <code>pos.w</code> and <code>pos.h</code>.

      @param pos contains the coordinates and size of the MJFrame
   */
  void setBounds(MBox pos);

  /** Resize the top-level panel in this MidasFrame according to the current
      values for insets, width, and height.
   */
  void resizePanel();

  /** Returns the dimensions of this MidasFrame, minus any insets.

      @return the width and height of this MidasFrame
   */
  Dimension getSize();

  /** Set the frame to FRONT, BACK or ICONIFIED.  Front also deiconifies

      @param mode The display mode ({@link MWindow#FRONT}, {@link MWindow#BACK},
                  or {@link MWindow#ICON}).
   */
  void display(int mode);

  /** Gets the MWindow associated with this MidasFrame.
      @return the MWindow
      @since NeXtMidas 2.5.4
   */
  MWindow getMWindow();

  /** Sets the MWindow associated with this MidasFrame.
      @param mw the MWindow
   */
  void setMWindow(MWindow mw);

  /** Adds a component to this one.
      @param comp The component to add.
      @return the combined components
   */
  Component add(Component comp);

}
