MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / drawItem

Method drawItem

src/main/java/Client/Contact.java:778–874  ·  view source on GitHub ↗
(Graphics g, int ofs, boolean sel)

Source from the content-addressed store, hash-verified

776 }
777
778 public void drawItem(Graphics g, int ofs, boolean sel) {
779 int w = g.getClipWidth();
780 int h = getVHeight();
781 int xo = g.getClipX();
782 int yo = g.getClipY();
783
784 int offset = xo + 4;
785
786 int imgH = (h - ilHeight) >> 1;
787
788 if (getImageIndex() > -1) {
789 offset += ilHeight;
790 il.drawImage(g, getImageIndex(), xo + 2, imgH);
791 }
792//#ifdef CLIENTS_ICONS
793 if (hasClientIcon()) {
794 ImageList clients = ClientsIcons.getInstance();
795 int clientImgSize = clients.getWidth();
796 w -= clientImgSize;
797 clients.drawImage(g, client, w, (h - clientImgSize) / 2);
798 if (maxImgHeight < clientImgSize) {
799 maxImgHeight = clientImgSize;
800 }
801 }
802//#endif
803//#ifdef PEP
804 if (hasMood()) {
805 ImageList moods = MoodIcons.getInstance();
806 int moodImgSize = moods.getWidth();
807 w -= moodImgSize;
808 moods.drawImage(g, pepMood, w, (h - moodImgSize) / 2);
809 if (maxImgHeight < moodImgSize) {
810 maxImgHeight = moodImgSize;
811 }
812 }
813//#ifdef PEP_TUNE
814 if (pepTune) {
815 w -= ilHeight;
816 il.drawImage(g, RosterIcons.ICON_PROFILE_INDEX + 1, w, imgH);
817 }
818//#ifdef PEP_ACTIVITY
819 if (hasActivity()) {
820 w -= ilHeight;
821 il.drawImage(g, RosterIcons.ICON_PROFILE_INDEX, w, imgH);
822 }
823//#endif
824//#ifdef PEP_LOCATION
825 if (hasLocation()) {
826 w -= ilHeight;
827 il.drawImage(g, RosterIcons.ICON_PROGRESS_INDEX, w, imgH);
828 }
829//#endif
830
831//#endif
832//#endif
833/*
834 if (vcard!=null) {
835 w-=ilHeight;

Callers

nothing calls this directly

Calls 15

getVHeightMethod · 0.95
getImageIndexMethod · 0.95
drawImageMethod · 0.95
hasClientIconMethod · 0.95
getInstanceMethod · 0.95
getWidthMethod · 0.95
hasMoodMethod · 0.95
getInstanceMethod · 0.95
hasActivityMethod · 0.95
hasLocationMethod · 0.95
getSecImageIndexMethod · 0.95
getFirstLengthMethod · 0.95

Tested by

no test coverage detected