void (Object component, int contentwidth, int contentheight, int rowwidth, int columnheight) { Rectangle bounds = getRectangle(component, "bounds"); boolean hneed = false; boolean vneed = false; if (contentwidth > bounds.width - rowwidth - 2) { hneed = true; vneed = (contentheight > bounds.height - columnheight - 2 - block); } if (vneed || (contentheight > bounds.height - columnheight - 2)) { vneed = true; hneed = hneed || (contentwidth > bounds.width - rowwidth - 2 - block); } int viewportwidth = bounds.width - rowwidth - (vneed ? block : 0); int viewportheight = bounds.height - columnheight - (hneed ? block : 0); setRectangle(component, ":port", rowwidth, columnheight, viewportwidth, viewportheight); //?rowwidth Rectangle view = getRectangle(component, ":view"); setRectangle(component, ":view", (view != null) ? Math.max(0, Math.min(view.x, contentwidth - viewportwidth + 2)) : 0, (view != null) ? Math.max(0, Math.min(view.y, contentheight - viewportheight + 2)) : 0, Math.max(viewportwidth - 2, contentwidth), Math.max(viewportheight - 2, contentheight)); }