예제 #1
1
  /**
   * Overridden to message super and forward the method to the tree. Since the tree is not actually
   * in the component hierarchy it will never receive this unless we forward it in this manner.
   */
  public void updateUI() {
    super.updateUI();

    if (tree != null) tree.updateUI();

    // Use the tree's default foreground and background colors in the
    // table.
    LookAndFeel.installColorsAndFont(this, "Tree.background", "Tree.foreground", "Tree.font");
  }
예제 #2
0
  private final void reset() {
    synchronized (exception) {
      exception.clear();
      stacks.clear();
      currRow = 0;

      tableException.updateUI();
      tableStacks.updateUI();
    }
  }
  private void obtenerValorPorcentaje(java.math.BigDecimal valorPorcentaje) {

    java.math.BigDecimal porcentaje =
        new java.math.BigDecimal(
            valorPorcentaje == null ? "0.00" : valorPorcentaje.toString().trim());

    java.math.BigDecimal parcial =
        new java.math.BigDecimal(
            tabla.getValueAt(fila, buscarColumna("Parcial", tabla)).toString().trim().isEmpty()
                ? "1.00"
                : tabla.getValueAt(fila, buscarColumna("Parcial", tabla)).toString().trim());

    java.math.BigDecimal porcentajeFinal =
        (porcentaje
            .multiply(parcial)
            .divide(new java.math.BigDecimal("100.00"), 15, java.math.RoundingMode.HALF_EVEN));

    /// PARA PONER EL VALOR DECIMAL EN EL CAMPO PRECIO
    tabla.setValueAt(porcentajeFinal, fila, buscarColumna("Descuento", tabla));

    /// PARA PONER EL VALOR EN SUBTOTAL
    tabla.setValueAt(parcial.subtract(porcentajeFinal), fila, buscarColumna("Subtotal", tabla));

    //        ///PARA PONER EL VALOR ENTERO EN EL CAMPO CANTIDAD
    //        tabla.setValueAt(cantidad.toString().substring(0, cantidad.toString().indexOf(".")),
    //                fila, buscarColumna("Cantidad", tabla));
    tabla.updateUI();
  }
  private void obtenerPrecio(java.math.BigDecimal valorRetorno) {

    java.math.BigDecimal parcial =
        new java.math.BigDecimal(valorRetorno == null ? "0.00" : valorRetorno.toString().trim());

    java.math.BigDecimal cantidad =
        new java.math.BigDecimal(
            tabla.getValueAt(fila, buscarColumna("Cantidad", tabla)).toString().trim().isEmpty()
                ? "1.00"
                : tabla.getValueAt(fila, buscarColumna("Cantidad", tabla)).toString().trim());

    java.math.BigDecimal precio = parcial.divide(cantidad, 15, java.math.RoundingMode.HALF_EVEN);

    java.math.BigDecimal porcentaje =
        new java.math.BigDecimal(
            tabla.getValueAt(fila, buscarColumna("%", tabla)).toString().trim().isEmpty()
                ? "1.00"
                : tabla.getValueAt(fila, buscarColumna("%", tabla)).toString().trim());

    java.math.BigDecimal valorPorcentaje =
        parcial.multiply(porcentaje).divide(new java.math.BigDecimal("100.00"));
    java.math.BigDecimal valorsubTotal = parcial.subtract(valorPorcentaje);

    tabla.setValueAt(precio, fila, buscarColumna("Precio", tabla));

    tabla.setValueAt(valorPorcentaje, fila, buscarColumna("Descuento", tabla));

    tabla.setValueAt(valorsubTotal, fila, buscarColumna("Subtotal", tabla));
    tabla.updateUI();
  }
예제 #5
0
 /** 删除 */
 private void processDeleteEvent() {
   int index = timeTable.getSelectedRow();
   if (index == -1) return;
   JTimeTableModel model = (JTimeTableModel) timeTable.getModel();
   if (index < model.timeList.size()) model.timeList.removeElementAt(index);
   timeTable.updateUI();
 }
