@Override
  public void paint(final Graphics2D g2, final int x, final int y, final int w, final int h) {
    if (g2 == null) {
      return;
    }

    super.paint(g2, x, y, w, h);
    undoWorldTransform(g2);

    g2.setPaint(Color.GRAY.darker());

    final int vw = graphView.getWidth();
    final int ix = getX(vw, secondaryTextImage.getWidth(null));
    int tx = ix;

    final Font font = Fonts.BOLD_FONT;
    g2.setFont(new Font(font.getName(), Font.BOLD, font.getSize()));
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

    if (type == EGraph.SECONDARY_GRAPH) {
      final Rectangle2D bounds = font.getStringBounds(title, g2.getFontRenderContext());
      tx = getX(vw, Math.max(OFFSET, (int) bounds.getWidth()));
    }

    g2.drawString(title, tx, 15);
    g2.drawImage(getTextImage(), ix, 20, null);
  }
Renders the graph view background with indicators for the type of graph being shown.
java/ui/src/main/java/com/google/security/zynamics/bindiff/graph/backgroundrendering/ImageBackgroundRenderer.java