Skip to content

Commit

Permalink
- Bugzilla Bug (s) Resolved:
Browse files Browse the repository at this point in the history
- Description: 
Modified clockwise UI of pie chart, and removed unused i18n items.
  • Loading branch information
heli committed Oct 10, 2011
1 parent 69e6e20 commit 74a1ac8
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,11 @@ private static ColorDefinition tunePaletteColor(
public static Fill getPaletteFill( EList<Fill> elPalette, int index )
{
final int iPaletteSize = elPalette.size( );
if ( iPaletteSize == 0 )
{
return null;
}

Fill fill = elPalette.get( index % iPaletteSize );
if ( index < iPaletteSize )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ChartSheetImpl.Button.ShowEmptyMsg=Show the chart with the following &message:
ChartSheetImpl.Group.EmptyMessage=Chart Visibility
ChartSheetImpl.Label.Outline=Outline:
ChartLegendImpl.Group.Rotation=Rotation
ChartPlotSheetImpl.Label.Outline=Outline
ChartPlotSheetImpl.Label.Outline=Outline:
ChartPlotSheetImpl.Label.Visible=&Visible
ChartPlotSheetImpl.Label.Visible2=V&isible
ChartPlotSheetImpl.Label.PlotArea=Plot Area
Expand Down Expand Up @@ -338,7 +338,7 @@ PieChart.SubType.Standard=Standard Pie Chart
PieSeriesUIProvider.Lbl.OrthogonalPrefix=Value
PieSeriesUIProvider.Lbl.SeriesDefinition=Series Definition
PieBottomAreaComponent.Label.Percentage=Percentage
PieSeriesAttributeComposite.Button.Direction=Direction:
PieSeriesAttributeComposite.Button.Direction=Clockwise Direction
PieSeriesAttributeComposite.Button.Direction.ToolTipText=Specifies whether pie slices are rendered in clockwise direction.
PieSeriesAttributeComposite.Grp.Slice=Slice
PieSeriesAttributeComposite.Lbl.SliceOutline=Slice &Outline:
Expand All @@ -353,8 +353,6 @@ PieBaseSeriesComponent.Text.SpecifyExplodeSlice=Specify Explode Slice
PieBaseSeriesComponent.Tooltip.EnterBooleanExpression=Enter a boolean expression to control which slice to explode. If left blank, the explosion distance will apply to all slices.
PieLeftAreaComponent.Label.SliceSizeDefinition=Slice Size Definition:
PieSeriesAttributeComposite.Exception.IllegalArgument=Series of type {0} is an invalid argument for PieSeriesAttributeComposite.
PieSeriesAttributeComposite.ItemLabel.AntiClockwise=Anti-Clockwise
PieSeriesAttributeComposite.ItemLabel.Clockwise=Clockwise
PieSeriesAttributeComposite.Lbl.Explosion=Explosion:
PiesBottomAreaComponent.Label.TheRotationOfTheChart=Pie Rotation: The start angle of first pie slice
PieBottomAreaComponent.Label.Rotation=Pie Rotatio&n:
Expand Down Expand Up @@ -1014,7 +1012,7 @@ BubbleSeriesAttributeComposite.Lbl.Type=Type:
BubbleSeriesAttributeComposite.Lbl.Size=Size:
BubbleSeriesAttributeComposite.Lbl.Line=Line
BubbleSeriesAttributeComposite.Lbl.AccLine=Acceleration Line
BubbleSeriesAttributeComposite.Lbl.LinePalette= Use Series &Palette as Line Color
BubbleSeriesAttributeComposite.Lbl.LinePalette=Use Series &Palette as Line Color
BubbleSeriesAttributeComposite.Exception.IllegalArgument=Series of type {0} is an invalid argument for BubbleSeriesAttributeComposite.
BubbleSeriesAttributeComposite.Lbl.ShowLinesAsCurves=Show Lines as Cur&ves
BubbleSeriesAttributeComposite.Lbl.Orientation=&Orientation
Expand Down Expand Up @@ -1081,11 +1079,4 @@ MenuStylesDialog.Label.Style=&Style:
MenuStylesDialog.title=Hyperlink Menu Properties
MenuStylesDialog.Title=Hyperlink Menu Styles
ItemLabel.Visible=Visible
ItemLabel.Auto=Auto
ItemLabel.True=True
ItemLabel.False=False
ItemLabel.Show=Show
ItemLabel.Hide=Hide
ItemLabel.Enable=Enable
ItemLabel.Disable=Disable
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ private void placeComponents( )
if ( bEnableVisibility )
{
btnVisible = new TristateCheckbox( cmpContent, SWT.NONE );
btnVisible.setText( Messages.getString( "ItemLabel.Visible" ) ); //$NON-NLS-1$
GridData gdCBVisible = new GridData( GridData.FILL_HORIZONTAL );
gdCBVisible.horizontalSpan = 6;
btnVisible.setLayoutData( gdCBVisible );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class LabelAttributesComposite extends Composite implements

private transient Group grpOutline = null;

private TristateCheckbox cmbVisible = null;
private TristateCheckbox btnVisible = null;

private transient Label lblLabel = null;

Expand Down Expand Up @@ -371,18 +371,18 @@ private void placeComponents( )
boolean bEnableUI = bEnabled && this.lblCurrent.isVisible( );
if ( attributesContext.isVisibilityEnabled )
{
cmbVisible = new TristateCheckbox( cmpGeneral, SWT.NONE );
cmbVisible.setText( Messages.getString( "ItemLabel.Visible" ) ); //$NON-NLS-1$
btnVisible = new TristateCheckbox( cmpGeneral, SWT.NONE );
btnVisible.setText( Messages.getString( "LabelAttributesComposite.Lbl.IsVisible" ) ); //$NON-NLS-1$
GridData gdCBVisible = new GridData( GridData.FILL_HORIZONTAL );
gdCBVisible.horizontalSpan = 2;
cmbVisible.setLayoutData( gdCBVisible );
cmbVisible.setSelectionState( lblCurrent.isSetVisible( ) ? ( lblCurrent.isVisible( ) ? TristateCheckbox.STATE_SELECTED
btnVisible.setLayoutData( gdCBVisible );
btnVisible.setSelectionState( lblCurrent.isSetVisible( ) ? ( lblCurrent.isVisible( ) ? TristateCheckbox.STATE_SELECTED
: TristateCheckbox.STATE_UNSELECTED )
: TristateCheckbox.STATE_GRAYED );
cmbVisible.addSelectionListener( this );
btnVisible.addSelectionListener( this );
if ( bEnabled )
{
bEnableUI = ( cmbVisible.getSelectionState( ) == TristateCheckbox.STATE_SELECTED );
bEnableUI = ( btnVisible.getSelectionState( ) == TristateCheckbox.STATE_SELECTED );
}
}

Expand Down Expand Up @@ -533,8 +533,8 @@ public void setEnabled( boolean bState )
boolean bEnableUI = true;
if ( attributesContext.isVisibilityEnabled )
{
bEnableUI = ( cmbVisible.getSelectionState( ) == TristateCheckbox.STATE_SELECTED );
cmbVisible.setEnabled( bState );
bEnableUI = ( btnVisible.getSelectionState( ) == TristateCheckbox.STATE_SELECTED );
btnVisible.setEnabled( bState );
}

setVisibleState( bState & bEnableUI );
Expand Down Expand Up @@ -590,10 +590,10 @@ public void setLabel( org.eclipse.birt.chart.model.component.Label lbl,
// update the UI
if ( attributesContext.isVisibilityEnabled )
{
cmbVisible.setSelectionState( lblCurrent.isSetVisible( ) ? ( lblCurrent.isVisible( ) ? TristateCheckbox.STATE_SELECTED
btnVisible.setSelectionState( lblCurrent.isSetVisible( ) ? ( lblCurrent.isVisible( ) ? TristateCheckbox.STATE_SELECTED
: TristateCheckbox.STATE_UNSELECTED )
: TristateCheckbox.STATE_GRAYED );
setVisibleState( ( cmbVisible.getSelectionState( ) == TristateCheckbox.STATE_SELECTED) && cmbVisible.isEnabled( ) );
setVisibleState( ( btnVisible.getSelectionState( ) == TristateCheckbox.STATE_SELECTED) && btnVisible.isEnabled( ) );
}

if ( attributesContext.isLabelEnabled )
Expand Down Expand Up @@ -697,12 +697,12 @@ public void widgetSelected( SelectionEvent e )
eLabel.detail = ChartUIExtensionUtil.PROPERTY_UPDATE;
}
}
else if ( e.widget == cmbVisible )
else if ( e.widget == btnVisible )
{
eLabel.data = Boolean.valueOf( cmbVisible.getSelectionState( ) == TristateCheckbox.STATE_SELECTED );
eLabel.data = Boolean.valueOf( btnVisible.getSelectionState( ) == TristateCheckbox.STATE_SELECTED );
eLabel.type = VISIBILITY_CHANGED_EVENT;

setVisibleState( cmbVisible.getSelectionState( ) == TristateCheckbox.STATE_SELECTED );
setVisibleState( btnVisible.getSelectionState( ) == TristateCheckbox.STATE_SELECTED );
}
fireEvent( eLabel );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ private void placeComponents( )
GridData gdCBVisible = new GridData( GridData.FILL_HORIZONTAL );
gdCBVisible.horizontalSpan = 6;
btnVisible.setLayoutData( gdCBVisible );
btnVisible.setText( Messages.getString( "ItemLabel.Visible" ) ); //$NON-NLS-1$
btnVisible.setText( Messages.getString( "LabelAttributesComposite.Lbl.IsVisible" ) ); //$NON-NLS-1$

int state = laCurrent.isSetVisible( ) ? ( laCurrent.isVisible( ) ? TristateCheckbox.STATE_SELECTED
: TristateCheckbox.STATE_UNSELECTED )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ private void placeComponents( )

btnMarkerVisible = new TristateCheckbox( this, SWT.NONE );
{
btnMarkerVisible.setText( Messages.getString( "ItemLabel.Visible" ) ); //$NON-NLS-1$
btnMarkerVisible.setText( Messages.getString( "LineSeriesAttributeComposite.Lbl.IsVisible" ) ); //$NON-NLS-1$
GridData gd = new GridData( GridData.FILL_HORIZONTAL );
gd.horizontalSpan = 2;
btnMarkerVisible.setLayoutData( gd );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.eclipse.birt.chart.ui.swt.composites.FillChooserComposite;
import org.eclipse.birt.chart.ui.swt.composites.LineAttributesComposite;
import org.eclipse.birt.chart.ui.swt.composites.TextEditorComposite;
import org.eclipse.birt.chart.ui.swt.composites.TristateCheckbox;
import org.eclipse.birt.chart.ui.swt.interfaces.IUIServiceProvider;
import org.eclipse.birt.chart.ui.swt.wizard.ChartWizardContext;
import org.eclipse.birt.chart.ui.util.ChartHelpContextIds;
Expand Down Expand Up @@ -92,7 +93,7 @@ public class PieSeriesAttributeComposite extends Composite implements

private Button btnRotationAuto;

private Combo cmbDirection;
private TristateCheckbox btnDirection;

private Button btnExplosionAuto;

Expand Down Expand Up @@ -305,20 +306,17 @@ private void createSeriesDetail( Composite cmpRight )
sRotation.setEnabled( !btnRotationAuto.getSelection( ) );
btnRotationAuto.addSelectionListener( this );

Label lbl = new Label(cmpRight, SWT.NONE);
lbl.setText( Messages.getString("PieSeriesAttributeComposite.Button.Direction") ); //$NON-NLS-1$

cmbDirection = ChartUIExtensionUtil.createCombo( cmpRight, new String[]{
ChartUIExtensionUtil.getAutoMessage( ),
Messages.getString("PieSeriesAttributeComposite.ItemLabel.Clockwise"), //$NON-NLS-1$
Messages.getString("PieSeriesAttributeComposite.ItemLabel.AntiClockwise") //$NON-NLS-1$
});
btnDirection = new TristateCheckbox( cmpRight, SWT.NONE );
{
cmbDirection.setToolTipText( Messages.getString("PieSeriesAttributeComposite.Button.Direction.ToolTipText") ); //$NON-NLS-1$
cmbDirection.select( series.isSetClockwise( ) ? ( series.isClockwise( ) ? 1
: 2 )
: 0 );
cmbDirection.addListener( SWT.Selection, this );
GridData gd = new GridData();
gd.horizontalSpan = 3;
btnDirection.setLayoutData( gd );
btnDirection.setText( Messages.getString( "PieSeriesAttributeComposite.Button.Direction" ) ); //$NON-NLS-1$
btnDirection.setToolTipText( Messages.getString( "PieSeriesAttributeComposite.Button.Direction.ToolTipText" ) ); //$NON-NLS-1$
btnDirection.setSelectionState( series.isSetClockwise( ) ? ( series.isClockwise( ) ? TristateCheckbox.STATE_SELECTED
: TristateCheckbox.STATE_UNSELECTED )
: TristateCheckbox.STATE_GRAYED );
btnDirection.addListener( SWT.Selection, this );
}

Group grpSlice = new Group( cmpRight, SWT.NONE );
Expand Down Expand Up @@ -464,12 +462,12 @@ else if ( event.widget.equals( txtExplode ) )
{
series.setExplosionExpression( txtExplode.getText( ) );
}
else if ( event.widget == cmbDirection )
else if ( event.widget == btnDirection )
{
ChartElementUtil.setEObjectAttribute( series,
"clockwise", //$NON-NLS-1$
cmbDirection.getSelectionIndex( ) == 1,
cmbDirection.getSelectionIndex( ) == 0 );
btnDirection.getSelectionState( ) == TristateCheckbox.STATE_SELECTED,
btnDirection.getSelectionState( ) == TristateCheckbox.STATE_GRAYED );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ protected Composite getComponent( Composite parent )
GridData gdCBVisible = new GridData( GridData.FILL_HORIZONTAL );
gdCBVisible.horizontalSpan = 2 ;
btnLabelVisible.setLayoutData( gdCBVisible );
btnLabelVisible.setText( Messages.getString( "ItemLabel.Visible" ) ); //$NON-NLS-1$
btnLabelVisible.setText( Messages.getString( "LabelAttributesComposite.Lbl.IsVisible" ) ); //$NON-NLS-1$
btnLabelVisible.setSelectionState( getTrendline( ).getLabel( )
.isSetVisible( ) ? ( getTrendline( ).getLabel( ).isVisible( ) ? TristateCheckbox.STATE_SELECTED
: TristateCheckbox.STATE_UNSELECTED )
Expand Down

0 comments on commit 74a1ac8

Please sign in to comment.