Ejemplo n.º 1
0
 @Override
 public boolean setItemTop(int id, int y) {
   // TODO Auto-generated method stub
   if (info != null) {
     if (y == info.getnStartY()) {
       return true;
     }
     if (y < 0 || y > SKSceneManage.getInstance().getSceneInfo().getnSceneHeight()) {
       return false;
     }
     int hen = y - info.getnStartY();
     info.setnStartY(y);
     int t = items.rect.top;
     items.rect.top = y;
     items.rect.bottom = y - t + items.rect.bottom;
     items.mMoveRect = new Rect();
     if (info.getfPointList() != null) {
       for (int i = 0; i < info.getfPointList().size(); i++) {
         PointF p = info.getfPointList().get(i);
         p.y = p.y + hen;
       }
     }
     SKSceneManage.getInstance().onRefresh(items);
   } else {
     return false;
   }
   return true;
 }
Ejemplo n.º 2
0
 @Override
 public boolean setItemLeft(int id, int x) {
   // TODO Auto-generated method stub
   if (info != null) {
     if (x == info.getnStartX()) {
       return true;
     }
     if (x < 0 || x > SKSceneManage.getInstance().getSceneInfo().getnSceneWidth()) {
       return false;
     }
     int len = x - info.getnStartX();
     info.setnStartX(x);
     int l = items.rect.left;
     items.rect.left = x;
     items.rect.right = x - l + items.rect.right;
     items.mMoveRect = new Rect();
     if (info.getfPointList() != null) {
       for (int i = 0; i < info.getfPointList().size(); i++) {
         PointF p = info.getfPointList().get(i);
         p.x = p.x + len;
       }
     }
     SKSceneManage.getInstance().onRefresh(items);
   } else {
     return false;
   }
   return true;
 }
Ejemplo n.º 3
0
 @Override
 public boolean setItemHeight(int id, int h) {
   // TODO Auto-generated method stub
   if (info != null) {
     if (h == info.getnHeight()) {
       return true;
     }
     if (h < 0 || h > SKSceneManage.getInstance().getSceneInfo().getnSceneHeight()) {
       return false;
     }
     info.setnHeight(h);
     items.rect.bottom = h - items.rect.height() + items.rect.bottom;
     items.mMoveRect = new Rect();
     SKSceneManage.getInstance().onRefresh(items);
   } else {
     return false;
   }
   return true;
 }
Ejemplo n.º 4
0
 @Override
 public boolean setItemWidth(int id, int w) {
   // TODO Auto-generated method stub
   if (info != null) {
     if (w == info.getnWidth()) {
       return true;
     }
     if (w < 0 || w > SKSceneManage.getInstance().getSceneInfo().getnSceneWidth()) {
       return false;
     }
     info.setnWidth(w);
     items.rect.right = w - items.rect.width() + items.rect.right;
     items.mMoveRect = new Rect();
     SKSceneManage.getInstance().onRefresh(items);
   } else {
     return false;
   }
   return true;
 }
Ejemplo n.º 5
0
 @Override
 public boolean setItemTop(int id, int y) {
   // TODO Auto-generated method stub
   if (info != null) {
     if (y == info.getnStartY()) {
       return true;
     }
     if (y < 0 || y > SKSceneManage.getInstance().getSceneInfo().getnSceneHeight()) {
       return false;
     }
     info.setnStartY(y);
     int t = items.rect.top;
     items.rect.top = y;
     items.rect.bottom = y - t + items.rect.bottom;
     items.mMoveRect = new Rect();
     text.setStartY(y);
     SKSceneManage.getInstance().onRefresh(items);
   } else {
     return false;
   }
   return true;
 }
