<commit_before>/*
 * Copyright 2000,2005 wingS development team.
 *
 * This file is part of wingS (http://wingsframework.org).
 *
 * wingS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1
 * of the License, or (at your option) any later version.
 *
 * Please see COPYING for the complete licence.
 */
package org.wings;

import java.util.ArrayList;
import java.util.List;

/**
 * Arranges components in a left-to-right or top-to-bottom order.
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 */
public class SFlowLayout
        extends SAbstractLayoutManager {
    /**
     * List of layouted components.
     */
    protected final List components;

    /**
     * Alignment (left, center, right) of components.
     */
    protected int align;
    
    /**
     * The horizontal gap (in pixels) specifiying the space
     * between columns.  They can be changed at any time.
     * This should be a non-negative integer.
     */
    protected int hgap = 0;

    /**
     * The vertical gap (in pixels) which specifiying the space
     * between rows.  They can be changed at any time.
     * This should be a non negative integer.
     */
    protected int vgap = 0;
    
    /**
     * Creates a new <code>SFlowLayout</code> with horizontal orientation and
     * left alignment.
     */
    public SFlowLayout() {
        components = new ArrayList(2);
        setAlignment(SConstants.CENTER_ALIGN);
    }

    /**
     * Creates a new <code>SFlowLayout</code> with horizonal orientation and the given alignment.
     *
     * @param alignment the alignment
     */
    public SFlowLayout(int alignment) {
        this();
        setAlignment(alignment);
    }
    
    /**
     * Creates a new <code>SFlowLayout</code> with horizontal orientation and the given alignment
     * and gaps
     * @param alignment the alignment
     * @param hgap the horizontal gap
     * @param vgap the vertical gap
     */
    public SFlowLayout(int alignment, int hgap, int vgap) {
        this(alignment);
        setHgap(hgap);
        setVgap(vgap);
    }    

    /**
     * Adds the given component at given index.
     *
     * @param c          component to add
     * @param constraint is ignored in this layout manager!
     * @param index      position to add component to
     */
    public void addComponent(SComponent c, Object constraint, int index) {
        components.add(index, c);
    }

    public void removeComponent(SComponent c) {
        components.remove(c);
    }

    /**
     * returns a list of all components
     *
     * @return all components
     */
    public List getComponents() {
        return components;
    }

    /**
     * Gets the horizontal gap between components in pixel. Rendered half as margin left and margin right
     * Some PLAFs might ignore this property.
     *
     * @return the horizontal gap between components
     */
    public int getHgap() {
        return hgap;
    }

    /**
     * Sets the horizontal gap between components to the specified value in pixe. Rendered half as margin left and margin right
     * Some PLAFs might ignore this property.
     *
     * @param hgap the horizontal gap between components
     */
    public void setHgap(int hgap) {
        this.hgap = hgap;
    }

    /**
     * Gets the vertical gap between components in pixel. Rendered half as margin top and margin bottom
     * Some PLAFs might ignore this property.
     *
     * @return the vertical gap between components
     */
    public int getVgap() {
        return vgap;
    }

    /**
     * Sets the vertical gap between components to the specified value in pixel.
     * Rendered half as margin top and margin bottom. Some PLAFs might ignore this property.
     *
     * @param vgap the vertical gap between components
     */
    public void setVgap(int vgap) {
        this.vgap = vgap;
    }    
    
    /**
     * returns the component at the given position
     *
     * @param i position
     * @return component
     */
    public SComponent getComponentAt(int i) {
        return (SComponent) components.get(i);
    }

    /**
     * Sets the alignment for this layout. Possible values are
     * <ul>
     * <li>{@link org.wings.SConstants#LEFT_ALIGN}
     * <li>{@link org.wings.SConstants#CENTER_ALIGN}
     * <li>{@link org.wings.SConstants#RIGHT_ALIGN}
     * </ul>
     *
     * @param a one of the allignment values shown above
     */
    public void setAlignment(int a) {
        align = a;
    }

    /**
     * returns the alignment
     *
     * @return alignment
     */
    public int getAlignment() { return align; }
}


<commit_msg>* adds a default 5-unit horizontal and vertical gap<commit_after>/*
 * Copyright 2000,2005 wingS development team.
 *
 * This file is part of wingS (http://wingsframework.org).
 *
 * wingS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1
 * of the License, or (at your option) any later version.
 *
 * Please see COPYING for the complete licence.
 */
