removeAll ();
// Bottom popup
if ( popupWay.equals ( PopupWay.downLeft ) )
{
setLayout ( new TableLayout (
new double[][]{ { TableLayout.FILL, TableLayout.PREFERRED }, { TableLayout.PREFERRED, TableLayout.PREFERRED } } ) );
add ( copiedButton, "1,0" );
add ( container, "0,1,1,1" );
}
else if ( popupWay.equals ( PopupWay.downCenter ) )
{
setLayout ( new TableLayout ( new double[][]{ { TableLayout.FILL, TableLayout.PREFERRED, TableLayout.FILL },
{ TableLayout.PREFERRED, TableLayout.PREFERRED } } ) );
add ( copiedButton, "1,0" );
add ( container, "0,1,2,1" );
}
else if ( popupWay.equals ( PopupWay.downRight ) )
{
setLayout ( new TableLayout (
new double[][]{ { TableLayout.PREFERRED, TableLayout.FILL }, { TableLayout.PREFERRED, TableLayout.PREFERRED } } ) );
add ( copiedButton, "0,0" );
add ( container, "0,1,1,1" );
}
// Top popup
if ( popupWay.equals ( PopupWay.upLeft ) )
{
setLayout ( new TableLayout (
new double[][]{ { TableLayout.FILL, TableLayout.PREFERRED }, { TableLayout.PREFERRED, TableLayout.PREFERRED } } ) );
add ( copiedButton, "1,1" );
add ( container, "0,0,1,0" );
}
else if ( popupWay.equals ( PopupWay.upCenter ) )
{
setLayout ( new TableLayout ( new double[][]{ { TableLayout.FILL, TableLayout.PREFERRED, TableLayout.FILL },
{ TableLayout.PREFERRED, TableLayout.PREFERRED } } ) );
add ( copiedButton, "1,1" );
add ( container, "0,0,2,0" );
}
else if ( popupWay.equals ( PopupWay.upRight ) )
{
setLayout ( new TableLayout (
new double[][]{ { TableLayout.PREFERRED, TableLayout.FILL }, { TableLayout.PREFERRED, TableLayout.PREFERRED } } ) );
add ( copiedButton, "0,1" );
add ( container, "0,0,1,0" );
}
// Left popup
if ( popupWay.equals ( PopupWay.leftUp ) )
{
setLayout ( new TableLayout (
new double[][]{ { TableLayout.PREFERRED, TableLayout.PREFERRED }, { TableLayout.FILL, TableLayout.PREFERRED } } ) );
add ( copiedButton, "1,1" );
add ( container, "0,0,0,1" );
}
else if ( popupWay.equals ( PopupWay.leftCenter ) )
{
setLayout ( new TableLayout ( new double[][]{ { TableLayout.PREFERRED, TableLayout.PREFERRED },
{ TableLayout.FILL, TableLayout.PREFERRED, TableLayout.FILL } } ) );
add ( copiedButton, "1,1" );
add ( container, "0,0,0,2" );
}
else if ( popupWay.equals ( PopupWay.leftDown ) )
{
setLayout ( new TableLayout (
new double[][]{ { TableLayout.PREFERRED, TableLayout.PREFERRED }, { TableLayout.PREFERRED, TableLayout.FILL } } ) );
add ( copiedButton, "1,0" );
add ( container, "0,0,0,1" );
}
// Right popup
if ( popupWay.equals ( PopupWay.rightUp ) )
{
setLayout ( new TableLayout (
new double[][]{ { TableLayout.PREFERRED, TableLayout.PREFERRED }, { TableLayout.FILL, TableLayout.PREFERRED } } ) );
add ( copiedButton, "0,1" );
add ( container, "1,0,1,1" );
}
else if ( popupWay.equals ( PopupWay.rightCenter ) )
{
setLayout ( new TableLayout ( new double[][]{ { TableLayout.PREFERRED, TableLayout.PREFERRED },
{ TableLayout.FILL, TableLayout.PREFERRED, TableLayout.FILL } } ) );
add ( copiedButton, "0,1" );
add ( container, "1,0,1,2" );
}
else if ( popupWay.equals ( PopupWay.rightDown ) )
{
setLayout ( new TableLayout (
new double[][]{ { TableLayout.PREFERRED, TableLayout.PREFERRED }, { TableLayout.PREFERRED, TableLayout.FILL } } ) );
add ( copiedButton, "0,0" );
add ( container, "1,0,1,1" );
}