Package DisplayProject.controls

Examples of DisplayProject.controls.ArrayField


            processComponent(c, state);
          }
        }
        else if (comp instanceof ArrayField) {
          // TF:13/10/2009:Get our columns and process them as well
          ArrayField af = (ArrayField)comp;
          ArrayColumnModel model = (ArrayColumnModel)af.getColumnModel();
          for (int i = 0; i < model.getRealColumnCount(); i++) {
            ArrayColumn column = model.getRealColumn(i);
            Component childComp = column.getComponent();
            if (childComp != null) {
              // TF:29/10/2009:DET-123:Changed this to use processComponent to take into account the state of the child component.
View Full Code Here


            }
        }
       
        // CraigM:19/06/2008 - If we are disabling or enabling the component in an array field, we also need to enable/disable the array column
        if (ArrayFieldCellHelper.getArrayField(comp) != null) {
          ArrayField af = ArrayFieldCellHelper.getArrayField(comp);
          int col = ArrayFieldCellHelper.getArrayFieldColumn(comp);

          // CraigM:18/10/2008 - Don't switch the array column if we are modifying components inside a grid field in the array field
          if (ArrayFieldCellHelper.isInGridFieldInArrayField(comp) == false) {
            // TF:13/10/2009:Corrected this to set our column state also based on the state of the array field.
            int worstState = getWorstState(af, state);
            boolean isEditable = (worstState == Constants.FS_UPDATE || worstState == Constants.FS_VIEWONLY || worstState == Constants.FS_SELECTONLY);
            // CraigM:22/08/2008 - Fixed to use real column
            ((ArrayColumn)((ArrayColumnModel)af.getColumnModel()).getRealColumn(col)).setEditable(isEditable);
          }
        }
    }
