JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

Profile: desktop, common

Overview

MigLayout node for JavaFX.

This node uses the popular MigLayout Java layout manager to perform layout of JavaFx nodes. If you are familiar with MigLayout out for Java, you should feel right at home. MigLayout is an advanced grid-based layout manager that also support absolute positioning and docking (similar to Swing's BorderLayout) where nodes are docked to the north, south, east, or west side of the layout.

 MigLayout {
     constraints: "fill"
     content: Rectangle {
         width: 100
         height: 100
         layoutInfo: MigNodeLayoutInfo {
             constraints: "center"
         }
     }
 }
 

This file also contains module functions that can reduce the boiler-plate code required to set the layoutInfo. The nodeConstraints function takes a MigLayout constraints string and returns a MigNodeLayoutInfo object. Using this function the previous example can be rewritten as below.

 MigLayout {
     constraints: "fill"
     content: Rectangle {
         width: 100
         height: 100
         layoutInfo: nodeConstraints( "center" )
     }
 }
 

TODO: - Support GridLayoutInfo using LC and AC

Profile: desktop

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publiccolumnsString

The column constraints.

The column constraints. All of the valid MigLayout column constraints are supported: sizegroup, fill, grow, align, gap.

 
publicconstraintsString

The layout constraints string.

The layout constraints string. All of the valid MigLayout constraints except for "debug" are supported. For example: wrap, insets, nogrid, fill, flow, align, etc.

 
publicrowsString

The row constraints.

The row constraints. All of the valid MigLayout row constraints are supported: sizegroup, fill, grow, align, gap.

 

Inherited Variables

org.jfxtras.scene.layout.DefaultLayout

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
public-read protecteddefaultLayoutInfoLayoutInfoBasesubclasssubclass

The default layout info for this Node.

The default layout info for this Node.

Usually this will be initialized by the Node subclass to a static LayoutInfo for all instances. Any values set on this will override the default Constraint values.

 

Script Function Summary

public migNode(node: javafx.scene.Node, constraints: java.lang.String) : javafx.scene.Node

Use this function to associate the provided constraints string with the provided node's layout info.

Use this function to associate the provided constraints string with the provided node's layout info. This can be helpful if you already have a node that was created elsewhere and you just need to add some node constraints before adding it to a MigLayout.

Parameters
node
constraints
Returns
Node
 
public nodeConstraints(constraints: java.lang.String) : MigNodeLayoutInfo

This function is a short cut for creating a MigNodeLayoutInfo object with the provided constraints.

This function is a short cut for creating a MigNodeLayoutInfo object with the provided constraints.

Parameters
constraints
Returns
MigNodeLayoutInfo
 

Inherited Functions