package org.wings;

import java.util.ArrayList;
import java.util.List;

/**
 * Arranges components in a left-to-right or top-to-bottom order.
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 */
public class SFlowLayout
        extends SAbstractLayoutManager {
    /**
     * List of layouted components.
     */
    protected final List components;

    /**
     * Alignment (left, center, right) of components.
     */
    protected int align;
    
    /**
     * The horizontal gap (in pixels) specifiying the space
     * between columns.  They can be changed at any time.
     * This should be a non-negative integer.
     */
    protected int hgap = 0;

    /**
     * The vertical gap (in pixels) which specifiying the space
     * between rows.  They can be changed at any time.
     * This should be a non negative integer.
     */
    protected int vgap = 0;
    
    /**
     * Creates a new <code>SFlowLayout</code> with horizontal orientation,
     * center alignment and a default 5-unit horizontal and vertical gap.
     */
    public SFlowLayout() {
        this( SConstants.CENTER_ALIGN );
    }

    /**
     * Creates a new <code>SFlowLayout</code> with horizonal orientation and the 
     * given alignment and a default 5-unit horizontal and vertical gap.
     *
     * @param alignment the alignment
     */
    public SFlowLayout(int alignment) {
        this( alignment, 5, 5 );
    }
    
    /**
     * Creates a new <code>SFlowLayout</code> with horizontal orientation and the given alignment
     * and gaps
     * @param alignment the alignment
     * @param hgap the horizontal gap
     * @param vgap the vertical gap
     */
    public SFlowLayout(int alignment, int hgap, int vgap) {
        components = new ArrayList(2);
        setAlignment( alignment );
        setHgap(hgap);
        setVgap(vgap);
    }    

    /**
     * Adds the given component at given index.
     *
     * @param c          component to add
     * @param constraint is ignored in this layout manager!
     * @param index      position to add component to
     */
    public void addComponent(SComponent c, Object constraint, int index) {
        components.add(index, c);
    }

    public void removeComponent(SComponent c) {
        components.remove(c);
    }

    /**
     * returns a list of all components
     *
     * @return all components
     */
    public List getComponents() {
        return components;
    }

    /**
     * Gets the horizontal gap between components in pixel. Rendered half as margin left and margin right
     * Some PLAFs might ignore this property.
     *
     * @return the horizontal gap between components
     */
    public int getHgap() {
        return hgap;
    }

    /**
     * Sets the horizontal gap between components to the specified value in pixe. Rendered half as margin left and margin right
     * Some PLAFs might ignore this property.
     *
     * @param hgap the horizontal gap between components
     */
    public void setHgap(int hgap) {
        this.hgap = hgap;
    }

    /**
     * Gets the vertical gap between components in pixel. Rendered half as margin top and margin bottom
     * Some PLAFs might ignore this property.
     *
     * @return the vertical gap between components
     */
    public int getVgap() {
        return vgap;
    }

    /**
     * Sets the vertical gap between components to the specified value in pixel.
     * Rendered half as margin top and margin bottom. Some PLAFs might ignore this property.
     *
     * @param vgap the vertical gap between components
     */
    public void setVgap(int vgap) {
        this.vgap = vgap;
    }    
    
    /**
     * returns the component at the given position
     *
     * @param i position
     * @return component
     */
    public SComponent getComponentAt(int i) {
        return (SComponent) components.get(i);
    }

    /**
     * Sets the alignment for this layout. Possible values are
     * <ul>
     * <li>{@link org.wings.SConstants#LEFT_ALIGN}
     * <li>{@link org.wings.SConstants#CENTER_ALIGN}
     * <li>{@link org.wings.SConstants#RIGHT_ALIGN}
     * </ul>
     *
     * @param a one of the allignment values shown above
     */
    public void setAlignment(int a) {
        align = a;
    }

    /**
     * returns the alignment
     *
     * @return alignment
     */
    public int getAlignment() { return align; }
}



{'fraction_non_alphanumeric': 0.08607621223133631, 'fraction_numerical': 0.003218772713113903, 'mean_word_length': 2.220327649615513, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6948471', 'n_tokens_mistral': 2743, 'n_tokens_neox': 2635, 'n_words': 1007}