Package DisplayProject

Examples of DisplayProject.GridCell


    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

        super(pComponent);
        this.Gravity = value;
    }
    public void performAction() {
        if (this._component != null) {
          GridCell gbc = GridField.getConstraints((JComponent)this._component);
            gbc.setCellGravity(Gravity);
        }
    }
View Full Code Here

    public static int get(JComponent comp){
        FieldWidgetGravity action = ActionMgr.getAction(comp, FieldWidgetGravity.class);
        if (action != null) {
            return action.getGravity();
        }
        GridCell gbc = GridField.getConstraints((JComponent)comp);
        return gbc.getCellGravity();
    }
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

    public LeftMargin(Component pComponent, int value) {
        super(pComponent);
        this.margin = value;
    }
    public void performAction() {
        GridCell gbc = null;
        if (this._component != null) {
            gbc = GridField.getConstraints((JComponent)this._component);
            gbc.setLeftMargin(UIutils.milsToPixels(margin));
        }
    }
View Full Code Here

    public static int get(JComponent comp){
        LeftMargin action = ActionMgr.getAction(comp, LeftMargin.class);
        if (action != null) {
            return action.margin;
        }
        GridCell gbc = GridField.getConstraints(comp);
        return UIutils.pixelsToMils(gbc.getLeftMargin());
    }
View Full Code Here

        JComponent comp = (JComponent)this._component;
        // TF:28/04/2008:Removed this code as we now handle this like Forte seemed to -- if it's explicitly set, use the explicit value
//        if (comp.getLayout() instanceof WindowFormLayout) {
//            return;
//        }
        GridCell gbc = GridField.getConstraints((JComponent)this._component);
        gbc.setHeightPolicy(policy);
        if (comp.getParent() != null) {
            comp.getParent().invalidate();
            comp.getParent().validate();
        }
    }
View Full Code Here

                comp.setForeground(this.fgColor);
            }
        }
        this.gbc.fill = ArrayFieldCellHelper.getGBCFill(comp);
        // TF:21/10/2008:Changed this to use grid cells to obey the width and height policies
        GridCell cell = new GridCell(this.gbc);
        if (comp instanceof JComponent) {
          GridCell oldCell = GridCell.get((JComponent)comp);
          cell.setWidthPolicy(oldCell.getWidthPolicy());
          cell.setHeightPolicy(oldCell.getHeightPolicy());
        }
        // this.panelWrapper.add(comp, this.gbc);
        this.panelWrapper.add(comp, cell);

      // CraigM:16/10/2008 - Check the array column is wide enough to fit us
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.