Пример #1
0
 @Override
 public void paint(Graphics g) {
   if (node.isRefNode()) {
     BufferedImage image = new BufferedImage(1000, HEIGHT_CELL, BufferedImage.TYPE_INT_ARGB);
     Graphics2D g2 = image.createGraphics();
     g2.setBackground(new Color(0, 0, 0, 0));
     refPainter.draw(g2, OneElementList.buildList(node.getRef()), 0);
     g.drawImage(image, 0, 0, null);
   } else {
     super.paint(g);
   }
 }
Пример #2
0
  @Override
  public Component getTreeCellRendererComponent(
      JTree tree,
      Object value,
      boolean selected,
      boolean expanded,
      boolean leaf,
      int row,
      boolean hasFocus) {
    this.node = (RefTreeTableNode) value;
    label.setFont(new Font("Arial", Font.BOLD, 14));

    if (node.isRefNode()) {
      label.setText(node.getRef().getName() + "   ");
    } else {
      label.setText(node.getText());
    }
    return label;
  }