Exemplo n.º 1
0
    public void actionPerformed(ActionEvent arg0) {
      DefaultMutableTreeNode curTreeNode =
          (DefaultMutableTreeNode) treWhere.getLastSelectedPathComponent();
      if (curTreeNode == null || !curTreeNode.isLeaf()) return;

      Caliber cal = (Caliber) curTreeNode.getUserObject();
      IStatisticCaliber myCaliber = cal.getACal();
      if (!(myCaliber instanceof ICustomStatisticCaliber)) {
        ICustomStatisticCaliber caliberTmp = new MySummaryStatisticCaliberImpl();
        caliberTmp.setAddSQL(myCaliber.getAddSQL());
        caliberTmp.setCompareType(myCaliber.getCompareType());
        caliberTmp.setJoinBefore(myCaliber.getJoinBefore());
        caliberTmp.setSourceColID(myCaliber.getSourceColID());
        caliberTmp.setSourceID(myCaliber.getSourceID());
        caliberTmp.setValue(myCaliber.getValue());
        caliberTmp.setCaliberID(DefinePub.getRandomUUID());
        cal.setACal(caliberTmp);
      }

      myCaliber = cal.getACal();
      if (((ICustomStatisticCaliber) myCaliber).getLParenthesis() != null) {
        ((ICustomStatisticCaliber) myCaliber)
            .setLParenthesis(((ICustomStatisticCaliber) cal.getACal()).getLParenthesis() + "(");
      } else {
        ((ICustomStatisticCaliber) myCaliber).setLParenthesis("(");
      }
      curTreeNode.setUserObject(cal);
      // 刷新节点中文名称
      refreshNodeChName(curTreeNode);
      // 刷新节点
      ((DefaultTreeModel) treWhere.getModel()).nodeChanged(curTreeNode);
    }
Exemplo n.º 2
0
    public void actionPerformed(ActionEvent arg0) {

      DefaultMutableTreeNode curTreeNode =
          (DefaultMutableTreeNode) treWhere.getLastSelectedPathComponent();
      if (curTreeNode == null || !curTreeNode.isLeaf()) return;
      Caliber cal = (Caliber) curTreeNode.getUserObject();
      if (cal.getACal() instanceof ICustomStatisticCaliber) {
        ICustomStatisticCaliber myCal = (ICustomStatisticCaliber) cal.getACal();
        myCal.setLParenthesis("");
        myCal.setRParenthesis("");
        curTreeNode.setUserObject(cal);
        // 刷新节点中文名称
        refreshNodeChName(curTreeNode);
        // 刷新节点
        ((DefaultTreeModel) treWhere.getModel()).nodeChanged(curTreeNode);
      }
    }