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

edu.stanford.smi.protege.ui.CheckBoxRenderer 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.ui;

import java.awt.*;

import javax.swing.*;
import javax.swing.table.*;

/**
 * Renderer to display a check box to acquire a boolean value.
 * 
 * @author    Ray Fergerson 
 */

public class CheckBoxRenderer extends JCheckBox implements TableCellRenderer {

    private static final long serialVersionUID = -4049122419048829462L;

    public CheckBoxRenderer() {
        setHorizontalAlignment(CENTER);
        setOpaque(false);
    }

    public Component getTableCellRendererComponent(
        JTable table,
        Object value,
        boolean isSelected,
        boolean b,
        int row,
        int col) {
        setSelected(Boolean.TRUE.equals(value));
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy