Examples of ArrayField


Examples of net.helipilot50.stocktrade.displayproject.controls.ArrayField

//            if (cb.isEditable() && (!(e.getActionCommand().equals("comboBoxChanged") && e.getModifiers() > 0))) {
//                return;
//            }
           
            // TF:26/06/2008:If we're a table editor, we must commit the value first as the model hasn't updated at this point in time
            ArrayField af = ArrayFieldCellHelper.getArrayField(cb);
            if (af != null && ArrayFieldCellHelper.getArrayEditorComponent(af) == cb) {
              af.setValueAt(af.getCellEditor().getCellEditorValue(), af.getEditingRow(), af.getEditingColumn());
            }
            EventManager.startEventChain();
            FocusHelper.addSetFocusPurgeAction(cb);
            Logger.getLogger(this.getClass()).debug("ComboBox Action: " + e.getActionCommand());
            if ((e.getActionCommand() == "comboBoxChanged") ||
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.controls.ArrayField

            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

Examples of net.helipilot50.stocktrade.displayproject.controls.ArrayField

         */
        if (pParent instanceof OutlineField){
          return;
        }
        if (pParent instanceof ArrayField) {
          ArrayField table = (ArrayField)pParent;

            // TF:23/9/07:We sometimes need to post the event on the table as well. For example, consider a mouse double click
            // over a non-editable cell in a table. Forte could process the double click and send it through to the event loop,
            // but in java the renderer will not get the double click (it's not really there, after all) so the array will get
            // it. Hence we need to listen for it on the array as well
            // _installOnChild(pRoot, pParent, table, pEvent, pInstaller);
            TableColumnModel cm = table.getColumnModel();
            for (int c = 0; c < cm.getColumnCount(); c++){
                TableColumn tc = cm.getColumn(c);
                TableCellRenderer tcr = tc.getCellRenderer();

                // Handle ArrayFieldCellRenderer. CraigM 30/08/2007
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.controls.ArrayField

        if (name != null && (pName.equalsIgnoreCase(name) || pName.substring(3).equalsIgnoreCase(name))) { // extra
            return targetWidget;
        }
        if (targetWidget instanceof ArrayField) {
            ArrayField aContainer = (ArrayField) targetWidget;
            ArrayColumnModel acm = (ArrayColumnModel)aContainer.getColumnModel();
            int colCount = acm.getRealColumnCount();
            for (int i = 0; i < colCount; i++) {
                ArrayColumn ac = (ArrayColumn)acm.getRealColumn(i);
                TableCellEditor tce = ac.getCellEditor();
                JComponent comp = (JComponent)tce.getTableCellEditorComponent(aContainer, null, true, -1, -1);
                if (comp == null) { // then find the cell renderer
                    ArrayFieldCellRenderer afcr = (ArrayFieldCellRenderer) ac
                            .getCellRenderer();
                    comp = (JComponent) afcr.getTableCellRendererComponent(
                            aContainer, null, false, true, -1, -1);
                    comp = (JComponent) comp.getComponent(0);
                    String compName = (comp == null) ? "" : comp.getName();
                    if (compName.endsWith(pName)) {
                        return comp;
                    }
                } else if (comp instanceof EditorLayoutPanel
                        && comp.getComponent(0) != null) {
                    comp = (JComponent) comp.getComponent(0);
                }
                String compName = (comp == null) ? "" : comp.getName();
                if (compName.endsWith(pName)) {
                    return comp;
                }
            }
        } else if (targetWidget instanceof Container) {
            Container aContainer = (Container) targetWidget;
            Component[] children = aContainer.getComponents();
            for (int i = 0; i < children.length; i++) {
                Component result = UIutils._getFieldByName(pName, children[i]);
                if (result != null) {
                    return result;
                }
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.controls.ArrayField

      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

Examples of net.helipilot50.stocktrade.displayproject.controls.ArrayField

      while (comp != null) {

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

Examples of net.helipilot50.stocktrade.displayproject.controls.ArrayField

            this._component.setSize(width, this._component.getHeight());
            this._component.setMinimumSize(new Dimension(width, minSize.height));
            this._component.setPreferredSize(new Dimension(width, minSize.height));

            // CraigM:16/06/2008 - Update the column model if we are in an array field
            ArrayField af = ArrayFieldCellHelper.getArrayField(this._component);

            if (af != null) {
              int col = ArrayFieldCellHelper.getArrayFieldColumn(this._component);
              ArrayColumn tc = (ArrayColumn)af.getColumnModel().getColumn(col);
              tc.setWidth(width);
              tc.setMinWidth(width);
              tc.setPreferredWidth(width);
              tc.setAssignedWidth(width);
            }
View Full Code Here

Examples of net.helipilot50.stocktrade.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

Examples of net.helipilot50.stocktrade.displayproject.controls.ArrayField

            }
        }
       
        // 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

Examples of net.helipilot50.stocktrade.displayproject.controls.ArrayField

        Parent action = (Parent) ActionMgr.getAction(comp, Parent.class);
        if (action != null)
            return (JComponent) action.parent;
        else {
            Container p;
            ArrayField af = ArrayFieldCellHelper.getArrayField(comp);
           
            // If the component is contained in an ArrayField, then the ArrayField is the parent.  CraigM: 27/03/2008.
            // TF:27/10/2008:Changed this logic to return the array field as the parent only if there is no real
            // parent, to cater for grids within array fields.
            p = comp.getParent();
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.