edu.stanford.smi.protege.resource.UglyIcon Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of protege Show documentation
Show all versions of protege Show documentation
Core code for the Protege ontology editor. Serves as the basis for the Protege-Frames and Protege-OWL editors.
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