List of usage examples for java.awt FlowLayout setVgap
public void setVgap(int vgap)
From source file:org.openmicroscopy.shoola.agents.measurement.util.ui.ResultsCellRenderer.java
/** * Adds the appropriate shape icon to the label. * //w w w. j a va 2 s. c om * @param shape above. */ private JComponent makeShapeIcon(JLabel label, String shape) { if (FigureUtil.SCRIBBLE_TYPE.equals(shape)) label.setIcon(SCRIBBLE); else if (FigureUtil.LINE_TYPE.equals(shape)) label.setIcon(LINE); else if (FigureUtil.LINE_CONNECTION_TYPE.equals(shape)) label.setIcon(CONNECTION); else if (FigureUtil.POLYGON_TYPE.equals(shape)) label.setIcon(POLYGON); else if (FigureUtil.POINT_TYPE.equals(shape)) label.setIcon(POINT); else if (FigureUtil.RECTANGLE_TYPE.equals(shape)) label.setIcon(RECTANGLE); else if (FigureUtil.ELLIPSE_TYPE.equals(shape)) label.setIcon(ELLIPSE); else if (FigureUtil.TEXT_TYPE.equals(shape)) label.setIcon(TEXT); else if (FigureUtil.MASK_TYPE.equals(shape)) label.setIcon(MASK); else label.setText(shape); if (label.getIcon() != null) { JPanel p = new JPanel(); FlowLayout layout = new FlowLayout(FlowLayout.CENTER); layout.setVgap(0); p.setBorder(BorderFactory.createEmptyBorder()); p.setLayout(layout); p.setOpaque(true); p.setBackground(getBackground()); p.add(label); return p; } return label; }