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

edu.stanford.smi.protege.resource.UglyIcon 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.resource;

import java.awt.*;

import javax.swing.*;

/**
 * TODO Class Comment
 * @author Ray Fergerson 
 */
class UglyIcon implements Icon {
    private static final int ICON_SIZE = 16;

    public void paintIcon(Component c, Graphics g, int x, int y) {
        g.translate(x, y);
        g.setColor(Color.GREEN);
        g.drawRect(0, 0, ICON_SIZE - 1, ICON_SIZE - 1);
        g.drawRect(1, 1, ICON_SIZE - 3, ICON_SIZE - 3);
        g.setColor(Color.RED);
        g.fillRect(2, 2, ICON_SIZE - 4, ICON_SIZE - 4);
        g.translate(-x, -y);
    }

    public int getIconWidth() {
        return ICON_SIZE;
    }

    public int getIconHeight() {
        return ICON_SIZE;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy