GridBagConstraints (IComponent component) { final GridBagConstraints gbc; if (component.getCustomLayoutConstraints() instanceof GridBagConstraints) { gbc = (GridBagConstraints) component.getCustomLayoutConstraints(); } else { gbc = new GridBagConstraints(); } constraintsToGridBag(component.getConstraints(), gbc); return gbc; }