1 17 18 package helloworld.renderer; 19 20 import java.awt.*; 21 import javax.swing.tree.*; 22 23 import Jmc.commonGui.*; 24 import Jmc.commonGui.loader.*; 25 import Jmc.baseGui.gui_fixedSize; 26 import Jmc.baseTools.*; 27 28 38 public class HwTreeRenderer implements base_treeItemRenderer_if 39 { 40 52 public base_guiWidget_if pcmf_getRenderWidget(Object xToRender, boolean xSelected, base_treeView_if xTree) 53 { 54 base_appl_if l_appl = (base_appl_if)base_registredObject.pcmf_getObjByName(base_appl_if.MY_APPL); 56 base_image_if l_img = (base_image_if)base_registredObject.pcmf_getObjByName("root_icon"); 57 58 base_text_if l_text = l_appl.pcmf_getGuiObjFactory().pcmf_createText(l_appl.pcmf_getApplType(), xToRender.toString(), "-" + xToRender.toString(), l_appl); 60 61 l_text.pcmf_setFont(new base_fontDesc("ARIAL", 12, Font.BOLD)); 62 l_text.pcmf_setBorder(2); 63 64 if (((DefaultMutableTreeNode)xToRender).getPath().length % 2 == 0) 66 l_text.pcmf_setBgColor("#FFA000"); 67 else 68 l_text.pcmf_setBgColor("#A0A000"); 69 70 l_text.pcmf_setFixedSize(150, 20, gui_fixedSize.FIX_SIZE); 71 l_text.pcmf_setIcon(l_img); 72 73 l_text.pcmf_setRenderIfHidden(true); 75 76 return (l_text); 77 } 78 } 79 | Popular Tags |