@author Eugene Stahov
| 40 | * @author Eugene Stahov |
| 41 | */ |
| 42 | public class ComplexString extends Vector implements VirtualElement { |
| 43 | |
| 44 | //private Vector v; |
| 45 | public final static int IMAGE = 0x00000000; |
| 46 | public final static int COLOR = 0x01000000; |
| 47 | public final static int RALIGN = 0x02000000; |
| 48 | public final static int UNDERLINE = 0x03000000; |
| 49 | //#if NICK_COLORS |
| 50 | public final static int NICK_ON = 0x04000000; |
| 51 | public final static int NICK_OFF = 0x05000000; |
| 52 | //#endif |
| 53 | |
| 54 | protected Font font=FontCache.getFont(false, FontCache.msg); |
| 55 | private int height; |
| 56 | private int width; |
| 57 | private ImageList imageList; |
| 58 | private int colorBGnd; |
| 59 | private int color; |
| 60 | protected boolean centered = false; |
| 61 | |
| 62 | //private int colors[]={0x800080, 0xff0000, 0xffa500, 0x008000, 0x0000ff}; |
| 63 | /* purple 0x800080 red 0xff0000 orange 0xffa500 green 0x008000 blue 0x0000ff */ |
| 64 | |
| 65 | /** Creates a new instance of ComplexString */ |
| 66 | public ComplexString() { |
| 67 | super(); |
| 68 | color=ColorTheme.getColor(ColorTheme.LIST_INK); |
| 69 | colorBGnd=ColorTheme.getColor(ColorTheme.LIST_BGND); |
| 70 | } |
| 71 | |
| 72 | /** Creates a new instance of ComplexString */ |
| 73 | public ComplexString(ImageList imageList) { |
| 74 | this(); |
| 75 | this.imageList=imageList; |
| 76 | } |
| 77 | |
| 78 | private int imgHeight(){ |
| 79 | return (imageList==null)?0:imageList.getHeight(); |
| 80 | } |
| 81 | private int imgWidth(){ |
| 82 | return (imageList==null)?0:imageList.getWidth(); |
| 83 | } |
| 84 | |
| 85 | public int getColor() { return color; } |
| 86 | public int getColorBGnd() { return colorBGnd; } |
| 87 | |
| 88 | public void setColorBGnd(int color){ colorBGnd=color;} |
| 89 | public void setColor(int color){ this.color=color;} |
| 90 | |
| 91 | public void onSelect(){}; |
| 92 | |
| 93 | public void drawItem(Graphics g, int offset, boolean selected){ |
| 94 | boolean ralign=false; |
| 95 | boolean underline=false; |
| 96 | |
| 97 | //#if NICK_COLORS |
| 98 | boolean nick=false; |
| 99 | //#endif |