/*
* A CCNx command line utility.
*
* Copyright (C) 2008, 2009 Palo Alto Research Center, Inc.
*
* This work is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
* This work 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., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
package org.ccnx.ccn.utils.explorer;
import javax.swing.Icon;
public class IconData {
protected Icon m_icon;
protected Icon m_expandedIcon;
protected Object m_data;
public IconData(Icon icon, Object data) {
m_icon = icon;
m_expandedIcon = null;
m_data = data;
}
public IconData(Icon icon, Icon expandedIcon, Object data) {
m_icon = icon;
m_expandedIcon = expandedIcon;
m_data = data;
}
public Icon getIcon() {
return m_icon;
}
public void setIcon(Icon i){
m_icon = i;
}
public Icon getExpandedIcon() {
return m_expandedIcon != null ? m_expandedIcon : m_icon;
}
public Object getObject() {
return m_data;
}
public String toString() {
return m_data.toString();
}
}