Example usage for javax.swing JComponent doLayout

List of usage examples for javax.swing JComponent doLayout

Introduction

In this page you can find the example usage for javax.swing JComponent doLayout.

Prototype

public void doLayout() 

Source Link

Document

Causes this container to lay out its components.

Usage

From source file:com.projity.pm.graphic.network.NetworkRenderer.java

public void paintNode(Graphics2D g, GraphicNode node) {
    Rectangle bounds = getBounds(node);
    if (isEditing(node)) {
        editor.paintEditor(node);//from w  w  w.  j a  va 2s  .  c o m
    } else {
        JComponent c = renderer.getRendererComponent(node, ((NetworkParams) graphInfo).getZoom());
        if (container == null) {
            //c=new JLabel("test");
            c.setDoubleBuffered(false);
            c.setOpaque(false);
            c.setForeground(Color.BLACK);
            c.setSize(bounds.width, bounds.height);
            g.translate(bounds.x, bounds.y);
            c.doLayout();
            c.print(g);
            g.translate(-bounds.x, -bounds.y);
        } else
            rendererPane.paintComponent(g, c, container, bounds.x, bounds.y, bounds.width, bounds.height, true);
    }
}