@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; }
@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; }
@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; }
@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; }
@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; }
@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; }