package net.java.sip.communicator.impl.gui.main;

import java.awt.Dimension;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JToolBar;

import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommButton;
/**
 * @author Yana Stamcheva
 *
 * The quick menu. 
 */
public class QuickMenu extends JToolBar{
	
	private Image addButtonIcon 		= LookAndFeelConstants.QUICK_MENU_ADD_ICON;
	private Image configureButtonIcon 	= LookAndFeelConstants.QUICK_MENU_CONFIGURE_ICON;
	
	SIPCommButton infoButton;
	SIPCommButton toolsButton;
	SIPCommButton addButton;
	SIPCommButton searchButton;
	
	public QuickMenu(){
		
		this.setRollover(true);
		this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
				
		infoButton 		= new SIPCommButton();						
		toolsButton 	= new SIPCommButton(configureButtonIcon);
		searchButton 	= new SIPCommButton();
		addButton 		= new SIPCommButton(addButtonIcon);
				
		this.init();
	}
	
	private void init() {
		this.add(addButton);		
		this.add(toolsButton);
		this.add(infoButton);
		this.add(searchButton);
	}
	
	public void paint(Graphics g){
		super.paint(g);
		
		Graphics2D g2 = (Graphics2D)g;
		
		GradientPaint p = new GradientPaint(this.getWidth()/2, 
				0, 
				LookAndFeelConstants.CONTACTPANEL_SELECTED_START_COLOR, 
				this.getWidth()/2, 
				LookAndFeelConstants.CONTACTPANEL_SELECTED_GRADIENT_SIZE, 
				LookAndFeelConstants.CONTACTPANEL_SELECTED_END_COLOR);		

		g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
		
		g2.setPaint(p);
		
		//g2.dra
	}
}

@@ -66,24 +66,52 @@
 .Dimension;%0A
+import java.awt.FlowLayout;%0A
 import java.
@@ -696,16 +696,174 @@
 E_ICON;%0A
+%09private Image searchButtonIcon %09%09= LookAndFeelConstants.QUICK_MENU_SEARCH_ICON;%0A%09private Image infoButtonIcon %09%09= LookAndFeelConstants.QUICK_MENU_INFO_ICON;%0A
 %09%0A%09SIPCo
@@ -1018,16 +1018,73 @@
 (true);%0A
+%09%09this.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 0));%0A
 %09%09this.s
@@ -1124,17 +1124,17 @@
 yBorder(
-5
+0
 , 5, 5, 
@@ -1178,16 +1178,30 @@
 mButton(
+infoButtonIcon
 );%09%09%09%09%09%09
@@ -1294,16 +1294,32 @@
 mButton(
+searchButtonIcon
 );%0A%09%09add
@@ -1452,32 +1452,34 @@
 dd(toolsButton);
+%09%09
 %0A%09%09this.add(info
@@ -1474,20 +1474,22 @@
 his.add(
-info
+search
 Button);
@@ -1492,38 +1492,36 @@
 on);%0A%09%09this.add(
-search
+info
 Button);%0A%09%7D%0A%09%0A%09p

configure and info buttons added to the quick menu