()
| 45 | |
| 46 | private static ImageList instance = null; |
| 47 | public static ImageList getInstance() { |
| 48 | //#ifdef SMILES |
| 49 | if (null == instance){ |
| 50 | |
| 51 | try { |
| 52 | int smilesCount = MessageParser.getInstance().getSmileTable().size(); |
| 53 | cols = ceil(SMILES_IN_ROW, smilesCount); |
| 54 | } catch (Exception e) { |
| 55 | } |
| 56 | //#ifdef ANI_SMILES |
| 57 | instance = new AniImageList(); |
| 58 | ((AniImageList) instance).load("/smiles"); |
| 59 | //#endif |
| 60 | |
| 61 | if (instance == null || instance.getWidth() == 0) { |
| 62 | instance = new ImageList(res, cols, SMILES_IN_ROW); |
| 63 | } |
| 64 | } |
| 65 | //#endif |
| 66 | return instance; |
| 67 | } |
| 68 | |
| 69 | private static int ceil(int rows, int count){ |
| 70 | int tempCols = count / rows; |
no test coverage detected