diff options
| author | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
| commit | e1e781bb2135ef78592226f1a3eaba4925702f1f (patch) | |
| tree | 8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/scape/TabbedDisplayPanel.java | |
| download | worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip | |
Diffstat (limited to 'NET/worlds/scape/TabbedDisplayPanel.java')
| -rw-r--r-- | NET/worlds/scape/TabbedDisplayPanel.java | 429 |
1 files changed, 429 insertions, 0 deletions
diff --git a/NET/worlds/scape/TabbedDisplayPanel.java b/NET/worlds/scape/TabbedDisplayPanel.java new file mode 100644 index 0000000..63144cd --- /dev/null +++ b/NET/worlds/scape/TabbedDisplayPanel.java @@ -0,0 +1,429 @@ +/* */ 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<Component> cards = new Vector(); +/* 332 */ private Vector<String> 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 + */
\ No newline at end of file |