/* */ package NET.worlds.scape; /* */ /* */ import java.awt.CardLayout; /* */ import java.awt.Color; /* */ import java.awt.Component; /* */ import java.awt.Dimension; /* */ import java.awt.Graphics; /* */ import java.awt.Insets; /* */ import java.awt.Panel; /* */ import java.awt.Point; /* */ import java.util.Vector; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ class TabbedDisplayPanel /* */ extends Panel /* */ { /* */ private static final long serialVersionUID = 1L; /* */ private int count; /* 331 */ private Vector cards = new Vector(); /* 332 */ private Vector cardNames = new Vector(); /* */ /* */ TabbedDisplayPanel() /* */ { /* 336 */ setLayout(new CardLayout()); /* */ } /* */ /* */ void addItem(Component c) /* */ { /* 341 */ insertItem(this.cards.size(), c); /* */ } /* */ /* */ void insertItem(int index, Component c) /* */ { /* 346 */ String cardName = this.count++; /* 347 */ this.cardNames.insertElementAt(cardName, index); /* 348 */ this.cards.insertElementAt(c, index); /* 349 */ add(cardName, c); /* 350 */ validate(); /* 351 */ repaint(); /* */ } /* */ /* */ void removeItem(int index) /* */ { /* 356 */ remove((Component)this.cards.elementAt(index)); /* 357 */ this.cards.removeElementAt(index); /* 358 */ this.cardNames.removeElementAt(index); /* */ } /* */ /* */ public Component getComponent(int index) /* */ { /* 363 */ return (Component)this.cards.elementAt(index); /* */ } /* */ /* */ void setChoice(int index) /* */ { /* 368 */ ((CardLayout)getLayout()).show(this, /* 369 */ (String)this.cardNames.elementAt(index)); /* */ } /* */ /* */ public Insets insets() /* */ { /* 374 */ return new Insets(0, 2, 2, 0); /* */ } /* */ /* */ public void paint(Graphics g) /* */ { /* 379 */ g.setColor(getBackground()); /* 380 */ if (this.cards.size() != 0) { /* 381 */ Dimension size = getSize(); /* 382 */ vLine(g, 1, 0, size.height); /* 383 */ g.setColor(getBackground().brighter()); /* 384 */ vLine(g, 0, 0, size.height - 2); /* 385 */ g.setColor(getBackground().darker()); /* 386 */ hLine(g, 0, size.height - 1, size.width - 1); /* 387 */ vLine(g, size.width - 1, size.height - 1, 0); /* 388 */ hLine(g, 1, size.height - 2, size.width - 2); /* 389 */ vLine(g, size.width - 2, size.height - 2, 0); /* */ } /* */ else { /* 392 */ g.fillRect(0, 0, getSize().width, getSize().height); /* */ } /* */ } /* */ /* */ private static void vLine(Graphics g, int x1, int y1, int y2) { /* 397 */ g.drawLine(x1, y1, x1, y2); /* */ } /* */ /* */ private static void hLine(Graphics g, int x1, int y1, int x2) /* */ { /* 402 */ g.drawLine(x1, y1, x2, y1); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ @Deprecated /* */ public Component locate(int x, int y) /* */ { /* 412 */ if (!contains(x, y)) /* 413 */ return null; /* 414 */ int n = getComponentCount(); /* 415 */ for (int i = 0; i < n; i++) { /* 416 */ Component c = getComponent(i); /* 417 */ Point loc = c.getLocation(); /* 418 */ if ((c != null) && (c.isVisible()) && (c.contains(x - loc.x, y - loc.y))) /* 419 */ return c; /* */ } /* 421 */ return this; /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\TabbedDisplayPanel.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */