All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.stanford.smi.protege.widget.RoleRenderer Maven / Gradle / Ivy

Go to download

Core code for the Protege ontology editor. Serves as the basis for the Protege-Frames and Protege-OWL editors.

There is a newer version: 3.5.1
Show newest version
package edu.stanford.smi.protege.widget;

import edu.stanford.smi.protege.model.*;
import edu.stanford.smi.protege.resource.*;
import edu.stanford.smi.protege.util.*;

/**
 * A renderer used by the RoleWidget to display the "abstract" icon after the word abstract.  This hope is that this
 * will more easily allow the user to make the link between this role and the same icon on the classes panel.
 * 
 * @author Ray Fergerson 
 */
class RoleRenderer extends DefaultRenderer {

    private static final long serialVersionUID = 1044368024395724864L;

    public void load(Object o) {
        setMainText(o.toString());
        boolean isAbstract = o.equals(RoleConstraint.ABSTRACT);
        appendIcon(Icons.getClsIcon(false, isAbstract, false, false));
    }
}
/*
class RoleRenderer extends BasicComboBoxRenderer {

    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    	super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        boolean isAbstract = value.equals(RoleConstraint.ABSTRACT);
        Icon icon = Icons.getClsIcon(false, isAbstract, false);
        setIcon(icon);
    	return this;
	}
}
*/




© 2015 - 2025 Weber Informatics LLC | Privacy Policy