View Full Code Here

        // --------------------------------------------------------------------
        // Expand array fields
        // --------------------------------------------------------------------
        if (comp instanceof ArrayField) {
            ArrayField af = (ArrayField)comp;
            af.setVisibleRows(af.getRowCount());

            if (removeScrollBars) {
                ((JScrollPane)af.getParent().getParent()).setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
                ((JScrollPane)af.getParent().getParent()).setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
            }
           
            // Expand any text fields that are in the array field
            for (int i=0; i<af.getColumnCount(); i++) {
              TableCellRenderer cellRenderer = af.getCellRenderer(0, i);
             
              if (cellRenderer instanceof ArrayFieldCellRenderer &&
                  ((ArrayFieldCellRenderer)cellRenderer).getRenderer() instanceof TextFieldCellRenderer) {
                ((TextFieldCellRenderer)((ArrayFieldCellRenderer)cellRenderer).getRenderer()).setPrinting(removeScrollBars);
              }
            }
           
            Container parent = af.getParent();

            while (parent != null) {
                if (parent instanceof JFrame) {
                    ((JFrame)parent).validate();
                    ((JFrame)parent).pack();
View Full Code Here

     * @param name name of the field
     * @param rowHeight height of the rows in pixels
     * @param headerFontStyle the font style of the column header e.g. Font.PLAIN
     */
    public static ArrayField newArrayField(String name, int rowHeight, int headerFontStyle){
        ArrayField jt = new ArrayField(name, rowHeight, headerFontStyle);

        return jt;
    }
View Full Code Here

        if (action != null) {
            value = ((TableRow)action).getRow();
        } else if (comp instanceof ArrayField
            && !SwingUtilities.isEventDispatchThread()) { // DK:31/12/2008:use getRowForEvents() only if we currently not in EDT thread

            ArrayField table = (ArrayField)comp;
            //value = table.getSelectedRow() + 1;
            // TF: 30/9/07: We need to wait for the EDT to become idle... See the comments associated with this method and ArrayField if you don't know why...
            UIutils.waitForEDTToBeIdle();

            // TF:11/10/07:Created a new method to return the real current row at the point in time this code is executing.
            //value = table.getCurrentRow() + 1; // CraigM 24/08/2007
            value = table.getRowForEvents() + 1;

        } else {
            value = comp.getSelectedRow() + 1;
        }
        return value;
View Full Code Here

  @Override
  // ITC_CONV:Start:TF:25-Mar-08:Handle SkipOnTab focus traversal
  public Component getComponentAfter(Container aContainer, Component aComponent) {

    // Traversing out of an ArrayField is handled via code inside the ArrayField. CraigM 29/08/2007.
    ArrayField af = ArrayFieldCellHelper.getArrayField(aComponent);
    if (af != null && isSwingDisplayerIgnoreArrayField() == false) {
      return af; // Stay in the ArrayField
    }
    Component result = super.getComponentAfter(aContainer, aComponent);
    while (result instanceof JComponent && SkipOnTab.get((JComponent)result)) {
View Full Code Here

      if (WidgetState.getWorstState(focusOwner) == Constants.FS_UPDATE) {
        // TF:7/4/08: If the component which has focus is currently a table cell editor then
        // we need to ensure that the value has been committed to the underlying model. Otherwise accelerators
        // will still have the wrong value since we haven't processed the focus loss event.
        if (focusOwner instanceof JTextComponent) {
          ArrayField table = ArrayFieldCellHelper.getArrayField(focusOwner);
          if (table != null) {
            if (ArrayFieldCellHelper.getArrayEditorComponent(table) == focusOwner) {
              // TF:08/06/2008:LIB-17:If this is a formatted field, we must use the getValue method,
              // otherwise we will potentially have formatting errors on masked fields.
              if (focusOwner instanceof JFormattedTextField) {
                JFormattedTextField formattedField = (JFormattedTextField)focusOwner;
                try {
                  formattedField.commitEdit();
                  //GK/DK: convert column index to a model index to set value
                  table.setValueAt(formattedField.getValue(), table.getEditingRow(), table.getEditingColumn());
                }
                catch (ParseException e) {
                  _log.error("Unhandled parse exception committing field edit: ", e);
                }
              }
              else if (focusOwner instanceof JPasswordField) {
                table.setValueAt(new String(((JPasswordField)focusOwner).getPassword()), table.getEditingRow(), table.getEditingColumn());
              }
              else {
                table.setValueAt(((JTextComponent)focusOwner).getText(), table.getEditingRow(), table.getEditingColumn());
              }
            }
          }
        }
        if (focusOwner instanceof DataField) {
View Full Code Here

      while (comp != null) {

        /*
         * ArrayField
         */
        ArrayField af = ArrayFieldCellHelper.getArrayField(comp);
        if (af != null) {
          s.push(new ArrayFieldFocus(af));
        }
        /*
         * TabFolder
 
View Full Code Here

    public Array_Of_BusinessClass<BusinessClass> getData() {
        return this.data;
    }

    public void setField(ArrayField field) {
        ArrayField oldValue = this.field;
        this.field = field;
        this.qq_Listeners.firePropertyChange("field", oldValue, this.field);
    }
View Full Code Here

            params = new Hashtable<String, Object>();
        }
        params.put("child", new ParameterHolder(pChild));

        // TF:27/9/07:Revamped this logic as our renderers are now in panels.
        ArrayField owningArray = ArrayFieldCellHelper.getArrayField(pChild);
        int row = 0;
        int column = 0;
        // Extract the X and Y co-ordinate from the event which may be in array coordinates
        ParameterHolder pX = (ParameterHolder)params.get("x");
        ParameterHolder pY = (ParameterHolder)params.get("y");

        /*
         * There are 2 cases when considering children events of array fields:
         * 1) The component cell renderer/editor is attached to the array field as a child. This is typically when the
         *     editor is active. In this case the click we get is in the coordinate space of the child, but the row
         *     and column are not set properly. We can map the coordinate space of the child to the coordinate space
         *     of the array and then determine the row and column from there.
         *
         * 2) The component cell renderer/editor is not attached to the array field. In this case, the component will
         *     have a client property set which refers to the array and the location is in the coordinate space of the
         *     array. We can use this to determine the row and column and then map the coordinate down to the
         *     coordinate space of the child.
         */
        while (mum != null){
            if (mum == owningArray) {
                if (pX != null && pY != null) {
                    // We are a direct child of the table, remap the coordinate space to the array to get the row and column
                    Point p = new Point(UIutils.milsToPixels(pX.getInt()), UIutils.milsToPixels(pY.getInt()));
                    Point arrayPoint = SwingUtilities.convertPoint(pChild, p, mum);
                    row = owningArray.rowAtPoint(arrayPoint);
                    column = owningArray.columnAtPoint(arrayPoint);
                    // Store the real row and column in the array. This isn't actually done in Forte, but makes life
                    // much easier if we want to determine which cell generated the click.
                    params.put( "row", new ParameterHolder(row+1) );
                    params.put( "column", new ParameterHolder(column+1) );
                }
                owningArray = null;
            }
            pList.add(new EventHandle(mum, pEventName, params));
            // TF:18/06/2008:Fixed this so menus work properly
            if (mum instanceof JPopupMenu)
                mum = (Container)((JPopupMenu)mum).getInvoker();
            else
                mum = mum.getParent();
        }

        if (owningArray != null) {
            // Now the X and Y coordinates are in the array space, we need to translate them to the child coordinate space and get
            // the correct row and column
            if (pX != null && pY != null) {
                Point p = new Point(UIutils.milsToPixels(pX.getInt()), UIutils.milsToPixels(pY.getInt()));
                row = owningArray.rowAtPoint(p);
                column = owningArray.columnAtPoint(p);
                // Store the real row and column in the array. This isn't actually done in Forte, but makes life
                // much easier if we want to determine which cell generated the click.
                params.put( "row", new ParameterHolder(row+1) );
                params.put( "column", new ParameterHolder(column+1) );

                Rectangle r = owningArray.getCellRect(row, column, false);
                p.x -= r.x;
                p.y -= r.y;
                // Now X and Y are in owningArray coordinate space, need to translate them into pChild's
//              Point childLoc = SwingUtilities.convertPoint(owningArray, p, pChild);
                Point childLoc = p;
View Full Code Here

TOP

Related Classes of DisplayProject.controls.ArrayField

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.