/*
 * Created on Mar 22, 2004
 *
 */
package LumiSoft.UI.Controls;

import javax.swing.*;

/**
 * Statusbar panle.
 */
public class WStatusBarPanel 
{
	private WStatusBar m_pStatusBar  = null;
	private String     m_Text        = "";
//	private int        m_TextAlign   = 0;
//	private String     m_ToolTipText = "";
	private ImageIcon  m_pIcon       = null;
	private int        m_Width       = 50;
	private boolean    m_AutoSize    = false; 
	
	/**
	 * Default constructor.
	 * @param statusBar
	 */
	protected WStatusBarPanel(WStatusBar statusBar)
	{
		m_pStatusBar = statusBar;
	}
	
	
	/**
	 * Gets the text of the status bar panel.
	 * @return
	 */
	public String getText()
	{
		return m_Text;
	}
	/**
	 * Sets the text of the status bar panel.
	 * @param value
	 */
	public void setText(String value)
	{
		if(!m_Text.equals(value)){
			m_Text = value;
			
			m_pStatusBar.UI_Changed();
		}
	}
	
	/**
	 * Gets the icon to display within the status bar panel.
	 * @return
	 */
	public ImageIcon getIcon()
	{
		return m_pIcon;
	}
	/**
	 * Sets the icon to display within the status bar panel.
	 * @param value
	 */
	public void setIcon(ImageIcon value)
	{
		if(m_pIcon != value){
			m_pIcon = value;
			
			m_pStatusBar.UI_Changed();
		}
	}
	
	/**
	 * Gets the width of the status bar panel within the StatusBar control.
	 * @return
	 */
	public int getWidth()
	{
		return m_Width;
	}
	/**
	 * Sets the width of the status bar panel within the StatusBar control.
	 * @param value
	 */
	public void setWidth(int value)
	{
		if(m_Width != value){
			m_Width = value;
			
			m_pStatusBar.UI_Changed();
		}
	}
	
	/**
	 * Gets if panel fills all available free space.
	 * @return
	 */
	public boolean getAutoSize()
	{
		return m_AutoSize;
	}
	/**
	 * Sets if panel fills all available free space.
	 * @param value
	 */
	public void setAutoSize(boolean value)
	{
		if(m_AutoSize != value){
			m_AutoSize = value;
			
			m_pStatusBar.UI_Changed();
		}
	}
	
/*	public void getBounds()
	{
		// TODO:
	}*/
}
