Code Search for Developers
 
 
  

AxisSubUnit.java from BIRT at Krugle


Show AxisSubUnit.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.computation.withaxes;

/**
 * AxisSubUnit
 */
public final class AxisSubUnit
{

	private double dValueMax = 0;

	private double dValueMin = 0;

	private double dPositiveTotal = 0;

	private double dNegativeTotal = 0;

	private double dLastValue = 0;

	AxisSubUnit( )
	{
	}

	public final void reset( )
	{
		dValueMax = 0;
		dValueMin = 0;
		dLastValue = 0;
	}

	public final double getLastValue( )
	{
		return dLastValue;
	}

	public final void setLastValue( double dLastValue )
	{
		this.dLastValue = dLastValue;
	}

	/**
	 * @return Returns the valueMax.
	 */
	public final double getValueMax( )
	{
		return dValueMax;
	}

	/**
	 * @param dValueMax
	 *            The valueMax to set.
	 */
	public final void setValueMax( double dValueMax )
	{
		this.dValueMax = dValueMax;
	}

	/**
	 * @return Returns the valueMin.
	 */
	public final double getValueMin( )
	{
		return dValueMin;
	}

	/**
	 * @param dValueMin
	 *            The valueMin to set.
	 */
	public final void setValueMin( double dValueMin )
	{
		this.dValueMin = dValueMin;
	}

	/**
	 * 
	 * @param dPositiveTotal
	 */
	public final void setPositiveTotal( double dPositiveTotal )
	{
		this.dPositiveTotal = dPositiveTotal;
	}

	/**
	 * 
	 * @return
	 */
	public final double getPositiveTotal( )
	{
		return dPositiveTotal;
	}

	/**
	 * 
	 * @param dPositiveTotal
	 */
	public final void setNegativeTotal( double dNegativeTotal )
	{
		this.dNegativeTotal = dNegativeTotal;
	}

	/**
	 * 
	 * @return
	 */
	public final double getNegativeTotal( )
	{
		return dNegativeTotal;
	}

	/**
	 * 
	 * @param dValue
	 * @return
	 */
	public final double valuePercentage( double dValue )
	{
		if ( dPositiveTotal - dNegativeTotal == 0 )
		{
			return 0;
		}
		return ( dValue * 100d ) / ( dPositiveTotal - dNegativeTotal );
	}
}




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

  AllAxes.java
  AutoScale.java
  AxisSubUnit.java
  Grid.java
  IntersectionValue.java
  OneAxis.java
  PlotWith2DAxes.java
  PlotWith3DAxes.java
  PlotWithAxes.java
  SeriesRenderingHints.java
  SeriesRenderingHints3D.java
  StackGroup.java
  StackedSeriesLookup.java
  package.html