Esempio n. 1
0
  public static void initialize(DataGrid grid) {
    // grid.setRedraw(false);
    // grid.reset();
    grid.setShowVerticalLines(false);
    grid.setBackground(GridFixedBackColor.account);
    grid.setForeground(GridBackColor.account);
    // grid.setBorderStyle(BorderStyle.account);
    // grid.setRowLabelWidth(RowLabelWidth.account);
    // grid.setSelectionBackground(SelectionBackground.account);
    // grid.setCurrentCellColor(CurrentCellColor.account);
    // grid.setCurrentCellBorder(CurrentCellBorder.account);

    // grid.setRedraw(true);
    // grid.doLayout();
  }
Esempio n. 2
0
  public static void initialize(
      DataGrid grid,
      String dataSourceKey,
      Collection dataSource,
      tradingConsole.ui.grid.BindingSource bindingSource,
      boolean isAllowEditIsBuy,
      int dQMaxMove,
      int stepSize) {
    grid.setShowVerticalLines(false);
    grid.setBackground(GridFixedBackColor.account);
    grid.setForeground(GridBackColor.account);
    // grid.setSelectionBackground(SelectionBackground.account);

    TradingConsole.bindingManager.bind(
        dataSourceKey,
        dataSource,
        bindingSource,
        MakeOrderAccount.getPropertyDescriptors(isAllowEditIsBuy, dQMaxMove, stepSize));
    grid.setModel(bindingSource);
    TradingConsole.bindingManager.setHeader(
        dataSourceKey,
        SwingConstants.CENTER,
        25,
        GridFixedForeColor.account,
        Color.white,
        HeaderFont.account);
    TradingConsole.bindingManager.setGrid(
        dataSourceKey,
        18,
        Color.black,
        Color.lightGray,
        Color.blue,
        true,
        true,
        GridFont.account,
        false,
        true,
        true);

    if (isAllowEditIsBuy) {
      String[] listStrings = new String[] {Language.Buy, Language.Sell};
      ListComboBoxCellEditor listComboBoxCellEditor = new ListComboBoxCellEditor(listStrings);
      int column = bindingSource.getColumnByName(MakeOrderAccountGridColKey.IsBuyForCombo);
      grid.getColumnModel().getColumn(column).setCellEditor(listComboBoxCellEditor);
    }
  }