Package net.helipilot50.stocktrade.displayproject

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

        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

        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
                "actionMap", // class javax.swing.ActionMap
View Full Code Here

TOP

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