MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / getInstance

Method getInstance

src/main/java/images/SmilesIcons.java:47–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

Callers 3

parseMsgMethod · 0.95
ConfigMethod · 0.95
SmilePickerMethod · 0.95

Calls 6

getInstanceMethod · 0.95
ceilMethod · 0.95
getSmileTableMethod · 0.80
getWidthMethod · 0.65
sizeMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected