示例#1
0
 private void registAddr() {
   // 注册显现地址值
   if (showByAddr && null != info.getShowInfo().getShowAddrProp()) {
     ADDRTYPE addrType = info.getShowInfo().geteAddrType();
     if (addrType == ADDRTYPE.BITADDR) {
       SKPlcNoticThread.getInstance()
           .addNoticProp(info.getShowInfo().getShowAddrProp(), showCall, true, sceneId);
     } else {
       SKPlcNoticThread.getInstance()
           .addNoticProp(info.getShowInfo().getShowAddrProp(), showCall, false, sceneId);
     }
   }
 }
示例#2
0
 @Override
 public boolean setItemAlpha(int id, int alpha) {
   // TODO Auto-generated method stub
   if (info == null || alpha < 0 || alpha > 255) {
     return false;
   }
   if (info.getnAlpha() == alpha) {
     return true;
   }
   info.setnAlpha(alpha);
   mFreeLineItem.setLineAlpha(alpha);
   SKSceneManage.getInstance().onRefresh(items);
   return false;
 }
示例#3
0
 @Override
 public int getItemWidth(int id) {
   if (info != null) {
     return info.getnWidth();
   }
   return -1;
 }
示例#4
0
  @Override
  public boolean setItemLineColor(int id, short r, short g, short b) {
    // TODO Auto-generated method stub
    if (info == null) {
      return false;
    }

    int color = Color.rgb(r, g, b);

    if (color == info.getnLineColor()) {
      return true;
    }
    info.setnLineColor(color);
    mFreeLineItem.setLineColor(color);
    SKSceneManage.getInstance().onRefresh(items);
    return true;
  }
示例#5
0
 @Override
 public short[] getItemLineColor(int id) {
   // TODO Auto-generated method stub
   if (info != null) {
     return getColor(info.getnLineColor());
   }
   return null;
 }
示例#6
0
 @Override
 public int getItemHeight(int id) {
   // TODO Auto-generated method stub
   if (info != null) {
     return info.getnHeight();
   }
   return -1;
 }
示例#7
0
 @Override
 public int getItemTop(int id) {
   // TODO Auto-generated method stub
   if (info != null) {
     return info.getnStartY();
   }
   return -1;
 }
示例#8
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;
 }
示例#9
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;
 }
示例#10
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;
 }
示例#11
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;
 }
示例#12
0
 @Override
 public boolean drawGraphics(Canvas canvas, int itemId) {
   // TODO Auto-generated method stub
   if (null == info) {
     return false;
   }
   if (itemId == info.getId()) {
     if (mFreeLineItem != null && isShowFlag) {
       mFreeLineItem.draw(mPaint, canvas);
     }
     return true;
   }
   return false;
 }
示例#13
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();
    }
  }
示例#14
0
 private void freeIsShow() {
   if (showByAddr || showByUser) {
     isShowFlag = popedomIsShow(info.getShowInfo());
   }
 }