예제 #6
0
 // 条件查询
 private void termQuery(int currentPage) {
   TOrder torder = new TOrder();
   torder.setOrderID(orderNum.getText().getText().trim());
   TUser tuser = new TUser();
   tuser.setUserID(userNum.getText().getText().trim());
   torder.setTUser(tuser);
   torder.setOperator(seller.getText().getText().trim());
   torder.setHappenTime(startTime.getDate());
   torder.setEndTime(endTime.getDate());
   tableJsp.getViewport().remove(table);
   tableJsp.getViewport().add(waitComponent);
   try {
     pageView.setCurrentPage(currentPage);
     PageModel<TOrder> pageModel =
         orderService.getScrollService(pageView.getFirstResult(), pageView.getMaxResult(), torder);
     pageView.setPageModel(pageModel);
     pageView.setPageIndex(
         PageIndex.getPageIndex(
             pageView.getPageCode(), pageView.getCurrentPage(), pageView.getTotalPage()));
     if (pageModel != null) {
       tableJsp.getViewport().remove(waitComponent);
       tableJsp.getViewport().add(table);
       orderOnlineModel.setRowData(pageModel.getResultList());
       table.updateUI();
       pagingComponent.show();
     } else {
       // 没有订单数据
       waitComponent.setText("不存在数据");
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
  private void updateUserInfo() {
    cashRemainjTextField.setText(
        (new DecimalFormat("###,###")).format(currentUser.getCash() * 1000) + " VND");

    PortfolioTableModel portfolioTableModel = (PortfolioTableModel) portfolioJTable.getModel();
    portfolioTableModel.setData(currentUser.getCurPortfolioList());
    portfolioJTable.updateUI();
  }
예제 #8
0
 private void updateTable() {
   if (model != null && table != null) {
     if (table == null) System.out.println("null");
     table.setModel(model);
     table.updateUI();
   }
   repaint();
 }
 // add a new row to the end of jtable and insert into database
 private void addNewRow() {
   stopCellEditting();
   String filterKey =
       cmbPkgFilter.getSelectedItem() == null ? "" : cmbPkgFilter.getSelectedItem().toString();
   String orderBy = cmbOrderBy.getSelectedItem().toString();
   pkgTblModel.addEmptyRow(tblPackages.getRowCount(), orderBy, filterKey);
   tblPackages.updateUI();
   // tblPackages.editCellAt(tblPackages.getRowCount()-1, 1);
   tblPackages.setRowSelectionInterval(
       tblPackages.getRowCount() - 1, tblPackages.getRowCount() - 1);
 }
  private void obtenerValorPorcentaje(java.math.BigDecimal valorDescuento) {

    try {
      //////////////////////////// ESTO ES PARA OBTENER EL PORCENTAJE
      java.math.BigDecimal parcial =
          new java.math.BigDecimal(
              tabla.getValueAt(fila, buscarColumna("Parcial", tabla)) == null
                      || tabla
                          .getValueAt(fila, buscarColumna("Parcial", tabla))
                          .toString()
                          .trim()
                          .isEmpty()
                  ? "0.00"
                  : tabla.getValueAt(fila, buscarColumna("Parcial", tabla)).toString().trim());

      java.math.BigDecimal descuento =
          new java.math.BigDecimal(
              valorDescuento == null ? "0.00" : valorDescuento.toString().trim());

      java.math.BigDecimal multiplicacion = descuento.multiply(new java.math.BigDecimal("100.00"));
      java.math.BigDecimal division = cero;

      if (parcial.compareTo(cero) > 0)
        division = multiplicacion.divide(parcial, 15, java.math.RoundingMode.HALF_UP);
      tabla.setValueAt(division.toPlainString(), fila, buscarColumna("%", tabla));

      /// PARA PONER EL SUBTOTAL
      //            table.setValueAt(parcial.subtract(division), fila, buscarColumna("Subtotal"));
      //            if (division.compareTo(mDIShrimp.getCero()) == 0){
      //                table.setValueAt(parcial.subtract(division), fila,
      // buscarColumna("Subtotal"));
      //            } else {
      //                table.setValueAt(division.subtract(parcial), fila,
      // buscarColumna("Subtotal"));
      //            }

      tabla.repaint();
    } catch (Exception e) {
      shrimp.helper.JDVentanaMensajes.showMessageDialog(
          new javax.swing.JFrame(),
          "Ha ocurrido un error inesperado en el formulario",
          javax.swing.JOptionPane.ERROR_MESSAGE,
          javax.swing.JOptionPane.DEFAULT_OPTION,
          e,
          null);
    }

    //        ///PARA PONER EL VALOR ENTERO EN EL CAMPO CANTIDAD
    //        tabla.setValueAt(cantidad.toString().substring(0, cantidad.toString().indexOf(".")),
    //                fila, buscarColumna("Cantidad", tabla));
    tabla.updateUI();
  }
  /**
   * Loads Principal in the table
   *
   * @param principals Sync4jPrincipal[]
   */
  public void loadPrincipals(Sync4jPrincipal[] principals) {

    ObjectsSortTools.sort("id", ObjectsSortTools.TYPE_INTEGER, principals);

    model.loadPrincipals(principals);

    if (principals != null && principals.length > 0) {
      // select first row
      table.setRowSelectionInterval(0, 0);
    }

    table.updateUI();
  }
예제 #12
0
 /** 增加 */
 private void processAddEvent() {
   Frame frame = JActiveDComDM.MainApplication.MainWindow;
   JManageCTimeDialog ctimeDlg;
   ctimeDlg = new JManageCTimeDialog(frame, "添加时间方案", true);
   ctimeDlg.setSize(480, 310);
   ctimeDlg.setMinimumSize(480, 310);
   ctimeDlg.CenterWindow();
   ctimeDlg.setVisible(true);
   if (ctimeDlg.OPTION == ctimeDlg.OPTION_OK) {
     int index = timeTable.getRowCount();
     timeTable.getModel().setValueAt(ctimeDlg.getCTimeObject(), index, 0);
     timeTable.updateUI();
   }
 }
 /** inits GUI with labels of current language */
 public void initGUI() {
   // setTitle(app.getPlain("ConstructionProtocol"));
   scrollPane.setFont(((AppD) app).getPlainFont());
   // setMenuBar();
   getStyleBar().setLabels();
   // set header values (language may have changed)
   for (int k = 0; k < tableColumns.length; k++) {
     tableColumns[k].setHeaderValue(data.columns[k].getTranslatedTitle());
   }
   table.updateUI();
   table.setFont(((AppD) app).getPlainFont());
   ((ConstructionTableData) data).updateAll();
   getStyleBar().reinit();
   // protNavBar.updateIcons();
 }
 private void loadTemplate(String filename) {
   if (filename.equals("")) {
     return;
   }
   File file = new File(filename);
   if (!file.exists()) {
     return;
   }
   TemplateHandle handle = new TemplateHandle(filename);
   List<TemplateInfo> temps = handle.getTemplateInfos();
   // 绑定到表格
   templateInfos = temps;
   tableModel.setColumns(temps);
   table.repaint();
   table.updateUI();
 }
예제 #15
0
  public void initialize_table() {
    table =
        new JTable() {

          private static final long serialVersionUID = 1L;

          public boolean isCellEditable(int rowIndex, int colIndex) {
            return false; // Disallow the editing of any cell
          }
        };
    table.setMaximumSize(new Dimension(150, 150));
    table.setEditingRow(0);
    table.setEditingColumn(0);
    table.setName("tbl_prenotazioni");
    table.updateUI();
  }
 private void addData() {
   DBType dbType =
       (DBType)
           JOptionPane.showInputDialog(
               null,
               "请选择模版:",
               "数据库类型",
               JOptionPane.PLAIN_MESSAGE,
               null,
               DBType.values(),
               DBType.valueOf("MYSQL"));
   if (dbType == null) {
     return;
   }
   DBConnectionInfo dbInfo = ConfigDbUtil.init().getInitDBConnectionInfo(dbType);
   tmDbInfo.addRow(dbInfo);
   jtDbinfo.updateUI();
 }
예제 #17
0
  /** 编辑 */
  private void processEditEvent() {
    int count = timeTable.getModel().getRowCount();
    if (count == 0) return;
    int index = timeTable.getSelectedRow();
    if (index < 0) return;
    JTimeTableModel model = (JTimeTableModel) timeTable.getModel();
    JCTimeObject obj = (JCTimeObject) model.timeList.get(index);

    Frame frame = JActiveDComDM.MainApplication.MainWindow;
    JManageCTimeDialog actionDlg;
    actionDlg = new JManageCTimeDialog(frame, "编辑时间方案", true);
    actionDlg.setSize(480, 310);
    actionDlg.CenterWindow();
    actionDlg.setCTimeObject(obj);
    actionDlg.setVisible(true);
    if (actionDlg.OPTION == actionDlg.OPTION_OK) {
      timeTable.getModel().setValueAt(actionDlg.getCTimeObject(), index, 0);
      timeTable.updateUI();
    }
  }
예제 #18
0
  private void loadRecipes(File dir) {

    recipes.clear();
    files.clear();
    if (dir == null) {
      return;
    }
    for (int i = 0; i < dir.list().length; i++) {
      File file = new File(dir.list()[i]);

      if (file.getPath().endsWith(".rec")
          || file.getPath().endsWith(".qbrew")
          || file.getPath().endsWith(".xml")) {

        Debug.print("Opening: " + file.getName() + ".\n");
        // file.getAbsolutePath doesn't work here for some reason,
        // so we have to build it ourselves
        String fileName =
            dir.getAbsolutePath() + System.getProperty("file.separator") + file.getName();
        file = new File(fileName);
        OpenImport openImport = new OpenImport();
        r = openImport.openFile(file);
        if (openImport.getFileType().equals("sb")
            || openImport.getFileType().equals("qbrew")
            || openImport.getFileType().equals("promash")) {
          recipes.add(r);
          files.add(file);

        } else if (openImport.getFileType().equals("beerxml")) {
          List<Recipe> rs = openImport.getRecipes();
          for (int j = 0; j < rs.size(); j++) {
            recipes.add(rs.get(j));
            files.add(file);
          }
        }
      }
    }
    recipeTableModel.setData(recipes);
    recipeTable.updateUI();
  }
예제 #19
0
  @Override
  public void updateUI() {
    // Bug ID: 6788475 Changing to Nimbus LAF and back doesn't reset look and feel of JTable
    // completely
    // http://bugs.java.com/view_bug.do?bug_id=6788475
    // XXX: set dummy ColorUIResource
    setSelectionForeground(new ColorUIResource(Color.RED));
    setSelectionBackground(new ColorUIResource(Color.RED));
    super.updateUI();

    putClientProperty("Table.isFileList", Boolean.TRUE);
    setCellSelectionEnabled(true);
    setIntercellSpacing(new Dimension());
    setShowGrid(false);
    setAutoCreateRowSorter(true);
    setFillsViewportHeight(true);

    setDefaultRenderer(
        Object.class,
        new DefaultTableCellRenderer() {
          @Override
          public Component getTableCellRendererComponent(
              JTable table,
              Object value,
              boolean isSelected,
              boolean hasFocus,
              int row,
              int column) {
            return super.getTableCellRendererComponent(table, value, false, false, row, column);
          }
        });

    TableColumn col = getColumnModel().getColumn(0);
    col.setCellRenderer(new FileNameRenderer(this));
    col.setPreferredWidth(200);
    col = getColumnModel().getColumn(1);
    col.setPreferredWidth(300);
  }
예제 #20
0
  protected void UpdateTitle() {

    table.updateUI();
    if (workReq == null) {
      lblStoryName.setText("No story");
      lblStoryInfoExt.setText(" - ");
      btnDownload.setEnabled(false);
    } else if (workReq.GetStatus() == PageRequestStatus.Ready
        && id != workReq.GetStoryPage().GetStoryID()) {
      id = workReq.GetStoryPage().GetStoryID();
      if (!userEditName && FileTextField.getText().trim().length() < 1) {
        System.out.println("Empty Filename");
        FileTextField.setText(GUIUtil.genFileName(workReq.GetStoryPage().GetStoryName(), "epub"));
      }

      if (!userEditName
          && FileTextField.getText()
              != GUIUtil.genFileName(workReq.GetStoryPage().GetStoryName(), "epub")) {
        FileTextField.setText(GUIUtil.genFileName(workReq.GetStoryPage().GetStoryName(), "epub"));
      }

      lblStoryName.setText(workReq.GetStoryPage().GetStoryName());
      lblStoryInfoExt.setText(
          String.format(
              "By: %s - %d Chapters - %d Words",
              workReq.GetStoryPage().GetAuthor(), workReq.GetStoryPage().GetChapterCount(), 0));
      btnDownload.setEnabled(true);
      txtpnDesc.setText(workReq.GetStoryPage().GetStoryDescription());

    } else if (workReq.GetStatus() == PageRequestStatus.Ready) {
    } else {
      lblStoryName.setText(workReq.GetStatus().toString());
      lblStoryInfoExt.setText(" - ");
      btnDownload.setEnabled(false);
    }
  }
 public void loadFile() {
   if (jtfConfigPath.getText().trim().length() < 1) {
     JOptionPane.showMessageDialog(this, "文件目录不能为空!");
     return;
   }
   new Thread() {
     public void run() {
       load();
     }
   }.start();
   Properties properties = LocalResourcesUtil.getProperties(jtfConfigPath.getText());
   Iterator<Object> dbsKeys = properties.keySet().iterator();
   String path = jtfConfigPath.getText();
   path = path.substring(0, path.lastIndexOf(File.separator) + 1);
   while (dbsKeys.hasNext()) {
     String key = dbsKeys.next().toString().trim();
     String value = properties.getProperty(key).trim();
     Properties dbConfig = LocalResourcesUtil.getProperties(StringUtils.unite(path, value));
     DBConnectionInfo dbinfo = new DBConnectionInfo(key, dbConfig);
     tmDbInfo.addRow(dbinfo);
   }
   jtDbinfo.updateUI();
   jpbLoading.setValue(100);
 }
예제 #22
0
 @Override
 public void updateUI() {
   super.updateUI();
   myMinRowHeight = null;
 }
예제 #23
0
  @Override
  public void actionPerformed(ActionEvent e) {
    if (e.getSource() == queryButton) {
      // 查询
      this.termQuery(1);
    } else if (e.getSource() == showButton) {
      // 查看详细
      if (table.getSelectedRow() != -1) {
        String userID = (String) table.getValueAt(table.getSelectedRow(), -1);
        try {
          TUser tUser = tUserService.getByIdService(userID);
          menberDetailDialog = new MenberDetailDialog(null, "会员详细信息", true);
          menberDetailDialog.showDialog(tUser);
        } catch (Exception e1) {
          e1.printStackTrace();
        }
      } else {
        JOptionPane.showMessageDialog(null, "请先选择行数据");
      }
    } else if (e.getSource() == dGiftButton) {
      // 兑换礼品
      if (table.getSelectedRow() != -1) {
        String userID = (String) table.getValueAt(table.getSelectedRow(), -1);
        try {
          TUser tUser = tUserService.getByIdService(userID);
          tUser.setUserID(userID);
          memberDGiftDialog = new MemberDGiftDialog(null, "兑换礼品", true);
          memberDGiftDialog.showDialog(tUser);
        } catch (Exception e1) {
          e1.printStackTrace();
        }
      } else {
        JOptionPane.showMessageDialog(null, "请先选择行数据");
      }
    } else if (e.getSource() == levelButton) {
      // 设置会员级别
      if (table.getSelectedRow() != -1) {
        boolean[] bools = memberQueryCardModel.getBools();
        boolean select = false; // 检查是否有选中的商品 如果没选中false 否则true
        for (int i = bools.length - 1; i >= 0; --i) {
          if (bools[i]) {
            select = true;
            break;
          }
        }
        if (!select) {
          JOptionPane.showMessageDialog(null, "请先选择用户!");
          return;
        } else {
          try {
            // TUser tUser = tUserService.getByIdService(userID);

            List<TUser> tUserList = memberQueryCardModel.getTCommodityList();
            List<TUser> tUserListOn = new ArrayList();
            for (int i = 0; i < tUserList.size(); i++) {
              if (bools[i]) {
                tUserListOn.add(tUserList.get(i));
              }
            }
            memberLevelPanel = new MemberLevelPanel(null, "设置会员级别", true);
            memberLevelPanel.showDialog(tUserListOn);
            table.updateUI();
          } catch (Exception e1) {
            e1.printStackTrace();
          }
        }
      } else {
        JOptionPane.showMessageDialog(null, "请先选择行数据");
      }
    } else if (e.getSource() == giftButton) {
      // 送礼品
      if (table.getSelectedRow() != -1) {
        boolean[] bools = memberQueryCardModel.getBools();
        boolean select = false; // 检查是否有选中的商品 如果没选中false 否则true
        for (int i = bools.length - 1; i >= 0; --i) {
          if (bools[i]) {
            select = true;
            break;
          }
        }
        if (!select) {
          JOptionPane.showMessageDialog(null, "请先选择用户!");
          return;
        } else {
          try {
            // TUser tUser = tUserService.getByIdService(userID);

            List<TUser> tUserList = memberQueryCardModel.getTCommodityList();
            List<TUser> tUserListOn = new ArrayList();
            for (int i = 0; i < tUserList.size(); i++) {
              if (bools[i]) {
                tUserListOn.add(tUserList.get(i));
              }
            }
            memberGiftSend = new MemberGiftSend(null, "会员赠送礼品", true);
            memberGiftSend.showDialog(tUserListOn);
            table.updateUI();
          } catch (Exception e1) {
            e1.printStackTrace();
          }
        }
      } else {
        JOptionPane.showMessageDialog(null, "请先选择行数据");
      }
    } else if (e.getSource() == pointButton) {
      // 送积分
      if (table.getSelectedRow() != -1) {
        boolean[] bools = memberQueryCardModel.getBools();
        boolean select = false; // 检查是否有选中的商品 如果没选中false 否则true
        for (int i = bools.length - 1; i >= 0; --i) {
          if (bools[i]) {
            select = true;
            break;
          }
        }
        if (!select) {
          JOptionPane.showMessageDialog(null, "请先选择用户!");
          return;
        } else {
          try {
            // TUser tUser = tUserService.getByIdService(userID);

            List<TUser> tUserList = memberQueryCardModel.getTCommodityList();
            List<TUser> tUserListOn = new ArrayList();
            for (int i = 0; i < tUserList.size(); i++) {
              if (bools[i]) {
                // Object obj1=tUserList.get(i);
                tUserListOn.add(tUserList.get(i));
                // TRoleRight roleRight=new TRoleRight();
                // roleRight.setTRight((TRight)obj1);
              }
            }
            memberPointSend = new MemberPointSend(null, "会员赠送积分", true);
            memberPointSend.showDialog(tUserListOn);
            table.updateUI();
          } catch (Exception e1) {
            e1.printStackTrace();
          }
        }
      } else {
        JOptionPane.showMessageDialog(null, "请先选择行数据");
      }
    } else if (e.getSource() == cashButton) {
      // 送优惠
      if (table.getSelectedRow() != -1) {
        boolean[] bools = memberQueryCardModel.getBools();
        boolean select = false; // 检查是否有选中的商品 如果没选中false 否则true
        for (int i = bools.length - 1; i >= 0; --i) {
          if (bools[i]) {
            select = true;
            break;
          }
        }
        if (!select) {
          JOptionPane.showMessageDialog(null, "请先选择用户!");
          return;
        } else {
          try {
            // TUser tUser = tUserService.getByIdService(userID);

            List<TUser> tUserList = memberQueryCardModel.getTCommodityList();
            List<TUser> tUserListOn = new ArrayList();
            for (int i = 0; i < tUserList.size(); i++) {
              if (bools[i]) {
                // Object obj1=tUserList.get(i);
                tUserListOn.add(tUserList.get(i));
                // TRoleRight roleRight=new TRoleRight();
                // roleRight.setTRight((TRight)obj1);
              }
            }
            memberCashSend = new MemberCashSend(null, "会员赠送优惠卷", true);
            memberCashSend.showDialog(tUserListOn);
            table.updateUI();
          } catch (Exception e1) {
            e1.printStackTrace();
          }
        }
      } else {
        JOptionPane.showMessageDialog(null, "请先选择行数据");
      }
    } else if (e.getSource() == chargeButton) {
      // 充值
      if (table.getSelectedRow() != -1) {
        // String userID = (String)table.getValueAt(table.getSelectedRow(), 0);
        boolean[] bools = memberQueryCardModel.getBools();
        boolean select = false; // 检查是否有选中的商品 如果没选中false 否则true
        for (int i = bools.length - 1; i >= 0; --i) {
          if (bools[i]) {
            select = true;
            break;
          }
        }
        if (!select) {
          JOptionPane.showMessageDialog(null, "请先选择用户!");
          return;
        } else {
          try {
            // TUser tUser = tUserService.getByIdService(userID);

            List<TUser> tUserList = memberQueryCardModel.getTCommodityList();
            List<TUser> tUserListOn = new ArrayList();
            for (int i = 0; i < tUserList.size(); i++) {
              if (bools[i]) {
                // Object obj1=tUserList.get(i);
                tUserListOn.add(tUserList.get(i));
                // TRoleRight roleRight=new TRoleRight();
                // roleRight.setTRight((TRight)obj1);
              }
            }
            memberChargeDetailDialog = new MemberChargeDetailDialog(null, "会员充值", true);
            memberChargeDetailDialog.showDialog(tUserListOn);
            table.updateUI();
          } catch (Exception e1) {
            e1.printStackTrace();
          }
        }
      } else {
        JOptionPane.showMessageDialog(null, "请先选择行数据");
      }
    } else if (e.getSource() == memberDetailButton) {
      // 查看会员行为
      if (table.getSelectedRow() != -1) {
        String userID = (String) table.getValueAt(table.getSelectedRow(), -1);
        try {
          TUser tUser = tUserService.getByIdService(userID);
          tUser.setUserID(userID);
          memberBehaviorDialog = new MemberBehaviorDialog(null, "会员行为", true);
          memberBehaviorDialog.showDialog(tUser);
        } catch (Exception e1) {
          e1.printStackTrace();
        }
      } else {
        JOptionPane.showMessageDialog(null, "请先选择行数据");
      }
    } else if (e.getSource() == noticeButton) {
      // 通知
      if (table.getSelectedRow() != -1) {
        boolean[] bools = memberQueryCardModel.getBools();
        boolean select = false; // 检查是否有选中的商品 如果没选中false 否则true
        for (int i = bools.length - 1; i >= 0; --i) {
          if (bools[i]) {
            select = true;
            break;
          }
        }
        if (!select) {
          JOptionPane.showMessageDialog(null, "请先选择用户!");
          return;
        } else {
          try {

            List<TUser> tUserList = memberQueryCardModel.getTCommodityList();
            List<TUser> tUserListOn = new ArrayList();
            for (int i = 0; i < tUserList.size(); i++) {
              if (bools[i]) {
                tUserListOn.add(tUserList.get(i));
              }
            }
            memberNoticeDetailDialog = new MemberNoticeDetailDialog(null, "通知会员", true);
            memberNoticeDetailDialog.showDialog(tUserListOn);
            table.updateUI();
          } catch (Exception e1) {
            e1.printStackTrace();
          }
        }
      } else {
        JOptionPane.showMessageDialog(null, "请先选择行数据");
      }
    } else if (e.getSource() == clearButton) {
      // 清空
      cardNumTF.getText().setText("");
      nameTF.getText().setText("");
      tel.getText().setText("");
      startTimeTF.setDate(null);
      timeTF.setDate(null);
    }
  }
예제 #24
0
 private void limpaTabela() {
   ((DefaultTableModel) jtbVenda.getModel()).setNumRows(0);
   jtbVenda.updateUI();
   inserirLinha();
 }
예제 #25
0
 private void updateTable(Benchmark.Quality q) {
   benchmarkTableModel.setPredictions(
       mode == PredictionType.BugCount ? q.bcPredictions : q.tePredictions);
   benchmarkTable.updateUI();
 }
예제 #26
0
 @Override
 public void run() {
   tableException.updateUI();
 }
 private void removeData() {
   tmDbInfo.removeRow(jtDbinfo.getSelectedRows());
   jtDbinfo.updateUI();
 }
 private void removeDatas() {
   tmDbInfo.removeRows();
   jtDbinfo.updateUI();
 }