KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > zirc > gui > smiliesWindow > SmiliesCollection


1 package zirc.gui.smiliesWindow ;
2
3 import javax.swing.* ;
4
5 //zIrc, irc client.
6
// Copyright (C) 2004 CoolBytes(Stephane claret, Andre Aymon, Alban Zumofen) coolbytes@hotmail.com
7
//
8
// This program is free software; you can redistribute it and/or
9
// modify it under the terms of the GNU General Public License
10
// as published by the Free Software Foundation; either version 2
11
// of the License, or (at your option) any later version.
12
//
13
// This program is distributed in the hope that it will be useful,
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
// GNU General Public License for more details.
17

18 /**
19  * <p>Title: SmiliesCollection</p>
20  * <p>Description: classe qui detient le tableau des smilies</p>
21  * <p>Copyright: Copyright (c) 2004</p>
22  * <p>Company: CoolBytes(Stephane claret, Andre Aymon, Alban Zumofen) coolbytes@hotmail.com</p>
23  * @version 1.0
24  */

25
26 public class SmiliesCollection
27 {
28   private Object JavaDoc[][][] img ;
29   public final static int L = 2 ; //hauteur
30
public final static int l = 9 ; //largeur
31
public final static int p = 3 ; //profondeur/0=path /1=code string /2=index
32

33   public SmiliesCollection()
34   {
35     //on cree le tableau des icones
36
//Attention a adapter la hauteur de sideFrame dans MainFrame!
37
//http://developers.evrsoft.com/forum/misc.php?do=showsmilies
38
//
39
img = new Object JavaDoc[L][l][p] ;
40     img[0][0][0] = new ImageIcon("fichiers/emoticons/1.gif") ;
41     img[0][0][1] = ":rolleyes:" ;
42     img[0][0][2] = "1" ;
43     img[0][1][0] = new ImageIcon("fichiers/emoticons/2.gif") ;
44     img[0][1][1] = ":)" ;
45     img[0][1][2] = "2" ;
46     img[0][2][0] = new ImageIcon("fichiers/emoticons/3.gif") ;
47     img[0][2][1] = ":cool:" ;
48     img[0][2][2] = "3" ;
49     img[0][3][0] = new ImageIcon("fichiers/emoticons/4.gif") ;
50     img[0][3][1] = ";)" ;
51     img[0][3][2] = "4" ;
52     img[0][4][0] = new ImageIcon("fichiers/emoticons/5.gif") ;
53     img[0][4][1] = ":confused:" ;
54     img[0][4][2] = "5" ;
55     img[0][5][0] = new ImageIcon("fichiers/emoticons/6.gif") ;
56     img[0][5][1] = ":(" ;
57     img[0][5][2] = "6" ;
58     img[0][6][0] = new ImageIcon("fichiers/emoticons/7.gif") ;
59     img[0][6][1] = ":mad:" ;
60     img[0][6][2] = "7" ;
61     img[0][7][0] = new ImageIcon("fichiers/emoticons/8.gif") ;
62     img[0][7][1] = ":thumbdown" ;
63     img[0][7][2] = "8" ;
64     img[0][8][0] = new ImageIcon("fichiers/emoticons/9.gif") ;
65     img[0][8][1] = ":eek:" ;
66     img[0][8][2] = "9" ;
67     img[1][0][0] = new ImageIcon("fichiers/emoticons/10.gif") ;
68     img[1][0][1] = ":D" ;
69     img[1][0][2] = "10" ;
70     img[1][1][0] = new ImageIcon("fichiers/emoticons/11.gif") ;
71     img[1][1][1] = ":thumbup:" ;
72     img[1][1][2] = "11" ;
73     img[1][2][0] = new ImageIcon("fichiers/emoticons/12.gif") ;
74     img[1][2][1] = ":messedup:" ;
75     img[1][3][2] = "12" ;
76     img[1][3][0] = new ImageIcon("fichiers/emoticons/13.gif") ;
77     img[1][3][1] = ":o" ;
78     img[1][3][2] = "13" ;
79     img[1][4][0] = new ImageIcon("fichiers/emoticons/14.gif") ;
80     img[1][4][1] = ":p" ;
81     img[1][4][2] = "14" ;
82     img[1][5][0] = new ImageIcon("fichiers/emoticons/15.gif") ;
83     img[1][5][1] = ":aiua:" ;
84     img[1][5][2] = "15" ;
85     img[1][6][0] = new ImageIcon("fichiers/emoticons/16.gif") ;
86     img[1][6][1] = ":dead:" ;
87     img[1][6][2] = "16" ;
88     img[1][7][0] = new ImageIcon("fichiers/emoticons/17.gif") ;
89     img[1][7][1] = ":grr:" ;
90     img[1][7][2] = "17" ;
91     img[1][8][0] = new ImageIcon("fichiers/emoticons/18.gif") ;
92     img[1][8][1] = ":redface:" ;
93     img[1][8][2] = "18" ;
94   }
95
96   public Object JavaDoc getValueAt(int rowNum, int colNum, int depth)
97   {
98     return img[rowNum][colNum][depth] ;
99   }
100
101   public int getRowsCount()
102   {
103     return L ;
104   }
105
106   public int getColumnsCount()
107   {
108     return l ;
109   }
110 }
111
Popular Tags