home *** CD-ROM | disk | FTP | other *** search
- import com.sun.java.swing.JComponent;
- import com.sun.java.swing.JLabel;
- import java.awt.Point;
- import java.awt.Polygon;
-
- class ToolTipPanel$Cow extends JLabel {
- // $FF: synthetic field
- private final ToolTipPanel this$0;
- Polygon cowgon;
- boolean moo;
- boolean milk;
- boolean tail;
-
- public ToolTipPanel$Cow(ToolTipPanel var1) {
- super(SwingSet.sharedInstance().loadImageIcon("images/cow.gif", "Black and white cow"));
- this.this$0 = var1;
- this.this$0 = var1;
- this.cowgon = new Polygon();
- this.moo = false;
- this.milk = false;
- this.tail = false;
- ((JComponent)this).setAlignmentX(0.5F);
- this.cowgon.addPoint(3, 20);
- this.cowgon.addPoint(44, 4);
- this.cowgon.addPoint(79, 15);
- this.cowgon.addPoint(130, 11);
- this.cowgon.addPoint(252, 5);
- this.cowgon.addPoint(181, 17);
- this.cowgon.addPoint(301, 45);
- this.cowgon.addPoint(292, 214);
- this.cowgon.addPoint(269, 209);
- this.cowgon.addPoint(266, 142);
- this.cowgon.addPoint(250, 161);
- this.cowgon.addPoint(235, 218);
- this.cowgon.addPoint(203, 206);
- this.cowgon.addPoint(215, 137);
- this.cowgon.addPoint(195, 142);
- this.cowgon.addPoint(143, 132);
- this.cowgon.addPoint(133, 189);
- this.cowgon.addPoint(160, 200);
- this.cowgon.addPoint(97, 196);
- this.cowgon.addPoint(107, 182);
- this.cowgon.addPoint(118, 185);
- this.cowgon.addPoint(110, 144);
- this.cowgon.addPoint(59, 77);
- this.cowgon.addPoint(30, 82);
- this.cowgon.addPoint(30, 35);
- this.cowgon.addPoint(15, 36);
- }
-
- public boolean contains(int var1, int var2) {
- if (var1 > 30 && var1 < 60 && var2 > 60 && var2 < 85) {
- if (!this.moo) {
- ((JComponent)this).setToolTipText("Mooooo");
- this.moo = true;
- this.milk = false;
- this.tail = false;
- }
- } else if (var1 > 150 && var1 < 230 && var2 > 90 && var2 < 145) {
- if (!this.milk) {
- ((JComponent)this).setToolTipText(" Got Milk? ");
- this.milk = true;
- this.moo = false;
- this.tail = false;
- }
- } else if (var1 > 280 && var1 < 300 && var2 > 20 && var2 < 175) {
- if (!this.tail) {
- ((JComponent)this).setToolTipText("Tail.");
- this.tail = true;
- this.moo = false;
- this.milk = false;
- }
- } else if (this.moo || this.milk || this.tail) {
- ((JComponent)this).setToolTipText("Cow.");
- this.moo = false;
- this.tail = false;
- this.milk = false;
- }
-
- return this.cowgon.contains(new Point(var1, var2));
- }
- }
-