Skip to content

Commit

Permalink
Summary: Refacorting code.(T64090)
Browse files Browse the repository at this point in the history
Bugzilla Bug(s) Resolved:

Description:
 Refacorting code.(T64090)
  • Loading branch information
heli committed Aug 21, 2013
1 parent 55dc2b3 commit 51f0321
Showing 1 changed file with 38 additions and 23 deletions.
Expand Up @@ -102,11 +102,23 @@ public class ChartSheetImpl extends SubtaskSheetImpl implements
public void createControl( Composite parent )
{
ChartUIUtil.bindHelp( parent, ChartHelpContextIds.SUBTASK_CHART );

Chart defChart = ChartDefaultValueUtil.getDefaultValueChart( getChart() );

init( );
Composite cmpBasic = createContentComposite( parent );
createAdditionalComposite( cmpBasic );
createChartBackgroundComposite( cmpBasic );
createChartWallNFloorComposite( cmpBasic );
createStyleNPreviewComposite( cmpBasic );
createAngleChooserComposite( cmpContent );
createCoverageComposite( cmpBasic );
createInteractivityComposite( defChart, cmpBasic );
createStudyLayoutComposite( defChart, cmpBasic );
populateLists( );
createButtonGroup( cmpContent );
}

protected Composite createContentComposite( Composite parent )
{
cmpContent = new Composite( parent, SWT.NONE );
{
GridLayout glContent = new GridLayout( 3, true );
Expand All @@ -122,9 +134,11 @@ public void createControl( Composite parent )
gd.horizontalSpan = 2;
cmpBasic.setLayoutData( gd );
}
return cmpBasic;
}

initOptionUI( cmpBasic );

protected void createChartBackgroundComposite( Composite cmpBasic )
{
Label lblBackground = new Label( cmpBasic, SWT.NONE );
lblBackground.setText( Messages.getString( "ChartSheetImpl.Label.Background" ) ); //$NON-NLS-1$

Expand All @@ -140,7 +154,10 @@ public void createControl( Composite parent )
}

new Label( cmpBasic, SWT.NONE );
}

protected void createChartWallNFloorComposite( Composite cmpBasic )
{
if ( hasWallAndFloor( ) )
{
Label lblWall = new Label( cmpBasic, SWT.NONE );
Expand Down Expand Up @@ -179,18 +196,10 @@ public void createControl( Composite parent )

new Label( cmpBasic, SWT.NONE );
}
}

createStyleNPreviewUI( cmpBasic );

Composite cmp3D = new Composite( cmpContent, SWT.NONE );
{
cmp3D.setLayout( new GridLayout( ) );
cmp3D.setLayoutData( new GridData( GridData.FILL_BOTH ) );
}

createAngleChooserComposite( cmp3D );
createCoverageComposite( cmpBasic );

protected void createInteractivityComposite( Chart defChart, Composite cmpBasic )
{
btnEnable = getContext( ).getUIFactory( )
.createChartCheckbox( cmpBasic,
SWT.NONE,
Expand All @@ -206,7 +215,10 @@ public void createControl( Composite parent )
: ChartCheckbox.STATE_UNSELECTED ) );
btnEnable.addSelectionListener( this );
}
}

protected void createStudyLayoutComposite( Chart defChart, Composite cmpBasic )
{
// #170985
if ( enableStudyLayout( ) )
{
Expand All @@ -223,9 +235,6 @@ public void createControl( Composite parent )
: ChartCheckbox.STATE_GRAYED );
btnStudyLayout.addSelectionListener( this );
}

populateLists( );
createButtonGroup( cmpContent );
}

protected void createCoverageComposite( Composite cmpBasic )
Expand Down Expand Up @@ -269,8 +278,14 @@ protected void createCoverageComposite( Composite cmpBasic )
spnCorverage.getWidget( ).setValues( spnValue, 1, 100, 0, 1, 10 );
}

protected void createAngleChooserComposite( Composite cmp3D )
protected void createAngleChooserComposite( Composite cmpContent )
{
Composite cmp3D = new Composite( cmpContent, SWT.NONE );
{
cmp3D.setLayout( new GridLayout( ) );
cmp3D.setLayoutData( new GridData( GridData.FILL_BOTH ) );
}

if ( !( ( getChart( ) instanceof ChartWithAxes ) && is3DEnabled( ) ) )
{
return;
Expand Down Expand Up @@ -312,7 +327,7 @@ protected boolean enableStudyLayout( )
return ChartUtil.hasMultipleYAxes( getChart( ) );
}

protected void createStyleNPreviewUI( Composite cmpBasic )
protected void createStyleNPreviewComposite( Composite cmpBasic )
{
new Label( cmpBasic, SWT.NONE ).setText( Messages.getString( "ChartSheetImpl.Label.Style" ) ); //$NON-NLS-1$

Expand All @@ -336,12 +351,12 @@ protected boolean is3DEnabled( )
return ChartUIUtil.is3DType( getChart( ) );
}

protected void initOptionUI( Composite cmpBasic )
protected void createAdditionalComposite( Composite cmpBasic )
{

}

private void init( )
protected void init( )
{
// Make it compatible with old model
if ( getChart( ).getInteractivity( ) == null )
Expand All @@ -352,7 +367,7 @@ private void init( )
}
}

private void populateLists( )
protected void populateLists( )
{
if ( cmbStyle == null )
{
Expand Down

0 comments on commit 51f0321

Please sign in to comment.