package nxm.sys.libg;

import java.awt.Graphics;

import nxm.sys.inc.ProvisionalUseOnly;
import nxm.sys.prim.panel;

/**
 * This is a wrapper class that solves issues with graphical timing issues.
 * @author J. Czechowski IV
 * @since NeXtMidas 3.9.0
 *
 */
public class GPanelSetup extends MWindow {

  /**
   * The panel that is managed by GPanelSetup
   */
  public final panel panelPrim;

  /**
   * The constructor provided for GPanelSetup
   * Internally this is only called by prim.panel.java
   * @param titlebar The name of the MWindow
   * @param panelPrim The panel that will be managed
   */
  public GPanelSetup (String titlebar, panel panelPrim) {
    super(titlebar, panelPrim);
    this.panelPrim = panelPrim;
  }

  @ProvisionalUseOnly("Treat this as protected and should only be called by subclass paintComponent methods")
  @Override
  public void paintComponent (Graphics g) {
    super.paintComponent(g);
    panelPrim.paintComponent(this, g);
  }
}
