Code Search for Developers
 
 
  

HeadStyleChooserComposite.java from BIRT at Krugle


Show HeadStyleChooserComposite.java syntax highlighted

/***********************************************************************
 * Copyright (c) 2004 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Actuate Corporation - initial API and implementation
 ***********************************************************************/

package org.eclipse.birt.chart.ui.swt.composites;

import org.eclipse.birt.chart.model.attribute.LineDecorator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;

/**
 * Choose the Line decorator of needle
 */
public class HeadStyleChooserComposite extends CustomChooserComposite
{

	private static final Integer[] iLineDecorators = new Integer[]{
			new Integer( LineDecorator.ARROW ),
			new Integer( LineDecorator.NONE ),
			new Integer( LineDecorator.CIRCLE )
	};

	static class HeaderStyleChoice extends HeadStyleCanvas
			implements
				ICustomChoice
	{

		HeaderStyleChoice( Composite parent, int iStyle, int iLineDecorator )
		{
			super( parent, iStyle, iLineDecorator );
		}

		public Object getValue( )
		{
			return new Integer( getHeadStyle( ) );
		}

		public void setValue( Object value )
		{
			setHeadStyle( ( (Integer) value ).intValue( ) );
		}

	}

	public HeadStyleChooserComposite( Composite parent, int style,
			int iLineDecorator )
	{
		super( parent, style, new Integer( iLineDecorator ) );
		setItems( iLineDecorators );
	}

	protected ICustomChoice createChoice( Composite parent, Object choiceValue )
	{
		if ( choiceValue == null )
		{
			choiceValue = new Integer( 0 );
		}
		return new HeaderStyleChoice( parent,
				SWT.NONE,
				( (Integer) choiceValue ).intValue( ) );
	}

	/**
	 * Returns the current selected head style as an integer.
	 * 
	 */
	public int getHeadStyle( )
	{
		return ( (Integer) getChoiceValue( ) ).intValue( );
	}

	public void setHeadStyle( int iStyle )
	{
		setChoiceValue( new Integer( iStyle ) );
	}
}




See more files for this project here

BIRT

BIRT is an open source, Eclipse-based reporting system that integrates with your application to produce compelling reports for both web and PDF.

Project homepage: http://www.eclipse.org/birt/phoenix/
Programming language(s): Java,XML
License: gpl2

  AngleSelectorComposite.java
  CTextCombo.java
  CustomChooserComposite.java
  ExtendedPropertyEditorComposite.java
  ExternalizedTextEditorComposite.java
  ExternalizedTextEditorDialog.java
  FillCanvas.java
  FillChooserComposite.java
  FontCanvas.java
  FontDefinitionComposite.java
  FontDefinitionDialog.java
  FormatSpecifierComposite.java
  FormatSpecifierDialog.java
  FormatSpecifierPreview.java
  GanttLineAttributesComposite.java
  GradientEditorDialog.java
  GridAttributesComposite.java
  GroupSortingDialog.java
  HeadStyleAttributeComposite.java
  HeadStyleCanvas.java
  HeadStyleChooserComposite.java
  IAngleChangeListener.java
  ICustomChoice.java
  IconCanvas.java
  ImageDialog.java
  InsetsComposite.java
  IntegerSpinControl.java
  LabelAttributesComposite.java
  LineAttributesComposite.java
  LineCanvas.java
  LineStyleChooserComposite.java
  LineWidthChooserComposite.java
  LocalizedNumberEditorComposite.java
  MarkerEditorComposite.java
  MarkerIconDialog.java
  PaletteEditorComposite.java
  PositiveNegativeColorDialog.java
  SeriesGroupingComposite.java
  TextComboChoiceCanvas.java
  TextEditorComposite.java
  TriggerDataComposite.java
  TriggerEditorComposite.java
  TriggerEditorDialog.java