Class GridC

java.lang.Object
java.awt.GridBagConstraints
com.moneydance.awt.GridC
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class GridC
extends java.awt.GridBagConstraints
A class that makes building GridBagConstraints objects easy, efficient and readable for layout out GUI elements using the GridBagLayout layout manager To use this, call GridC.getc() and then call any of the methods below on the result in order to set different attributes for the component that is being laid out. For example:
     JPanel p = new JPanel(new GridBagLayout());
     p.add(myLabel, GridC.getc(0,0).east());
     p.add(myField, GridC.getc(1,0).wx(1).fillx().colspan(2));
     p.add(myLabel2, GridC.getc(0,1).east());
     p.add(myField2, GridC.getc(1,1).wx(1).fillx());
     p.add(myButton2, GridC.getc(1,2));
  
See Also:
Serialized Form
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static int BOTTOM_FIELD_INSET  
    static int BOTTOM_LABEL_INSET  
    static int LEFT_FIELD_INSET  
    static int LEFT_LABEL_INSET  
    static int RIGHT_FIELD_INSET  
    static int RIGHT_LABEL_INSET  
    static int TOP_FIELD_INSET  
    static int TOP_LABEL_INSET  

    Fields inherited from class java.awt.GridBagConstraints

    ABOVE_BASELINE, ABOVE_BASELINE_LEADING, ABOVE_BASELINE_TRAILING, anchor, BASELINE, BASELINE_LEADING, BASELINE_TRAILING, BELOW_BASELINE, BELOW_BASELINE_LEADING, BELOW_BASELINE_TRAILING, BOTH, CENTER, EAST, fill, FIRST_LINE_END, FIRST_LINE_START, gridheight, gridwidth, gridx, gridy, HORIZONTAL, insets, ipadx, ipady, LAST_LINE_END, LAST_LINE_START, LINE_END, LINE_START, NONE, NORTH, NORTHEAST, NORTHWEST, PAGE_END, PAGE_START, RELATIVE, REMAINDER, SOUTH, SOUTHEAST, SOUTHWEST, VERTICAL, weightx, weighty, WEST
  • Constructor Summary

    Constructors 
    Constructor Description
    GridC()  
  • Method Summary

    Modifier and Type Method Description
    GridC bottomInset​(int newBottomInset)
    Set the bottom edge inset
    GridC center()
    Anchor the component to the center (the default)
    GridC colspan​(int numColumns)
    Set the gridwidth: number of columns to span.
    GridC copy()
    Return a clone of this object that can be stored for later use
    GridC east()
    Anchor the component to the east
    GridC field()
    Shortcut for the constraints associated with a field in a standard dialog
    GridC fillboth()
    Set the fill type to both horizontal and vertical
    GridC fillnone()
    Set the fill type to no filling (the default)
    GridC fillx()
    Set the fill type to horizontal
    GridC filly()
    Set the fill type to vertical
    static GridC getc()
    Reset and return the singleton GridC instance
    static GridC getc​(int x, int y)
    Reset and return the singleton GridC instance, with x and y initialized to the given values.
    GridC insets​(int top, int left, int bottom, int right)
    Set the insets
    GridC label()
    Shortcut for the settings associated with a label in a standard dialog
    GridC leftInset​(int newLeftInset)
    Set the left edge inset
    GridC north()
    Anchor the component to the north
    GridC northEast()
    Anchor the component to the northeast
    GridC northWest()
    Anchor the component to the northwest
    GridC padx​(int xPadding)
    Set the internal padding along the X axis
    GridC pady​(int yPadding)
    Set the internal padding along the Y axis
    GridC reset()
    Reset all of the constraints to the default value and return ourself.
    GridC rightInset​(int newRightInset)
    Set the right edge inset
    GridC rowspan​(int numRows)
    Set the gridheight: number of rows to span.
    GridC south()
    Anchor the component to the south
    GridC southEast()
    Anchor the component to the southeast
    GridC southWest()
    Anchor the component to the southwest
    GridC topInset​(int newTopInset)
    Set the top edge inset
    GridC west()
    Anchor the component to the west
    GridC wx​(float xWeight)
    Set our weightx value and return self
    GridC wxy​(float xWeight, float yWeight)
    Set our weightx and weighty value and return self
    GridC wy​(float yWeight)
    Set our weighty value and return self
    GridC x​(int x)
    Set our gridx value and return self
    GridC xy​(int x, int y)
    Set both the gridx and gridy values and return self
    GridC y​(int y)
    Set our gridx value and return self

    Methods inherited from class java.awt.GridBagConstraints

    clone

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • getc

      public static final GridC getc()
      Reset and return the singleton GridC instance
    • getc

      public static final GridC getc​(int x, int y)
      Reset and return the singleton GridC instance, with x and y initialized to the given values. This is a shortcut to GridC.getc().xy(x,y)
    • reset

      public GridC reset()
      Reset all of the constraints to the default value and return ourself.
    • x

      public GridC x​(int x)
      Set our gridx value and return self
    • y

      public GridC y​(int y)
      Set our gridx value and return self
    • xy

      public GridC xy​(int x, int y)
      Set both the gridx and gridy values and return self
    • wx

      public GridC wx​(float xWeight)
      Set our weightx value and return self
    • wy

      public GridC wy​(float yWeight)
      Set our weighty value and return self
    • wxy

      public GridC wxy​(float xWeight, float yWeight)
      Set our weightx and weighty value and return self
    • colspan

      public GridC colspan​(int numColumns)
      Set the gridwidth: number of columns to span.
    • rowspan

      public GridC rowspan​(int numRows)
      Set the gridheight: number of rows to span.
    • fillx

      public GridC fillx()
      Set the fill type to horizontal
    • filly

      public GridC filly()
      Set the fill type to vertical
    • fillboth

      public GridC fillboth()
      Set the fill type to both horizontal and vertical
    • fillnone

      public GridC fillnone()
      Set the fill type to no filling (the default)
    • insets

      public GridC insets​(int top, int left, int bottom, int right)
      Set the insets
    • east

      public GridC east()
      Anchor the component to the east
    • west

      public GridC west()
      Anchor the component to the west
    • north

      public GridC north()
      Anchor the component to the north
    • south

      public GridC south()
      Anchor the component to the south
    • northEast

      public GridC northEast()
      Anchor the component to the northeast
    • northWest

      public GridC northWest()
      Anchor the component to the northwest
    • southEast

      public GridC southEast()
      Anchor the component to the southeast
    • southWest

      public GridC southWest()
      Anchor the component to the southwest
    • center

      public GridC center()
      Anchor the component to the center (the default)
    • padx

      public GridC padx​(int xPadding)
      Set the internal padding along the X axis
    • pady

      public GridC pady​(int yPadding)
      Set the internal padding along the Y axis
    • label

      public GridC label()
      Shortcut for the settings associated with a label in a standard dialog
    • field

      public GridC field()
      Shortcut for the constraints associated with a field in a standard dialog
    • copy

      public GridC copy()
      Return a clone of this object that can be stored for later use
    • topInset

      public GridC topInset​(int newTopInset)
      Set the top edge inset
      Since:
      Moneydance build 1515
    • leftInset

      public GridC leftInset​(int newLeftInset)
      Set the left edge inset
      Since:
      Moneydance build 1515
    • bottomInset

      public GridC bottomInset​(int newBottomInset)
      Set the bottom edge inset
      Since:
      Moneydance build 1515
    • rightInset

      public GridC rightInset​(int newRightInset)
      Set the right edge inset
      Since:
      Moneydance build 1515