protected void dragSelectedObjectsBy(int x, int y) { Rectangle update = null; for (Iterator it = renderer.getSelectedObjectPainters().iterator(); it.hasNext(); ) { WorldRenderer.ObjectPainter objPainter = (WorldRenderer.ObjectPainter) it.next(); Rectangle r = renderer.dragObjectPainterBy(objPainter, x, y); if (r != null) { if (update == null) { update = r; } else { update = update.union(r); } } } if (update != null) { redraw(update.x, update.y, update.width, update.height, true); } }
protected void startDraggingSelectedObjects() { Rectangle update = null; for (Iterator<ObjectPainter> it = renderer.getSelectedObjectPainters().iterator(); it.hasNext(); ) { WorldRenderer.ObjectPainter objPainter = it.next(); lockedObjects.add(objPainter.originalObject); Rectangle r = renderer.startDragging(objPainter); if (r != null) { if (update == null) { update = r; } else { update = update.union(r); } } } if (update != null) { redraw(update.x, update.y, update.width, update.height, false); } }
/* (non-Javadoc) * @see org.micropsi.eclipse.worldconsole.ILocalWorldListener#OnSelectionChanged(org.micropsi.eclipse.worldconsole.LocalWorld) */ public void onSelectionChanged(EditSession session, Collection changeList) { if (isDisposed()) { return; } Rectangle update = null; for (Iterator it = changeList.iterator(); it.hasNext(); ) { WorldObject obj = ((AbstractWorldObject) it.next()).getRootObject(); Rectangle r = renderer.updateSelectionState(obj); if (r != null) { if (update == null) { update = r; } else { update = update.union(r); } } } if (update != null) { redraw(update.x, update.y, update.width, update.height, true); } }