Class LayoutStyle

java.lang.Object
vaadinx.swing.LayoutStyle

public class LayoutStyle extends Object
Port of LayoutStyle (D_grouplayout). Required for the import-swap: NetBeans GUI-builder code references javax.swing.LayoutStyle.ComponentPlacement inside GroupLayout gap calls, which swaps to vaadinx.swing.LayoutStyle.ComponentPlacement — so this class must exist for such code to compile.

Only the LayoutStyle.ComponentPlacement enum is load-bearing. GroupLayout consumes it directly (mapping RELATED / UNRELATED to fixed pixel gaps in addPreferredGap), so it does not go through getPreferredGap(JComponent, JComponent, LayoutStyle.ComponentPlacement, int, Container)/getContainerGap(JComponent, int, Container) dispatch. The gap-computation methods are provided for API completeness and return R_layouts_close_enough defaults via EHelper.onUnimplemented(String, String, Object...) — no migrated code we target calls them (NetBeans emits the enum, not the LayoutStyle instance).

Kept concrete (JDK's is abstract) so getInstance() returns a usable object without a separate default subclass; non-final to preserve the JDK's extensible shape per R_swing_is_truth.

  • Constructor Details

    • LayoutStyle

      public LayoutStyle()
  • Method Details

    • getInstance

      public static LayoutStyle getInstance()
    • setInstance

      public static void setInstance(LayoutStyle style)
    • getPreferredGap

      public int getPreferredGap(JComponent component1, JComponent component2, LayoutStyle.ComponentPlacement type, int position, Container parent)
      Preferred gap between two components. Not on the migrated-code path (NetBeans hands LayoutStyle.ComponentPlacement to GroupLayout directly); returns GroupLayout's RELATED default (6px) as a sensible R_layouts_close_enough answer.
    • getContainerGap

      public int getContainerGap(JComponent component, int position, Container parent)
      Preferred gap between a component and the container edge. R_layouts_close_enough default (10px).