void () { myContext.setArea(myArea); myContext.setInputEvent(myInputEvent); myContext.setModifiers(myModifiers); Point move = new Point(); Dimension size = new Dimension(); int moveDeltaWidth = moveDeltaWidth(); if ((myDirection & Position.WEST) != 0) { move.x += moveDeltaWidth; size.width -= moveDeltaWidth; } else if ((myDirection & Position.EAST) != 0) { size.width += moveDeltaWidth; } int moveDeltaHeight = moveDeltaHeight(); if ((myDirection & Position.NORTH) != 0) { move.y += moveDeltaHeight; size.height -= moveDeltaHeight; } else if ((myDirection & Position.SOUTH) != 0) { size.height += moveDeltaHeight; } myContext.setMoveDelta(move); myContext.setSizeDelta(size); myContext.setLocation(getLocation()); }