[API Review] RT-19898: Update constructors to panes (including ScrollPane) to take content
Scott Palmer
swpalmer at gmail.com
Wed Jan 23 16:39:04 PST 2013
Should there be more constructors for BorderPane? Or more arguments, or both? It seems overly simplistic to only provide the center. I almost always choose a BorderPane because I need at least two of the layout areas to be populated.
public BorderPane(center)
public BorderPane(center, top)
public BorderPane(center, top, left)
public BorderPane(center, top, left, right)
public BorderPane(center, top, left, right, bottom)
I'm not suggesting that the above order is the best.
Scott
On 2013-01-23, at 6:45 PM, Richard Bair <richard.bair at oracle.com> wrote:
> http://javafx-jira.kenai.com/browse/RT-19898
>
> Another relatively straightforward one (I hope!). In this case I am just adding some constructors to layout panes (and scroll pane):
>
> public AnchorPane(Node... children) {
> public BorderPane(Node center) {
> public FlowPane(Node... children) {
> public FlowPane(Orientation orientation, Node... children) {
> public FlowPane(double hgap, double vgap, Node... children) {
> public FlowPane(Orientation orientation, double hgap, double vgap, Node... children) {
> public HBox(Node... children) {
> public HBox(double spacing, Node... children) {
> public Pane(Node... children) {
> public StackPane(Node... children) {
> public TilePane(Node... children) {
> public TilePane(Orientation orientation, Node... children) {
> public TilePane(double hgap, double vgap, Node... children) {
> public TilePane(Orientation orientation, double hgap, double vgap, Node... children) {
> public ScrollPane(Node content) {
>
> In the case of BorderPane and ScrollPane there is a single child rather than a list of them (not that BorderPane can't handle a list, just that it generally doesn't make sense). The others are just varargs of children, and all end up calling getChildren().addAll(children). BorderPane calls setCenter(center) and ScrollPane calls setContent(content). I always let the list of children come last.
>
> Richard
More information about the openjfx-dev
mailing list