Examples of ArrayColumn


Examples of net.helipilot50.stocktrade.displayproject.ArrayColumn

      ArrayFieldModel model = (ArrayFieldModel)getModel();
      Stroke defaultStroke = ((Graphics2D)g).getStroke();
      for (int row = rowCount; row <= currentHeightOfAllRows/rowHeight; row++) {
        int xPos = 0; // PM this needs to be zero because the line does not repaint correctly
        for (int col = 0; col < colModel.getColumnCount(); col++) {
          ArrayColumn column = (ArrayColumn)this.getColumnModel().getColumn(col);
          Color backgroundColour = this.getBackground();

          // Rectangle place holders
          g.setColor(backgroundColour);
          g.fillRect(xPos, row*rowHeight, column.getWidth(), rowHeight);

          // Details in rectangle place holders
          if (this.paintEmptyRowRectangles && rowHeight > inset*2 && column.getWidth() > inset*2) {

            // If we can append a row, we are on the last row, and this column is editable
            if (this.isAllowsAppendAndEditable() && row == rowCount && model.isColumnEditable(col)) {
              TableCellRenderer renderer = ((ArrayFieldCellRenderer)column.getCellRenderer()).getRenderer();

              // The renderer supports painting in an empty row.  CraigM:20/01/2009.
              if (renderer instanceof ArrayFieldEmptyCellRenderer) {
                // Paint an editable row (not faded)
                // TF:27/11/2009:Changed this to pass in the width, which allows us to draw the proper image when the column is resized.
                BufferedImage img = ((ArrayFieldEmptyCellRenderer)renderer).getImage(column.getWidth());
                g.drawImage(img, xPos + ((column.getWidth() - img.getWidth()) / 2), (row*rowHeight) + ((rowHeight - img.getHeight()) / 2), null);
              }

              // Draw a filled white rectangle
              else {
                Color emptyCellColor = backgroundColour.equals(Color.gray) ? Color.lightGray : Color.gray;
                g.setColor(emptyCellColor);
                g.drawRect(xPos+inset, (row*rowHeight)+inset, column.getWidth()-(inset*2), rowHeight-(inset*2));
              }
            }
            else {
              TableCellRenderer renderer = ((ArrayFieldCellRenderer)column.getCellRenderer()).getRenderer();

              // The renderer supports painting in an empty row.  CraigM:20/01/2009.
              if (renderer instanceof ArrayFieldEmptyCellRenderer) {
                // These are non editable rows, so fade them out a little
                ((Graphics2D)g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f));
                BufferedImage img = ((ArrayFieldEmptyCellRenderer)renderer).getImage(column.getWidth());
                g.drawImage(img, xPos + ((column.getWidth() - img.getWidth()) / 2), (row*rowHeight) + ((rowHeight - img.getHeight()) / 2), null);
                ((Graphics2D)g).setComposite(AlphaComposite.Src);
              }
              else {
                Color emptyCellColor = backgroundColour.equals(Color.lightGray) ? Color.gray : Color.lightGray;
                g.setColor(emptyCellColor);
                ((Graphics2D)g).setStroke(dashed);
                g.drawRect(xPos+inset, (row*rowHeight)+inset, column.getWidth()-(inset*2), rowHeight-(inset*2));
              }
            }
          }
          // --- End ---
          xPos += column.getWidth();
        }
      }
      ((Graphics2D)g).setStroke(defaultStroke);
    }
  }
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.ArrayColumn

          else if (hitColumnIndex != -1 && this.isAllowsAppendAndEditable()) {
              int emptyRowStart = getRowHeight() * getRowCount();
              int emptyRowEnd = getRowHeight() * (getRowCount()+1);
             
              if (event.getY() > emptyRowStart && event.getY() < emptyRowEnd) {
                  ArrayColumn column = (ArrayColumn)this.getColumnModel().getColumn(hitColumnIndex);
                  component = column.getComponent();
              }
          }

      // Now have to see if the component is a JComponent before
      // getting the tip
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.ArrayColumn

      TextData statusTextValue = null;

      int columnAtPoint = columnAtPoint(e.getPoint());
      TableColumn column = getColumnModel().getColumn(columnAtPoint);
      if (column instanceof ArrayColumn) {
        ArrayColumn arrayColumn = (ArrayColumn) column;
        TableCellRenderer renderer = arrayColumn.getRenderer();
        if (renderer instanceof FormattedCellRenderer) {
          FormattedCellRenderer formatedRenderer = (FormattedCellRenderer) renderer;
          statusTextValue = (TextData) formatedRenderer.getDataFieldOriginalComponent().getClientProperty(StatusText.cSTATUS_TEXT);
        } else if (renderer instanceof ComboBoxCellRenderer) {
          statusTextValue = (TextData) ((ComboBoxCellRenderer)renderer).getComboBox().getClientProperty(StatusText.cSTATUS_TEXT);
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.ArrayColumn

         */
        //  Some test code to see if code below could be simplified
        if (this.getSorter().isSorting())  {
            int column = this.getSorter().getSortColumn();
            ArrayColumnModel columnModel = this.getColumnModel();
            ArrayColumn arrayColumn = columnModel.getRealColumn(column);
            TextData name = new TextData();
            name.setValue(arrayColumn.getName());
            if (name.moveToString("Item")) {
                name = name.copyRange(name.getOffset());
            }
            boolean ascending = (this.getSorter().getSortDirection() == TableSorter.ASCENDING);

View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.ArrayColumn

        if (acm.getRealColumnCount() > 0) {
            columns = new Array_Of_OutlineColumnDesc<OutlineColumnDesc>();
        }
        */
        for (int i = 0; i < acm.getRealColumnCount(); i++){
            ArrayColumn col = (ArrayColumn)acm.getRealColumn(i);
            columns.add(this.getOutlineColumn(col, false));
        }
        return columns;
    }
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.ArrayColumn

              // TF:19/3/08: Added in a factor to make the columns approximately as wide as they are in Forte.
                colWidth = (int)(UIutils.colsToPixels(col.getMaxCharacters(), this) * UIutils.FORTE_COLUMNS_SCALING_FACTOR);
            }
            AlignedCellRenderer renderer = new AlignedCellRenderer(alignment, col.getName().toString());
            renderer.setInsets(0, 2, 0, 2);
            ArrayColumn ac = new ArrayColumn(col.getName().toString(),
                    colNum,
                    colWidth,
                    renderer,
                    false,
                    new Integer(col.getTitleMsgNum()));
           
            // CraigM:18/07/2008 - We need to set the size policy as it is used in ArrayFieldModel.resizeColumnIfNecessary()
            ac.setSizePolicy(col.getSizePolicy());
           
            // TF:19/06/2008:In Forte, the user could always adjust the widths of the columns in a list view. If we use
            // setMinWidth (as the ArrayColumn constructor does) then the user cannot reduce the columns smaller than
            // their initial size. Hence we use setMinWidth(0) and setPreferredWith. This is done here rather than in
            // the array column constructor as this rule applies only for list views, not array fields.
            ac.setMinWidth(0);
            ac.setPreferredWidth(colWidth);
           
            col.setArrayColumn(ac);
            cm.addColumn(ac, col.getTitle().toString(), col.getState() != Constants.FS_INVISIBLE);

            propNames[colNum] = col.getName().toString();
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.ArrayColumn

   
    // CraigM:01/05/2008:Use the total array collection (including invisible columns)
    ArrayList<ArrayColumn> allColumns = acm.getColumnList();

    for (int i = 0; i < allColumns.size(); i++){
            ArrayColumn col = allColumns.get(i);
            if (col.getTitleMsgNumber() > 0){
              String titleString = mcat.getString(setNumber, col.getTitleMsgNumber());
              col.setHeaderValue(titleString);
            }
        }
  }
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.ArrayColumn

     * @return integer index of the first visible column.
     */
    public int getFirstVisibleColumnIndex() {
        ArrayColumnModel acm = (ArrayColumnModel)this.table.getColumnModel();
        for (int i = 0; i < acm.getRealColumnCount(); i++){
            ArrayColumn col = (ArrayColumn)acm.getRealColumn(i);
          if (col.isVisible()) {
            return i;
          }
        }
    return -1;
  }
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.ArrayColumn

                  try {
                    // CraigM:22/08/2008 - Corrected checking of column.
                    // CraigM:07/11/2008 - Note: If an object was replaced that maps to 0 or more columns, then updatedColumn will be set to -1.
                    if (otm.table.getColumnModel() instanceof ArrayColumnModel) {
                      ArrayColumn ac = ((ArrayColumnModel)otm.table.getColumnModel()).findColumn(columnAttributeName);
                      if (ac != null) {
                        updatedColumn = ac.getModelIndex();
                      }
                    }
                  }
                  catch (Throwable e) {
                    // The data may not even be mapped to a column in the table
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.ArrayColumn

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