I would create an adapter around your 2D object, which intercepts requested window position, consults the underlying 2D object, and returns an appropriately constructed result. This way you may use any underlying implementation (like the one you linked to) and get the desired result.
Think in terms of the following pseudo-code:
View getView(int leftX, int topY) {
if (leftX >= 0 and
topY >= 0 and
leftX <= underlying.width() - viewWidth and
topX <= underlying.height() - viewHeight)
{
return underlying.getView(leftX, topY);
}
// else make your own view and populate it
View view = new View()
for (int i = 0; i < viewWidth; ++i)
for (int j = 0; j < viewHeight; ++j)
view.set(i, j) = underlying.get((leftX + i) % underlying.width(), (topY + j) % underlying.height())
}
If you end up using this code, make sure that negative indices modulo something gives a positive result. If not, use viewWidth - negative_modulo to get the right index.