private static int convertAnchor(final GridBagConstraints gbc) {
    return switch (gbc.anchor) {
      case GridBagConstraints.NORTHWEST -> GridConstraints.ANCHOR_NORTHWEST;
      case GridBagConstraints.NORTH -> GridConstraints.ANCHOR_NORTH;
      case GridBagConstraints.NORTHEAST -> GridConstraints.ANCHOR_NORTHEAST;
      case GridBagConstraints.EAST -> GridConstraints.ANCHOR_EAST;
      case GridBagConstraints.SOUTHEAST -> GridConstraints.ANCHOR_SOUTHEAST;
      case GridBagConstraints.SOUTH -> GridConstraints.ANCHOR_SOUTH;
      case GridBagConstraints.SOUTHWEST -> GridConstraints.ANCHOR_SOUTHWEST;
      default -> GridConstraints.ANCHOR_WEST;
    };
  }
private static int convertAnchor(final GridBagConstraints gbc)