Examples of GridFieldLayout

  • net.helipilot50.stocktrade.displayproject.GridFieldLayout
    This layout manager simulates the Forte GridField layout rules. It is similar in nature to a GridBagLayout but with extra features.

    For example: (this is not a comprehensive list)

  • Grid fields will expand their size if they are too large to accomodate the minimum sizes of their children
  • Grid fields can be titles and borders
  • Lines between cells in grid fields can be displayed by setting attributes
  • Grid fields have an "insertPolicy" property which dictates how to behave if multiple widgets are added into the same cell. For example, it can ignore the new widget, replace the old widget or expand the grid to cater for this new widget

    When a child is added to a grid field, it must be passed with contstraints. These constraints can either be a GridBagConstraints instance, or a GridCell instance. If passed a GridBagConstraints, the meaning is similar to that used for GridBagLayout. There are some differences though:

  • If the sum of the weights in a GridBagLayout row or colum is zero, all additional space for that column is given to the containing GridBag. In a GridField, this extra space is given to the child widgets in equal portions, similar to setting all the weights to 1.
  • GridBagLayouts allow different weights for the same column, resulting in undefined behaviour. In a GridField, weights are stored at the container (GridField) level, so each row or column has a weight assigned to it. If passed a GridBagLayout class with the weightx or weighty property set, this new weight is assumed to be the weight for the whole column and will replace any existing weight.
  • GridField children cannot span cells in a GridField (ie they must occupy exactly one cell) so the gridwidth and gridheight properties are ignored.
  • The row and column attributes must be set to an explicit value, RELATIVE cannot be used.

    NB: This class extends GridBagLayout ONLY to aid the visual editors in rendering the class No inherited functionality is used. @author Tim


  • Examples of DisplayProject.GridFieldLayout

        public ArrayFieldCellRenderer(TableCellRenderer pRenderer) {
            this.defaultRenderer = pRenderer;
            this.panelWrapper = new GridField(); // CraigM:15/10/2008 - Switched from being a JPanel to a GridField.
            this.panelWrapper.setOpaque(false);
            this.panelWrapper.setLayout(new GridFieldLayout());
            this.panelWrapper.setHeightPolicy(Constants.SP_TO_PARENT);
            this.panelWrapper.setWidthPolicy(Constants.SP_TO_PARENT);
            this.panelWrapper.setCellGravity(Constants.CG_CENTER);
            this.gbc = new GridBagConstraints();
            this.gbc.gridx = 0;
    View Full Code Here

    Examples of DisplayProject.GridFieldLayout

        public static class EditorLayoutPanel extends GridField {
            private Component comp;
            public EditorLayoutPanel(Component pComp) {
                comp = pComp;
                this.setOpaque(false);
                this.setLayout(new GridFieldLayout()); // CraigM:16/10/2008 - Set the layout for a GridField
                GridBagConstraints gbc = new GridBagConstraints();
                gbc.gridx = 0;
                gbc.gridy = 0;
                gbc.weightx = 1;
                gbc.weighty = 1;
    View Full Code Here

    Examples of DisplayProject.GridFieldLayout

        public ArrayFieldCellRenderer(TableCellRenderer pRenderer) {
            this.defaultRenderer = pRenderer;
            this.panelWrapper = new GridField(); // CraigM:15/10/2008 - Switched from being a JPanel to a GridField.
            this.panelWrapper.setOpaque(false);
            this.panelWrapper.setLayout(new GridFieldLayout());
            this.panelWrapper.setHeightPolicy(Constants.SP_TO_PARENT);
            this.panelWrapper.setWidthPolicy(Constants.SP_TO_PARENT);
            this.panelWrapper.setCellGravity(Constants.CG_CENTER);
            this.gbc = new GridBagConstraints();
            this.gbc.gridx = 0;
    View Full Code Here

    Examples of DisplayProject.GridFieldLayout

        public static class EditorLayoutPanel extends GridField {
            private Component comp;
            public EditorLayoutPanel(Component pComp) {
                comp = pComp;
                this.setOpaque(false);
                this.setLayout(new GridFieldLayout()); // CraigM:16/10/2008 - Set the layout for a GridField
                GridBagConstraints gbc = new GridBagConstraints();
                gbc.gridx = 0;
                gbc.gridy = 0;
                gbc.weightx = 1;
                gbc.weighty = 1;
    View Full Code Here

    Examples of net.helipilot50.stocktrade.displayproject.GridFieldLayout

        public static class EditorLayoutPanel extends GridField {
            private Component comp;
            public EditorLayoutPanel(Component pComp) {
                comp = pComp;
                this.setOpaque(false);
                this.setLayout(new GridFieldLayout()); // CraigM:16/10/2008 - Set the layout for a GridField
                GridBagConstraints gbc = new GridBagConstraints();
                gbc.gridx = 0;
                gbc.gridy = 0;
                gbc.weightx = 1;
                gbc.weighty = 1;
    View Full Code Here

    Examples of net.helipilot50.stocktrade.displayproject.GridFieldLayout

        public ArrayFieldCellRenderer(TableCellRenderer pRenderer) {
            this.defaultRenderer = pRenderer;
            this.panelWrapper = new GridField(); // CraigM:15/10/2008 - Switched from being a JPanel to a GridField.
            this.panelWrapper.setOpaque(false);
            this.panelWrapper.setLayout(new GridFieldLayout());
            this.panelWrapper.setHeightPolicy(Constants.SP_TO_PARENT);
            this.panelWrapper.setWidthPolicy(Constants.SP_TO_PARENT);
            this.panelWrapper.setCellGravity(Constants.CG_CENTER);
            this.gbc = new GridBagConstraints();
            this.gbc.gridx = 0;
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. All rights reserved.
    All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.