Package DisplayProject

Examples of DisplayProject.ArrayFieldModel


      // TF:10/02/2009:Changed this to cater for the stateColourForRow interface
      ArrayColumn ac = (ArrayColumn) getColumnModel().getColumn(column);
      if (ac.getStateColour() != null) {
        return ac.getStateColour().isEnabled(row);
      }
      ArrayFieldModel alm = (ArrayFieldModel)getModel();
      return alm.isCellEditable(row, column);
    }
    else
      return false;
  }
View Full Code Here


   * Get the last column in the array field that is editable. If there are no editable columns, this
   * method returns -1
   * @return the index of the last editable column, or -1 if there are none.
   */
  public int getLastEditableColumn() {
    ArrayFieldModel model = (ArrayFieldModel)getModel();
    int columnCount = model.getColumnCount()-1;
    for (int i = columnCount; i >= 0; i--){
      if (model.isColumnEditable(i)){
        return i;
      }
    }
    return -1;
  }
View Full Code Here

   * method returns -1
   * @return the index of the first editable column, or -1 if there are none.
   */
  public int getFirstEditableColumn() {
    // TF:24/9/07: Changed this logic to return something other than 0 (a valid column) if there are no editable columns
    ArrayFieldModel model = (ArrayFieldModel)getModel();
    int columnCount = model.getColumnCount()-1;
    // TF:29/9/07:Fixed this up to go up to the proper index
    for (int i = 0; i <= columnCount; i++) {
      if (model.isColumnEditable(i)) {
        return i;
      }
    }
    return -1;
  }
View Full Code Here

    if (rowCount * rowHeight < currentHeightOfAllRows) {
      int inset = 4;
      float dash1[] = {4.0f};
      BasicStroke dashed = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 2.0f, dash1, 0.0f);
      TableColumnModel colModel = this.getColumnModel();
      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)
View Full Code Here

      // TF:10/02/2009:Changed this to cater for the stateColourForRow interface
      ArrayColumn ac = (ArrayColumn) getColumnModel().getColumn(column);
      if (ac.getStateColour() != null) {
        return ac.getStateColour().isEnabled(row);
      }
      ArrayFieldModel alm = (ArrayFieldModel)getModel();
      return alm.isCellEditable(row, column);
    }
    else
      return false;
  }
View Full Code Here

   * Get the last column in the array field that is editable. If there are no editable columns, this
   * method returns -1
   * @return the index of the last editable column, or -1 if there are none.
   */
  public int getLastEditableColumn() {
    ArrayFieldModel model = (ArrayFieldModel)getModel();
    int columnCount = model.getColumnCount()-1;
    for (int i = columnCount; i >= 0; i--){
      if (model.isColumnEditable(i)){
        return i;
      }
    }
    return -1;
  }
View Full Code Here

   * method returns -1
   * @return the index of the first editable column, or -1 if there are none.
   */
  public int getFirstEditableColumn() {
    // TF:24/9/07: Changed this logic to return something other than 0 (a valid column) if there are no editable columns
    ArrayFieldModel model = (ArrayFieldModel)getModel();
    int columnCount = model.getColumnCount()-1;
    // TF:29/9/07:Fixed this up to go up to the proper index
    for (int i = 0; i <= columnCount; i++) {
      if (model.isColumnEditable(i)) {
        return i;
      }
    }
    return -1;
  }
View Full Code Here

    if (rowCount * rowHeight < currentHeightOfAllRows) {
      int inset = 4;
      float dash1[] = {4.0f};
      BasicStroke dashed = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 2.0f, dash1, 0.0f);
      TableColumnModel colModel = this.getColumnModel();
      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)
View Full Code Here

TOP

Related Classes of DisplayProject.ArrayFieldModel

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.