예제 #1
0
 @Override
 public short[] getItemLineColor(int id) {
   // TODO Auto-generated method stub
   if (info != null) {
     return getColor(info.getnLineColor());
   }
   return null;
 }
예제 #2
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;
  }
예제 #3
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();
    }
  }