Package DisplayProject

Examples of DisplayProject.GridCell


    public Row(Component pComponent, int value) {
        super(pComponent);
        this.Row = value;
    }
    public void performAction() {
        GridCell gbc = null;
        if (this._component != null) {
            // TF:20/8/07:Adapted to use new GridField helper methods for abstraction
            gbc = GridField.getConstraints((JComponent)this._component);
            gbc.setRow( Row - 1 );
        }
    }
View Full Code Here


        Row action = ActionMgr.getAction(comp, Row.class);
        if (action != null) {
            return action.getRow();
        }
        // TF:20/8/07:Adapted to use new GridField static methods
        GridCell gbc = GridField.getConstraints(comp);
        return gbc.getRow() + 1;
    }
View Full Code Here

        target.setPreferredSize(source.isPreferredSizeSet() ? source.getPreferredSize() : null);
        target.setMinimumSize(source.isMinimumSizeSet() ? source.getMinimumSize() : null);
        target.setMaximumSize(source.isMaximumSizeSet() ? source.getMaximumSize() : null);
       
        if (source instanceof JComponent) {
          GridCell orig = GridCell.getExisting((JComponent)source);
          if (orig != null) {
            GridCell cell = GridCell.get((JComponent)target);
            cell.setWidthPolicy(orig.getWidthPolicy());
            cell.setHeightPolicy(orig.getHeightPolicy());
          }
          // TF:03/11/2008:We need to clone specific client properties too, otherwise some things won't work.
          ArrayFieldCellHelper.cloneComponentArrayParts((JComponent)source, (JComponent)target);
        }
    }
View Full Code Here

    public Column(Component pComponent, int value) {
        super(pComponent);
        this.col = value;
    }
    public void performAction() {
        GridCell gbc = null;
        if (this._component != null) {
            gbc = GridField.getConstraints((JComponent)this._component);
            gbc.setColumn(col - 1);
        }
    }
View Full Code Here

    public static int get(JComponent comp){
        Column action = ActionMgr.getAction(comp, Column.class);
        if (action != null ) {
            return ((Column)action).getColumn();
        }
        GridCell gbc = GridField.getConstraints((JComponent)comp);
        return gbc.getColumn() + 1;
    }
View Full Code Here

    public static int getWithCharacterField(CharacterField comp){
        Column action = ActionMgr.getAction((JComponent)comp, Column.class);
        if (action != null ) {
            return ((Column)action).getColumn();
        }
        GridCell gbc = GridField.getConstraints((JComponent)comp);
        return gbc.getColumn() + 1;
    }
View Full Code Here

            // CraigM:16/10/2008 - Size ourselves to our parent (the array column) so the component will be centered
            this.setHeightPolicy(Constants.SP_TO_PARENT);
            this.setWidthPolicy(Constants.SP_TO_PARENT);
            // TF:21/10/2008:Changed this to use grid cells to obey the width and height policies
            GridCell cell = new GridCell(gbc);
            if (comp instanceof JComponent) {
              GridCell oldCell = GridCell.get((JComponent)comp);
              cell.setWidthPolicy(oldCell.getWidthPolicy());
              cell.setHeightPolicy(oldCell.getHeightPolicy());
            }
            // this.add(comp, gbc);
            this.add(comp, cell);
        }
View Full Code Here

   
    public void performAction() {
      // TF:11/05/2009:Changed this to rely on the layout managers
      Set<Container> containersToValidate = new HashSet<Container>();
      JComponent thisComponent = (JComponent)this._component;
      GridCell cell = GridCell.get(thisComponent);
     
      // First, remove this component from it's old chain, if there is one.
      JComponent currentPartner = LayoutManagerHelper.getWidthPartner(thisComponent);
      if (currentPartner != null) {
        if (currentPartner == this.partner) {
          // do nothing
          return;
        }
        else {
          JComponent lastInChain = null;
          for (JComponent comp = currentPartner; comp != null && comp != thisComponent; comp = LayoutManagerHelper.getWidthPartner(comp)) {
            lastInChain = comp;
            // Also add the parent of the component to the containers needing laying out
            Container parent = comp.getParent();
            if (parent != null) {
              containersToValidate.add(parent);
            }
          }
          if (lastInChain != null) {
            // We need to set the partner of the last in the chain to the current partner, skipping this component
            LayoutManagerHelper.setWidthPartner(lastInChain, currentPartner);
          }
        }
      }
     
      // We now need to run around the partnership chain, possibly inserting this element in the chain,
      // setting all the size policies to WIDTH_PARTNER and marking all the containers to be validated
      cell.setWidthPolicy(Constants.SP_TO_PARTNER);
      LayoutManagerHelper.setWidthPartner(thisComponent, this.partner);
    JComponent lastInChain = null;
    for (JComponent comp = this.partner; comp != null && comp != thisComponent; comp = LayoutManagerHelper.getWidthPartner(comp)) {
      lastInChain = comp;
      // Also add the parent of the component to the containers needing laying out
View Full Code Here

   * In Forte, the minimum size of a button is a fraction bigger than the ones
   * in Java, so we'll adjust this here.
   */
  @Override
  public Dimension getMinimumSize() {
    GridCell cell = GridField.getConstraints(this);
    Dimension d = new Dimension();

    // If we're natural or to_parent then the minimum size is
    // the UI minimum size
    // TF:8/11/07: The above rule applies only to explicit size, not parent
    // size
    // as we can actually shrink the widget if we need to.
    if (cell.getWidthPolicy() == Constants.SP_NATURAL /*
                               * ||
                               * cell.getWidthPolicy() ==
                               * Constants.SP_TO_PARENT
                               */) {
      d.width = this.getIcon().getIconWidth();
    } else if (cell.getWidthPolicy() == Constants.SP_EXPLICIT) {
      // Must be the same as the current size
      d.width = getWidth();
    } else {
      d.width = 0;
    }
    if (cell.getHeightPolicy() == Constants.SP_NATURAL /*
                               * ||
                               * cell.getHeightPolicy() ==
                               * Constants.SP_TO_PARENT
                               */) {
      d.height = this.getIcon().getIconHeight();
    } else if (cell.getHeightPolicy() == Constants.SP_EXPLICIT) {
      // Must be the same as the current size
      d.height = getHeight();
    } else {
      d.height = 0;
    }
View Full Code Here

   * must be called PRIOR to setting the size of the image.
   *
   * @param pWidthPolicy
   */
  public void setWidthPolicy(int pWidthPolicy) {
    GridCell gbc = GridField.getConstraints(this);
    gbc.setWidthPolicy(pWidthPolicy);
    if (getParent() != null) {
      getParent().invalidate();
      getParent().validate();
    }
  }
View Full Code Here

TOP

Related Classes of DisplayProject.GridCell

Copyright © 2018 www.massapicom. 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.