Package DisplayProject.controls

Examples of DisplayProject.controls.ArrayField


            }
          }
        }
        if (comp instanceof JComponent) {
          JComponent jcomp = (JComponent)comp;
            ArrayField af = ArrayFieldCellHelper.getArrayField(jcomp);
            if (af != null) {
              // CraigM:02/07/2008 - Clean up of code to use helper class
              int col = ArrayFieldCellHelper.getArrayFieldColumn(jcomp);
                ((ArrayColumnModel)af.getColumnModel()).show(col, value);
            }

            if (comp instanceof JTabbedPane) {
                /*
                 * JTabbedPane first three kids are the tab controls and the scroll buttons
View Full Code Here


        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

            }
          }
        }
        if (comp instanceof JComponent) {
          JComponent jcomp = (JComponent)comp;
            ArrayField af = ArrayFieldCellHelper.getArrayField(jcomp);
            if (af != null) {
              // CraigM:02/07/2008 - Clean up of code to use helper class
              int col = ArrayFieldCellHelper.getArrayFieldColumn(jcomp);
                ((ArrayColumnModel)af.getColumnModel()).show(col, value);
            }

            if (comp instanceof JTabbedPane) {
                /*
                 * JTabbedPane first three kids are the tab controls and the scroll buttons
View Full Code Here

        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

            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

    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

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

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

            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

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.