Ejemplo n.º 6
0
  public SKFreeLine(int itemId, int sceneId, LineInfo info) {
    // TODO Auto-generated constructor stub
    this.sceneId = sceneId;
    this.itemId = itemId;
    pointList = new Vector<Point>();
    isShowFlag = true;
    showByAddr = false;
    showByUser = false;
    mPaint = new Paint();
    items = new SKItems();
    this.info = info;
    if (info != null) {
      mRect =
          new Rect(
              info.getnStartX(),
              info.getnStartY(),
              info.getnStartX() + info.getnWidth(),
              info.getnStartY() + info.getnHeight());
      items.itemId = this.itemId;
      items.nCollidindId = info.getnCollidindId();
      items.nZvalue = info.getnZvalue();
      items.sceneId = sceneId;
      items.rect = mRect;
      items.mGraphics = this;

      mFreeLineItem = new FreeLineItem(info.getfPointList(), info.geteLineArrow());
      mFreeLineItem.setAlpha(info.getnAlpha());
      mFreeLineItem.setEndArrowType(info.geteLineArrow());
      mFreeLineItem.setLineColor(info.getnLineColor());
      mFreeLineItem.setLineType(info.geteLineType());
      mFreeLineItem.setLineWidth(info.getnLineWidth());
      mFreeLineItem.setEndPointType(info.getEndPointType());

      if (null != info.getShowInfo()) {
        if (-1 != info.getShowInfo().getnAddrId() && info.getShowInfo().isbShowByAddr()) {
          showByAddr = true;
        }
        if (info.getShowInfo().isbShowByUser()) {
          showByUser = true;
        }
      }
      registAddr();
    }
  }
Ejemplo n.º 7
0
  @Override
  public boolean setItemLeft(int id, int x) {
    // TODO Auto-generated method stub

    if (info != null) {
      if (x == info.getnStartX()) {
        return true;
      }
      if (x < 0 || x > SKSceneManage.getInstance().getSceneInfo().getnSceneWidth()) {
        return false;
      }

      int l = items.rect.left;
      info.setnStartX(x);
      items.rect.left = x;
      items.rect.right = x - l + items.rect.right;
      items.mMoveRect = new Rect();
      text.setStartX(x);
      SKSceneManage.getInstance().onRefresh(items);
    } else {
      return false;
    }
    return true;
  }
Ejemplo n.º 8
0
  public SKASCIIDisplay(Context context, int itemId, int sceneId, AcillInputInfo info) {
    mContext = context;
    isOnclick = false;
    isTouchFlag = true;
    isShowFlag = true;
    showByUser = false;
    touchByUser = false;
    showByAddr = false;
    touchByAddr = false;
    // keyIsShow = true;
    this.sceneId = sceneId;
    this.itemId = itemId;
    showValue = "";
    mPaint = new Paint();
    items = new SKItems();
    this.info = info;
    notTouchOpenKey = false;

    if (info != null) {
      mRect = new Rect();
      mRect.left = info.getnStartX();
      mRect.right = info.getnStartX() + info.getnWidth();
      mRect.top = info.getnStartY();
      mRect.bottom = info.getnStartY() + info.getnHeight();

      text = new StaticTextModel();
      text.setM_backColorPadding(info.getnBackColor());
      text.setM_eTextAlign(info.getnShowStyle());
      text.setM_nFontColor(info.getnFontColor());
      text.setM_nFontSize(info.getnFontsize());
      text.setM_sFontFamly(info.getsFontStyle());
      text.setM_textLanguageId(1);
      text.setM_textPro((short) (info.geteFontCss()));
      text.setStartX(info.getnTextStartX());
      text.setStartY(info.getnTextStartY());
      text.setRectHeight(info.getnTextHeight());
      text.setRectWidth(info.getnTextWidth());
      text.setM_alphaPadding(info.getnTransparent()); // 设置透明度
      //			if (info.getnTransparent() == 0) {
      //				text.setBorderAlpha(255);
      //				text.setLineColor(Color.BLACK);
      //				text.setLineWidth(1);
      //			}

      textItem = new TextItem(text);
      textItem.initTextPaint();
      textItem.initRectBoderPaint();
      textItem.initRectPaint();

      items.itemId = this.itemId;
      items.nCollidindId = info.getnCollidindId();
      items.nZvalue = info.getnZvalue();
      items.sceneId = sceneId;
      items.rect = mRect;
      items.mGraphics = this;

      if (null != info.getmTouchinInfo()) {
        if (-1 != info.getmTouchinInfo().getnAddrId() && info.getmTouchinInfo().isbTouchByAddr()) {
          touchByAddr = true;
        }
        if (info.getmTouchinInfo().isbTouchByUser()) {
          touchByUser = true;
        }
      }
      if (null != info.getmShowInfo()) {
        if (-1 != info.getmShowInfo().getnAddrId() && info.getmShowInfo().isbShowByAddr()) {
          showByAddr = true;
        }
        if (info.getmShowInfo().isbShowByUser()) {
          showByUser = true;
        }
      }

      // 注册地址值
      registAddr();
    }
  }