public RelativeContent(Content content, Point2D position) { content.addParent(this); this.content = content; this.position = position; refreshUp(); }
/** * add a content to layout * @param content */ public void add(Content content) { if(null == content) { throw new NullPointerException("Content can't be null"); } content.addParent(this); contents.add(content); refresh(); }
/** * Default constructor * @param content * @throws NullPointerException */ public CenterContent(Content content) { if(null == content) { throw new NullPointerException("content can't be null"); } content.addParent(this); this.content = content; content.refresh(); // updateOffsetPoint(); }
/** * set new content for shape * @param content */ protected final void setContent(Content content) { if(null != this.content) { this.content.removeParent(this); } if(null == content) { content = new EmptyContent(); } content.addParent(this); this.content = content; refreshUp(); }
public PaddingContent(Content content, double top, double left, double bottom, double right) { this.content = content; this.top = new EmptyContent(); this.left = new EmptyContent(); this.bottom = new EmptyContent(); this.right = new EmptyContent(); setTopPadding(top); setLeftPadding(left); setBottomPadding(bottom); setRightPadding(right); HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.add(this.left); horizontalLayout.add(this.content); horizontalLayout.add(this.right); layout = new VerticalLayout(); layout.add(this.top); layout.add(horizontalLayout); layout.add(this.bottom); this.content.addParent(this); }