/*
 *
 * 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 javax.swing.JPopupMenu;
import javax.swing.JMenuItem;
import javax.swing.JMenu;


public class DiPopupMenu extends JPopupMenu 
{
		
		private DiPanel parent;
		private JMenu mZoom;
		private JMenuItem miZoomBig;
		private JMenuItem miZoomNormal;
		private JMenuItem miZoomSmall;
		private JMenuItem miZoomSuperSmall;	
		
		private JMenuItem miDelete;
		private JMenuItem miPrint;
		
		public DiPopupMenu(DiPanel parent)
		{
				this.parent = parent;
				init();
		}
		
		public void init()
		{
				
				mZoom = new JMenu("Zoom");
				mZoom.setFont(parent.getFont());
				
				miZoomBig= new JMenuItem("Grand");
				miZoomBig.addActionListener(parent);
				miZoomBig.setActionCommand("zoombig");
				miZoomBig.setFont(parent.getFont());
				
				miZoomNormal= new JMenuItem("Normal");
				miZoomNormal.addActionListener(parent);
				miZoomNormal.setActionCommand("zoomnormal");
				miZoomNormal.setFont(parent.getFont());
				
				miZoomSmall= new JMenuItem("Petit");
				miZoomSmall.addActionListener(parent);
				miZoomSmall.setActionCommand("zoomsmall");
				miZoomSmall.setFont(parent.getFont());
				
				miZoomSuperSmall= new JMenuItem("Très petit");
				miZoomSuperSmall.addActionListener(parent);
				miZoomSuperSmall.setActionCommand("zoomsupersmall");
				miZoomSuperSmall.setFont(parent.getFont());				
				
				miDelete= new JMenuItem("Supprimer");	
				miDelete.addActionListener(parent);	
				miDelete.setActionCommand("delete");
				miDelete.setFont(parent.getFont());							

				miPrint= new JMenuItem("Imprimer");	
				miPrint.addActionListener(parent);	
				miPrint.setActionCommand("print");
				miPrint.setFont(parent.getFont());						
				
				mZoom.add(miZoomSuperSmall);
				mZoom.add(miZoomSmall);
				mZoom.add(miZoomNormal);
				mZoom.add(miZoomBig);
				
				this.add(mZoom);
				this.addSeparator();
				this.add(miPrint);

		}
		
		public void enabledDelete(boolean state)
		{
			miDelete.setEnabled(state);
		}

}
