001    package org.LiveGraph.gui;
002    
003    import java.awt.GridBagConstraints;
004    import java.awt.Insets;
005    
006    
007    /**
008     * Provides some convenience methods and convenience classes.
009     * 
010     * <p style="font-size:smaller;">This product includes software developed by the
011     *    <strong>LiveGraph</strong> project and its contributors.<br />
012     *    (<a href="http://www.live-graph.org" target="_blank">http://www.live-graph.org</a>)<br />
013     *    Copyright (c) 2007 G. Paperin.<br />
014     *    All rights reserved.
015     * </p>
016     * <p style="font-size:smaller;">File: FrameWithTools.java</p> 
017     * <p style="font-size:smaller;">Redistribution and use in source and binary forms, with or
018     *    without modification, are permitted provided that the following terms and conditions are met:
019     * </p>
020     * <p style="font-size:smaller;">1. Redistributions of source code must retain the above
021     *    acknowledgement of the LiveGraph project and its web-site, the above copyright notice,
022     *    this list of conditions and the following disclaimer.<br />
023     *    2. Redistributions in binary form must reproduce the above acknowledgement of the
024     *    LiveGraph project and its web-site, the above copyright notice, this list of conditions
025     *    and the following disclaimer in the documentation and/or other materials provided with
026     *    the distribution.<br />
027     *    3. All advertising materials mentioning features or use of this software or any derived
028     *    software must display the following acknowledgement:<br />
029     *    <em>This product includes software developed by the LiveGraph project and its
030     *    contributors.<br />(http://www.live-graph.org)</em><br />
031     *    4. All advertising materials distributed in form of HTML pages or any other technology
032     *    permitting active hyper-links that mention features or use of this software or any
033     *    derived software must display the acknowledgment specified in condition 3 of this
034     *    agreement, and in addition, include a visible and working hyper-link to the LiveGraph
035     *    homepage (http://www.live-graph.org).
036     * </p>
037     * <p style="font-size:smaller;">THIS SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY
038     *    OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
039     *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT SHALL
040     *    THE AUTHORS, CONTRIBUTORS OR COPYRIGHT  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
041     *    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING  FROM, OUT OF OR
042     *    IN CONNECTION WITH THE SOFTWARE OR THE USE OR  OTHER DEALINGS IN THE SOFTWARE.
043     * </p>
044     * 
045     * @author Greg Paperin (<a href="http://www.paperin.org" target="_blank">http://www.paperin.org</a>)
046     * @version {@value org.LiveGraph.LiveGraph#version}
047     */
048    public class Tools {
049    
050    
051    /**
052     * Creates a {@code GridBagConstraints} object with the specified size and default attributes.
053     * @param x Grid X. 
054     * @param y Grid Y.
055     * @param w Grid width.
056     * @param h Grid height.
057     * @return A {@code GridBagConstraints} object with the specified size and default attributes
058     */
059    public static GridBagConstraints createGridBagConstraints(int x, int y, int w, int h) {
060            GridBagConstraints gbc = new GridBagConstraints(x, y, w, h, 0, 0,
061                                                                                                            GridBagConstraints.WEST,
062                                                                                                            //GridBagConstraints.NONE,
063                                                                                                            GridBagConstraints.BOTH,
064                                                                                                            new Insets(2, 2, 2, 2),
065                                                                                                            0, 0);
066            return gbc;     
067    }
068    
069    } // public class Tools