/** * Overriden to implement defaut automatic layout Container will be located 50 pixels (1.0 scale) * above parent node */ @Override public double getDefaultY() { if (getWKFContainerGR() != null) { WKFObjectGR containerGR = getWKFContainerGR(); return containerGR.getLocationInDrawing().y + containerGR.getHeight() + 50; } return 0; }
/** * Overriden to implement defaut automatic layout Container will be horizontal centered above * parent node */ @Override public double getDefaultX() { if (getWKFContainerGR() != null) { WKFObjectGR containerGR = getWKFContainerGR(); return Math.max( 0, containerGR.getLocationInDrawing().x - (getWidth() - containerGR.getWidth()) / 2); } return 0; }