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).getRParenthesis() != null) {
        ((ICustomStatisticCaliber) myCaliber)
            .setRParenthesis(((ICustomStatisticCaliber) cal.getACal()).getRParenthesis() + ")");
      } else {
        ((ICustomStatisticCaliber) myCaliber).setRParenthesis(")");
      }
      curTreeNode.setUserObject(cal);
      // 刷新节点中文名称
      refreshNodeChName(curTreeNode);
      // 刷新节点
      ((DefaultTreeModel) treWhere.getModel()).nodeChanged(curTreeNode);
    }
Exemplo n.º 2
0
    public String toString() {

      XMLData aData = (XMLData) calcColumnDialog.getXmlDsFieldToName().get(aCal.getSourceID());
      if (aData == null) return "";
      String fieldName = (String) aData.get(aCal.getSourceColID());
      String oper = CompareType.getComparTypeName(aCal.getCompareType());
      String join = "";
      if (!isFirstNode) {
        if (aCal.getJoinBefore() == null) {
          join = "";
        } else {
          join = frdoType.getRefModel().getNameByValue(aCal.getJoinBefore()).substring(0, 2);
        }
      }

      // String sSourceName = definePub.getDataSourceNameWithID(
      // calcColumnDialog.getQuerySource(), aCal.getSourceID());
      String result = "";
      if (!Common.isNullStr(join)) {
        result = result + join + " ";
      }

      if (aCal instanceof ICustomStatisticCaliber) {
        if (((ICustomStatisticCaliber) aCal).getLParenthesis() != null) {
          result = result + ((ICustomStatisticCaliber) aCal).getLParenthesis();
        }
      }

      if (!Common.isNullStr(fieldName)) {
        result = result + fieldName + "   ";
      }
      if (!Common.isNullStr(oper)) {
        result = result + oper + "   ";
      }
      result = result + aCal.getValue();

      if (aCal instanceof ICustomStatisticCaliber) {
        if (((ICustomStatisticCaliber) aCal).getRParenthesis() != null) {
          result = result + ((ICustomStatisticCaliber) aCal).getRParenthesis();
        }
      }

      return result;
      // join + " "
      // + sSourceName + "."
      // + fieldName + " " + oper + " " + aCal.getValue();

    }