FileDocCategorySizeDatePackage
UIComponentImpl.javaAPI DocAzureus 3.0.3.42916Thu Feb 09 19:43:06 GMT 2006org.gudy.azureus2.pluginsimpl.local.ui.components

UIComponentImpl

public class UIComponentImpl extends Object implements UIComponent
author
parg

Fields Summary
protected Properties
properties
protected List
listeners
Constructors Summary
protected UIComponentImpl()

	
	
	
	
	
		properties.put( PT_ENABLED, new Boolean( true ));
		properties.put( PT_VISIBLE, new Boolean( true ));
	
Methods Summary
public voidaddPropertyChangeListener(UIPropertyChangeListener l)

		listeners.add( l );
	
public booleangetEnabled()

		return(((Boolean)getProperty( PT_ENABLED )).booleanValue());
	
public java.lang.ObjectgetProperty(java.lang.String property_type)

		return( properties.get( property_type ));
	
public booleangetVisible()

		return(((Boolean)getProperty( PT_VISIBLE )).booleanValue());
	
public voidremovePropertyChangeListener(UIPropertyChangeListener l)

		listeners.remove(l);
	
public voidsetEnabled(boolean enabled)

		setProperty( PT_ENABLED, new Boolean( enabled ));
	
public voidsetProperty(java.lang.String property_type, java.lang.Object property_value)

		final Object	old_value = properties.get( property_type );
		
		properties.put( property_type, property_value );
		
		UIPropertyChangeEvent	ev = new
			UIPropertyChangeEvent()
			{
				public UIComponent
				getSource()
				{
					return( UIComponentImpl.this );
				}
				
				public String
				getPropertyType()
				{
					return( property_type );
				}
				
				public Object
				getNewPropertyValue()
				{
					return( property_value );
				}
				
				public Object
				getOldPropertyValue()
				{
					return( old_value );
				}
			};
			
		for (int i=0;i<listeners.size();i++){
			
			((UIPropertyChangeListener)listeners.get(i)).propertyChanged( ev );
		}
	
public voidsetVisible(boolean visible)

		setProperty( PT_VISIBLE, new Boolean( visible ));