public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { assert (value instanceof Node); Node node = (Node) value; String html = "<html><b>" + StringUtils.humanizeName(node.getName()) + "</b> – " + node.getDescription() + "<br><font color=#333333>" + node.getDataClass().getSimpleName() + " —</font> <font color=#666666>" + node.getLibrary().getName() + "</font></html>"; setText(html); if (isSelected) { setBackground(Theme.NODE_SELECTION_ACTIVE_BACKGROUND_COLOR); } else { setBackground(Theme.NODE_SELECTION_BACKGROUND_COLOR); } setEnabled(list.isEnabled()); setFont(list.getFont()); setIcon(new ImageIcon(NodeView.getImageForNode(node))); setBorder(Theme.BOTTOM_BORDER); setOpaque(true); return this; }
/** * This should be a task of MindMapLayout start,end must be initialized... * * @param target TODO */ public void paint(NodeView target, Graphics2D g) { this.source = target.getVisibleParentView(); this.target = target; createEnd(); createStart(); paint(g); this.source = null; this.target = null; }
protected void createStart() { start = source.getMainViewOutPoint(getTarget(), end); Tools.convertPointToAncestor(source.getMainView(), start, source); }