Package net.helipilot50.stocktrade.displayproject

Examples of net.helipilot50.stocktrade.displayproject.ArrayColumn


        } else { // must be a JTable
            JTable table = (JTable)target;
            colModel = table.getColumnModel();
        }
        for (int col = 0; col < colModel.getColumnCount(); col ++){
            ArrayColumn ac = (ArrayColumn)colModel.getColumn(col);
            DefaultTableCellRenderer cr = (DefaultTableCellRenderer)ac.getHeaderRenderer();
            if (cr == null){
                cr = new DefaultTableCellRenderer();
                cr.setText(" ");
            }
            GridBagConstraints gbc = new GridBagConstraints();
View Full Code Here


        } else {
            c = this.newColour;
        }

        // TF:22/11/07:If this component is a template for an array column, get the array column first
        ArrayColumn column = this.column;
        JTable t = ArrayFieldCellHelper.getArrayField(this._component);
        if (t != null) {
            int col = ArrayFieldCellHelper.getArrayFieldColumn((JComponent)this._component);
            ArrayColumnModel model = (ArrayColumnModel) t.getColumnModel();
            column = (ArrayColumn)model.getRealColumn(col);
        }

        switch (this.colourType) {
        case cBACKGROUND:
            if (column != null) {
                //PM:22/11/07 fixed case for new cell renderers/editors
                if (column.getCellEditor() instanceof ArrayFieldCellEditor){
                    ((ArrayFieldCellEditor)column.getCellEditor()).setBackground(c);
                    ((ArrayFieldCellRenderer)column.getCellRenderer()).setBackground(c);
                }else {
                    ((JComponent)column.getCellEditor()).setBackground(c);
                    ((JComponent)column.getCellRenderer()).setBackground(c);
                }
            }
       
            // TF:02/12/2009:Even if we are affecting something that is a table column template,
            // we must still affect the underlying component. Failure to do this means that if
            // the renderer or editor derives the colour to paint the component from the original
            // template (as it should) then this won't be set. This is particularly prevalent
            // in say fill-in fields that are on unused rows in array fields.
            // Owing to the risk involved in this change, removing the else { ... } around this
            // section of code has only been done for the background colour, not the foreground colour
            /*
             * this is a special case for DataFields
             * TF:8/11/07:Added in the check for using the colour index
             */
            if (((comp instanceof JTextComponent) || (comp instanceof JComboBox))
                    && (this.forteColour == Constants.C_DEFAULT) && useColourIndex) {
                c = Color.WHITE;
            }
            if (comp instanceof ListView) {
                c = Color.WHITE;
            }
            if (comp instanceof JTree) {
                comp.getParent().getParent().setBackground(c);
            }
            if (comp != null) {
              comp.setBackground(c);
            }
            if (innerComp != null) {
                innerComp.setBackground(c);
            }
            break;
        case cFOREGROUND:
          // TF:13/08/2010:Changed this to be the underlying column, using the getRealColumn call above.
            if (column != null) {
                //PM:22/11/07 fixed case for new cell renderers/editors
                if (column.getCellEditor() instanceof ArrayFieldCellEditor){
                    ((ArrayFieldCellEditor)column.getCellEditor()).setForeground(c);
                    ((ArrayFieldCellRenderer)column.getCellRenderer()).setForeground(c);
                }else {
                    ((JComponent)column.getCellEditor()).setForeground(c);
                    ((JComponent)column.getCellRenderer()).setForeground(c);
                }
            } else if (comp instanceof DataField){
                comp.setForeground(c);
                ((DataField)comp).setDisabledTextColor(c);
            } else {
View Full Code Here

        super(table);
        this.column = column;
    }

    public void performAction() {
        ArrayColumn ac = (ArrayColumn)((ArrayColumnModel)((JTable)this._component).getColumnModel()).getColumn(column -1);
        ((JTable)this._component).getColumnModel().removeColumn(ac);
    }
View Full Code Here

              af = ArrayFieldCellHelper.getArrayField(component);
            }
            if (af != null) {
                int col = ArrayFieldCellHelper.getArrayFieldColumn((JComponent)component);
                //PM:23/11/07 correct for invisible columns
                ArrayColumn ac = (ArrayColumn)((ArrayColumnModel)af.getColumnModel()).getRealColumn(col);
                col = ((ArrayColumnModel)af.getColumnModel()).getColumnIndex(ac.getIdentifier());

                // If an explicit focus request occurs on an empty array field that allows append, then create
                // a new row (that's what Forte did).  CraigM 16/10/2007.
                if (af.getRowCount() == 0 && af.isAllowsAppend()) {
                    af.appendRow(col);
View Full Code Here

            qq_CustomerGrid_HoldingList.setVisibleRows(5);

            //  === Column model setup ===

            // StockName converted from qqds_DataField
            ArrayColumn qq_CustomerGrid_HoldingListArray_StockName_Column = new ArrayColumn("StockName", 0, new FormattedCellRenderer(getqq_CustomerGrid_HoldingListArray_StockName()), new FormattedCellEditor(getqq_CustomerGrid_HoldingListArray_StockName()), true);
            qq_CustomerGrid_HoldingListArray_StockName_Column.setHeaderValue("StockName");
            qq_CustomerGrid_HoldingListArray_StockName_Column.setVisible(true);
            qq_CustomerGrid_HoldingList.addColumn(qq_CustomerGrid_HoldingListArray_StockName_Column);

            // Quantity converted from qqds_DataField
            ArrayColumn qq_CustomerGrid_HoldingListArray_Quantity_Column = new ArrayColumn("Quantity", 1, new FormattedCellRenderer(getqq_CustomerGrid_HoldingListArray_Quantity()), new FormattedCellEditor(getqq_CustomerGrid_HoldingListArray_Quantity()), true);
            qq_CustomerGrid_HoldingListArray_Quantity_Column.setHeaderValue("Quantity");
            qq_CustomerGrid_HoldingListArray_Quantity_Column.setVisible(true);
            qq_CustomerGrid_HoldingList.addColumn(qq_CustomerGrid_HoldingListArray_Quantity_Column);

            // Price converted from qqds_DataField
            ArrayColumn qq_CustomerGrid_HoldingListArray_Price_Column = new ArrayColumn("Price", 2, new FormattedCellRenderer(getqq_CustomerGrid_HoldingListArray_Price()), new FormattedCellEditor(getqq_CustomerGrid_HoldingListArray_Price()), true);
            qq_CustomerGrid_HoldingListArray_Price_Column.setHeaderValue("Price");
            qq_CustomerGrid_HoldingListArray_Price_Column.setVisible(true);
            qq_CustomerGrid_HoldingList.addColumn(qq_CustomerGrid_HoldingListArray_Price_Column);

            //  === End column model ===

            TableFactory.postModelArrayField(qq_CustomerGrid_HoldingList);
View Full Code Here

        CloneHelper.cloneClientProperties(source, target);
        return target;
    }

    public static JTree cloneJTree(JTree source) {
        DisplayNode root = clone((DisplayNode) source.getModel().getRoot(), true);
        TreeViewModel dtm = new TreeViewModel(root);
        JTree target = new JTree(dtm);
        CloneHelper.cloneComponent(source, target, new String[] {"UI", // class javax.swing.plaf.TreeUI
                "UIClassID", // class java.lang.String
                "accessibleContext", // class javax.accessibility.AccessibleContext
View Full Code Here

        this.editor = new BorderedComboBoxEditor();
        this.setEditor(this.editor);
        this.setRenderer(new BorderedComboBoxRenderer());
        JTextComponent comp = (JTextComponent)this.editor.getEditorComponent();
        comp.setBackground(this.getBackground());
        comp.setDocument(new FixedLengthDocument(0));

        comp.addKeyListener(new ComboBoxKeyHandler());
    }
View Full Code Here

            }
            if (autoComplete) {
                editComponent.setDocument(new FillinManagementDocument(this, showDropdowns, listEntriesOnly, maxCharacters));
            }
            else {
                editComponent.setDocument(new FixedLengthDocument(maxCharacters));
            }
        }
    }
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

                    ((TitledBorder) border).setTitle("");
                }
            } else {
                if (pCaption != null) {
                    // TitledBorder tb = BorderFactory.createTitledBorder(border, caption.toString(), TitledBorder.LEFT, TitledBorder.TOP);
                    TitledBorder tb = new GridTitledBorder(border, caption.toString(), TitledBorder.LEFT, TitledBorder.TOP);
                    if (this.captionFont != null) {
                        tb.setTitleFont(this.captionFont);
                    }
                    setBorder(tb);
                }
            }
        } else {
          GridTitledBorder gridBorder;
            if (pCaption != null) {
              gridBorder = new GridTitledBorder(pCaption.toString());
            } else {
              gridBorder = new GridTitledBorder("");
            }
            if (this.captionFont != null) {
              gridBorder.setTitleFont(this.captionFont);
            }
            setBorder(gridBorder);
        }
    }
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.displayproject.ArrayColumn

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.