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

Method setPhoto

src/main/java/VCard/VCardEdit.java:178–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176 }
177
178 private void setPhoto() {
179 try {
180 //itemsList.removeElement(endVCard);
181 itemsList.removeElement(noPhoto);
182 itemsList.removeElement(badFormat);
183 itemsList.removeElement(photoItem);
184 itemsList.removeElement(photoTooLarge);
185
186 itemsList.removeElement(publish);
187 } catch (Exception e) { }
188
189 if (vcard.hasPhoto) {
190 if (vcard.getPhoto().length==1) {
191 vcard.setPhoto(null);
192 itemsList.addElement(photoTooLarge);
193 } else {
194 try {
195 Image photoImg=Image.createImage(vcard.getPhoto(), 0,vcard.getPhoto().length);
196 photoItem=new ImageItem(photoImg, String.valueOf(vcard.getPhoto().length)+" bytes");
197 itemsList.addElement(photoItem);
198 } catch (Exception e) {
199 itemsList.addElement(badFormat);
200 }
201 }
202 } else {
203 itemsList.addElement(noPhoto);
204 }
205 //itemsList.addElement(endVCard);
206
207 itemsList.addElement(publish);
208 }
209
210 public final void commandState() {
211 menuCommands.removeAllElements();

Callers 4

VCardEditMethod · 0.95
menuActionMethod · 0.95
BrowserFilePathNotifyMethod · 0.95
cameraImageNotifyMethod · 0.95

Calls 3

createImageMethod · 0.95
getPhotoMethod · 0.80
addElementMethod · 0.80

Tested by

no test coverage detected