package starpunk.screens;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import starpunk.StarPunkGame;

public abstract class Base2DScreen
  extends BaseScreen
{
  private final Stage _stage;

  protected Base2DScreen( final StarPunkGame game )
  {
    super( game );
    _stage = new Stage( Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true );
  }

  @Override
  public void show()
  {
    super.show();
    Gdx.input.setInputProcessor( _stage );
  }

  @Override
  public void update( final float delta )
  {
    _stage.act( delta );
  }

  @Override
  public void draw( final float delta )
  {
    Gdx.gl.glClearColor( 0f, 0f, 0f, 1f );
    Gdx.gl.glClear( GL20.GL_COLOR_BUFFER_BIT );

    _stage.draw();

    Table.drawDebug( _stage );
  }
}

@@ -49,16 +49,58 @@
 dx.Gdx;%0A
+import com.badlogic.gdx.files.FileHandle;%0A
 import c
@@ -176,16 +176,64 @@
 .Stage;%0A
+import com.badlogic.gdx.scenes.scene2d.ui.Skin;%0A
 import c
@@ -372,22 +372,16 @@
 private 
-final 
 Stage _s
@@ -385,16 +385,62 @@
  _stage;
+%0A  private Table _table;%0A  private Skin _skin;
 %0A%0A  prot
@@ -514,482 +514,1267 @@
 ;%0A  
-  _stage = new Stage( Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true );%0A  %7D%0A%0A  @Override%0A  public void show()%0A  %7B%0A    super.show();%0A    Gdx.input.setInputProcessor( _stage );%0A  %7D%0A%0A  @Override%0A  public void update( final float delta )%0A  %7B%0A    _stage.act( delta );%0A  %7D%0A%0A  @Override%0A  public void draw( final float delta )%0A  %7B%0A    Gdx.gl.glClearColor( 0f, 0f, 0f, 1f );%0A    Gdx.gl.glClear( GL20.GL_COLOR_BUFFER_BIT );%0A%0A    _stage.draw();%0A%0A    Table.drawDebug( _stage )
+%7D%0A%0A  @Override%0A  public void dispose()%0A  %7B%0A    super.dispose();%0A%0A    if( null != _skin )%0A    %7B%0A      _skin.dispose();%0A      _skin = null;%0A    %7D%0A%0A    if( null != _stage )%0A    %7B%0A      _stage.dispose();%0A      _stage = null;%0A    %7D%0A  %7D%0A%0A  @Override%0A  public void show()%0A  %7B%0A    super.show();%0A    _stage = new Stage( Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true );%0A    Gdx.input.setInputProcessor( _stage );%0A  %7D%0A%0A  @Override%0A  public void update( final float delta )%0A  %7B%0A    _stage.act( delta );%0A  %7D%0A%0A  @Override%0A  public void draw( final float delta )%0A  %7B%0A    Gdx.gl.glClearColor( 0f, 0f, 0f, 1f );%0A    Gdx.gl.glClear( GL20.GL_COLOR_BUFFER_BIT );%0A%0A    _stage.draw();%0A%0A    if( getGame().isDebugMode() )%0A    %7B%0A      Table.drawDebug( _stage );%0A    %7D%0A  %7D%0A%0A  protected final Skin getSkin()%0A  %7B%0A    if( null == _skin )%0A    %7B%0A      final FileHandle skinFile = Gdx.files.internal( %22src/main/assets/skin/uiskin.json%22 );%0A      _skin = new Skin( skinFile );%0A    %7D%0A    return _skin;%0A  %7D%0A%0A  protected final Table getTable()%0A  %7B%0A    if( null == _table )%0A    %7B%0A      _table = new Table( getSkin() );%0A      _table.setFillParent( true );%0A      if( getGame().isDebugMode() )%0A      %7B%0A        _table.debug();%0A      %7D%0A      _stage.addActor( _table );%0A    %7D%0A    return _table
 ;%0A  

Improve the base screen so it incorporates the basic functionality for setting up and tearing down a stage and associated table