You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SIPRP/trunk/siprp/medicina/processo/estrutura/EstruturaProcessoMutableTre...

80 lines
1.4 KiB

/*
* EstruturaProcessoMutableTreeNode.java
*
* Created on 29 de Abril de 2007, 18:57
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package siprp.medicina.processo.estrutura;
import com.evolute.utils.data.IDObject;
import com.evolute.utils.images.ImageIconLoader;
import javax.swing.Icon;
import javax.swing.tree.DefaultMutableTreeNode;
/**
*
* @author Frederico
*/
abstract public class EstruturaProcessoMutableTreeNode extends DefaultMutableTreeNode
implements IDObject
{
protected Icon icon;
protected Integer id;
protected String descricao;
/** Creates a new instance of EstruturaProcessoMutableTreeNode */
public EstruturaProcessoMutableTreeNode( Integer id, String descricao )
{
super( descricao );
this.id = id;
this.descricao = descricao;
}
public Integer getID()
{
return id;
}
public void setID( Integer id )
{
this.id = id;
}
public String getDescricao()
{
return descricao;
}
public void setDescricao( String descricao )
{
this.descricao = descricao;
setUserObject( descricao );
}
abstract protected String getIconPath();
public Icon getIcon()
{
loadIcon();
return icon;
}
protected void loadIcon()
{
if( icon == null && getIconPath() != null )
{
try
{
icon = ImageIconLoader.loadImageIcon( getClass(), getIconPath() );
}
catch( Exception ex )
{
ex.printStackTrace();
}
}
}
}