Exemplo n.º 1
0
  private void createAdapters() {

    // if ( TDSetting.mLevelOverBasic )
    {
      mPointAdapter = new ItemAdapter(mContext, this, R.layout.item, new ArrayList<ItemSymbol>());
      int np = mPointLib.mSymbolNr;
      for (int i = 0; i < np; ++i) {
        SymbolPoint p = (SymbolPoint) mPointLib.getSymbolByIndex(i);
        if (p.isEnabled()) {
          mPointAdapter.add(
              new ItemSymbol(mContext, this, DrawingActivity.SYMBOL_POINT, i, p, mUseText));
        }
      }
      mPointAdapter.setSelectedItem(mParent.mCurrentPoint);
    }

    mLineAdapter = new ItemAdapter(mContext, this, R.layout.item, new ArrayList<ItemSymbol>());
    int nl = mLineLib.mSymbolNr;
    for (int j = 0; j < nl; ++j) {
      SymbolLine l = (SymbolLine) mLineLib.getSymbolByIndex(j);
      if (l.isEnabled()) {
        mLineAdapter.add(
            new ItemSymbol(mContext, this, DrawingActivity.SYMBOL_LINE, j, l, mUseText));
      }
    }
    mLineAdapter.setSelectedItem(mParent.mCurrentLine);

    // if ( TDSetting.mLevelOverBasic )
    {
      mAreaAdapter = new ItemAdapter(mContext, this, R.layout.item, new ArrayList<ItemSymbol>());
      int na = mAreaLib.mSymbolNr;
      for (int k = 0; k < na; ++k) {
        SymbolArea a = (SymbolArea) mAreaLib.getSymbolByIndex(k);
        if (a.isEnabled()) {
          mAreaAdapter.add(
              new ItemSymbol(mContext, this, DrawingActivity.SYMBOL_AREA, k, a, mUseText));
        }
      }
      mAreaAdapter.setSelectedItem(mParent.mCurrentArea);
    }
  }
Exemplo n.º 2
0
 private void setTheTitle() {
   StringBuilder title = new StringBuilder();
   switch (mItemType) {
     case DrawingActivity.SYMBOL_POINT:
       title.append("[");
       title.append(DrawingPointPath.scaleToStringUC(mScale));
       title.append("] ");
       title.append(mContext.getResources().getString(R.string.POINT));
       title.append(" ");
       title.append(mPointLib.getSymbolName(mParent.mCurrentPoint));
       break;
     case DrawingActivity.SYMBOL_LINE:
       title.append(mContext.getResources().getString(R.string.LINE));
       title.append(" ");
       title.append(mLineLib.getSymbolName(mParent.mCurrentLine));
       break;
     case DrawingActivity.SYMBOL_AREA:
       title.append(mContext.getResources().getString(R.string.AREA));
       title.append(" ");
       title.append(mAreaLib.getSymbolName(mParent.mCurrentArea));
       break;
   }
   setTitle(title.toString());
 }