/*
 *
 * Copyright (C)   20 dec. 2003 Jean-Yves Beaujean 
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc.,  59
 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.

 */
package jxtray.diag;

import java.awt.Rectangle;

import java.awt.Font;
import java.awt.GradientPaint;
import java.awt.Graphics2D;

public class DiElement extends Rectangle
{
	protected double zoom = DiConstants.ZOOM_NORMAL;
	protected Font font;
	
	protected GradientPaint painter = null;
	protected Graphics2D g2 = null;	

	
	public DiElement()
	{
		super();
	}
	
	
	/**
	 * @return double
	 */
	public double getZoom() 
	{
		return zoom;
	}
		
	/**
	 * @param d
	 */
	public void setZoom(double d) 
	{
			
		double rapport  = zoom/d;
		int fontSize = 10;
		
		if ( d == DiConstants.ZOOM_SUPERSMALL )
				fontSize = 8;
		else if ( d == DiConstants.ZOOM_SMALL )
			fontSize = 8;
		else if ( d == DiConstants.ZOOM_NORMAL)
			fontSize = 10;
		else if (d == DiConstants.ZOOM_BIG )
			fontSize = 10;

		font = new Font("dialog",0,fontSize);
		zoom = d;
			
		x = (int)( x / rapport);
			
	}

	public void move(int x, int y)
	{
		this.x = x; this.y = y;
	}

	
}
