Class MigPane

  • All Implemented Interfaces:
    javafx.css.Styleable, javafx.event.EventTarget
    Direct Known Subclasses:
    MigPane

    public class MigPane
    extends javafx.scene.layout.Pane
    Manages nodes with MigLayout added via add(node, CC)
    • Constructor Summary

      Constructors 
      Constructor Description
      MigPane()  
      MigPane​(java.lang.String layoutConstraints)
      use the string layout constraints
      MigPane​(java.lang.String layoutConstraints, java.lang.String colConstraints)
      use the string layout constraints
      MigPane​(java.lang.String layoutConstraints, java.lang.String colConstraints, java.lang.String rowConstraints)
      use the string layout constraints
      MigPane​(LC layoutConstraints)
      use the class layout constraints
      MigPane​(LC layoutConstraints, AC colConstraints)
      use the class layout constraints
      MigPane​(LC layoutConstraints, AC colConstraints, AC rowConstraints)
      use the class layout constraints
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MigPane add​(int index, javafx.scene.Node node)  
      MigPane add​(int index, javafx.scene.Node node, java.lang.String sCc)  
      MigPane add​(int index, javafx.scene.Node node, CC cc)  
      MigPane add​(javafx.scene.Node node)  
      MigPane add​(javafx.scene.Node node, java.lang.String sCc)  
      MigPane add​(javafx.scene.Node node, CC cc)  
      private void addDebugRectangle​(double x, double y, double w, double h, MigPane.DebugRectangleType type)  
      void addLayoutCallback​(LayoutCallback callback)
      Adds the callback function that will be called at different stages of the layout cycle.
      private void adjustWindowSize()
      Checks the parent window/popup if its size is within parameters as set by the LC.
      void animateAdded​(javafx.scene.Node node)  
      boolean animateBoundsChange​(javafx.scene.Node node, int x, int y, int width, int height)  
      void animateRemoved​(javafx.scene.Node node)  
      void clearDebug()  
      protected double computeHeight​(double refWidth, int type)  
      protected double computeMaxHeight​(double width)  
      protected double computeMaxWidth​(double height)  
      protected double computeMinHeight​(double width)  
      protected double computeMinWidth​(double height)  
      protected double computePrefHeight​(double width)  
      protected double computePrefWidth​(double height)  
      protected double computeWidth​(double refHeight, int type)  
      private double constrain​(ContainerWrapper parent, double winSize, double prefSize, BoundSize constrain)  
      private void construct()  
      (package private) void decLayoutInhibit()  
      private LayoutAnimator getAnimator()  
      AC getColumnConstraints()
      ColumnConstraints:
      CC getComponentConstraints​(javafx.scene.Node node)
      Returns the constraints for the node
      javafx.geometry.Orientation getContentBias()  
      javafx.scene.paint.Color getDebugCellColor()
      debugCellColor
      javafx.scene.paint.Color getDebugContainerOutlineColor()
      debugContainerOutlineColor
      javafx.scene.paint.Color getDebugExternalColor()
      debugExternalColor
      javafx.scene.paint.Color getDebugOutlineColor()
      debugOutlineColor
      private Grid getGrid()  
      private int getHorIns()  
      LC getLayoutConstraints()
      LayoutConstraints:
      AC getRowConstraints()
      RowConstraints:
      private int getVerIns()  
      (package private) void incLayoutInhibit()  
      void invalidateGrid()
      Removes the grid so it is recreated as needed next time.
      private boolean isNodeAnimated​(javafx.scene.Node node)  
      protected void layoutChildren()
      This is where the actual layout happens
      javafx.scene.Node remove​(int ix)  
      boolean remove​(javafx.scene.Node node)  
      void removeLayoutCallback​(LayoutCallback callback)
      Removes the callback if it exists.
      void requestLayout()  
      void setColumnConstraints​(AC value)  
      void setComponentConstraints​(javafx.scene.Node node, java.lang.String ccs)
      Sets the constraints for the node
      void setComponentConstraints​(javafx.scene.Node node, CC cc)
      Sets the constraints for the node
      void setDebugCellColor​(javafx.scene.paint.Color value)  
      void setDebugContainerOutlineColor​(javafx.scene.paint.Color value)  
      void setDebugExternalColor​(javafx.scene.paint.Color value)  
      void setDebugOutlineColor​(javafx.scene.paint.Color value)  
      protected void setHeight​(double newHeight)  
      void setLayoutConstraints​(LC lc)  
      void setRowConstraints​(AC value)  
      protected void setWidth​(double newWidth)  
      private double snap​(double v)  
      private void startQueuedAnimations()
      Starts animation if there is one.
      boolean usesMirroring()  
      MigPane withColumnConstraints​(AC value)  
      MigPane withLayoutConstraints​(LC value)  
      MigPane withRowConstraints​(AC value)  
      • Methods inherited from class javafx.scene.layout.Pane

        getChildren
      • Methods inherited from class javafx.scene.layout.Region

        backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getClassCssMetaData, getCssMetaData, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
      • Methods inherited from class javafx.scene.Parent

        getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestParentLayout, setNeedsLayout, updateBounds
      • Methods inherited from class javafx.scene.Node

        accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, viewOrderProperty, visibleProperty
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface javafx.css.Styleable

        getStyleableNode
    • Field Detail

      • gridInvalidator

        private final javafx.beans.value.ChangeListener<java.lang.Boolean> gridInvalidator
      • bias

        private javafx.geometry.Orientation bias
      • biasDirty

        private boolean biasDirty
      • debug

        private boolean debug
      • layoutConstraints

        private LC layoutConstraints
      • LAYOUTCONSTRAINTS_PROPERTY_ID

        public static final java.lang.String LAYOUTCONSTRAINTS_PROPERTY_ID
        See Also:
        Constant Field Values
      • columnConstraints

        private AC columnConstraints
      • COLUMNCONSTRAINTS_PROPERTY_ID

        public static final java.lang.String COLUMNCONSTRAINTS_PROPERTY_ID
        See Also:
        Constant Field Values
      • rowConstraints

        private AC rowConstraints
      • ROWCONSTRAINTS_PROPERTY_ID

        public static final java.lang.String ROWCONSTRAINTS_PROPERTY_ID
        See Also:
        Constant Field Values
      • animPrio

        private int animPrio
      • callbackList

        private java.util.ArrayList<LayoutCallback> callbackList
      • lastSize

        private long lastSize
      • _grid

        private Grid _grid
      • layoutInhibits

        private int layoutInhibits
      • debugRectangles

        private final java.util.List<javafx.scene.Node> debugRectangles
      • debugCellColor

        private javafx.scene.paint.Color debugCellColor
      • debugExternalColor

        private javafx.scene.paint.Color debugExternalColor
      • debugOutlineColor

        private javafx.scene.paint.Color debugOutlineColor
      • debugContainerOutlineColor

        private javafx.scene.paint.Color debugContainerOutlineColor
    • Constructor Detail

      • MigPane

        public MigPane()
      • MigPane

        public MigPane​(LC layoutConstraints)
        use the class layout constraints
      • MigPane

        public MigPane​(LC layoutConstraints,
                       AC colConstraints)
        use the class layout constraints
      • MigPane

        public MigPane​(LC layoutConstraints,
                       AC colConstraints,
                       AC rowConstraints)
        use the class layout constraints
      • MigPane

        public MigPane​(java.lang.String layoutConstraints)
        use the string layout constraints
      • MigPane

        public MigPane​(java.lang.String layoutConstraints,
                       java.lang.String colConstraints)
        use the string layout constraints
      • MigPane

        public MigPane​(java.lang.String layoutConstraints,
                       java.lang.String colConstraints,
                       java.lang.String rowConstraints)
        use the string layout constraints
    • Method Detail

      • construct

        private void construct()
      • computeMinWidth

        protected double computeMinWidth​(double height)
        Overrides:
        computeMinWidth in class javafx.scene.layout.Region
      • computeMinHeight

        protected double computeMinHeight​(double width)
        Overrides:
        computeMinHeight in class javafx.scene.layout.Region
      • computePrefWidth

        protected double computePrefWidth​(double height)
        Overrides:
        computePrefWidth in class javafx.scene.layout.Region
      • computePrefHeight

        protected double computePrefHeight​(double width)
        Overrides:
        computePrefHeight in class javafx.scene.layout.Region
      • computeMaxWidth

        protected double computeMaxWidth​(double height)
        Overrides:
        computeMaxWidth in class javafx.scene.layout.Region
      • computeMaxHeight

        protected double computeMaxHeight​(double width)
        Overrides:
        computeMaxHeight in class javafx.scene.layout.Region
      • computeWidth

        protected double computeWidth​(double refHeight,
                                      int type)
      • computeHeight

        protected double computeHeight​(double refWidth,
                                       int type)
      • getHorIns

        private int getHorIns()
      • getVerIns

        private int getVerIns()
      • getContentBias

        public javafx.geometry.Orientation getContentBias()
        Overrides:
        getContentBias in class javafx.scene.Node
      • getLayoutConstraints

        public LC getLayoutConstraints()
        LayoutConstraints:
      • setLayoutConstraints

        public void setLayoutConstraints​(LC lc)
      • withLayoutConstraints

        public MigPane withLayoutConstraints​(LC value)
      • getColumnConstraints

        public AC getColumnConstraints()
        ColumnConstraints:
      • setColumnConstraints

        public void setColumnConstraints​(AC value)
      • withColumnConstraints

        public MigPane withColumnConstraints​(AC value)
      • getRowConstraints

        public AC getRowConstraints()
        RowConstraints:
      • setRowConstraints

        public void setRowConstraints​(AC value)
      • withRowConstraints

        public MigPane withRowConstraints​(AC value)
      • getComponentConstraints

        public CC getComponentConstraints​(javafx.scene.Node node)
        Returns the constraints for the node
        Returns:
        May be null which means all default constraints.
      • setComponentConstraints

        public void setComponentConstraints​(javafx.scene.Node node,
                                            java.lang.String ccs)
        Sets the constraints for the node
        Parameters:
        node - The node. Must already be in the pane.
        ccs - The component constraints.
      • setComponentConstraints

        public void setComponentConstraints​(javafx.scene.Node node,
                                            CC cc)
        Sets the constraints for the node
        Parameters:
        node - The node. Must already be in the pane.
        cc - The component constraints. Can be null.
      • getAnimator

        private LayoutAnimator getAnimator()
        Returns:
        If there is a current animator, that is returned. Otherwise a new one is created and returned. Never null.
      • startQueuedAnimations

        private void startQueuedAnimations()
        Starts animation if there is one.
      • animateAdded

        public void animateAdded​(javafx.scene.Node node)
      • animateRemoved

        public void animateRemoved​(javafx.scene.Node node)
      • animateBoundsChange

        public boolean animateBoundsChange​(javafx.scene.Node node,
                                           int x,
                                           int y,
                                           int width,
                                           int height)
      • isNodeAnimated

        private boolean isNodeAnimated​(javafx.scene.Node node)
      • addLayoutCallback

        public void addLayoutCallback​(LayoutCallback callback)
        Adds the callback function that will be called at different stages of the layout cycle.
        Parameters:
        callback - The callback. Not null.
      • removeLayoutCallback

        public void removeLayoutCallback​(LayoutCallback callback)
        Removes the callback if it exists.
        Parameters:
        callback - The callback. May be null.
      • add

        public MigPane add​(javafx.scene.Node node,
                           CC cc)
      • add

        public MigPane add​(javafx.scene.Node node)
      • add

        public MigPane add​(javafx.scene.Node node,
                           java.lang.String sCc)
      • add

        public MigPane add​(int index,
                           javafx.scene.Node node)
      • add

        public MigPane add​(int index,
                           javafx.scene.Node node,
                           java.lang.String sCc)
      • add

        public MigPane add​(int index,
                           javafx.scene.Node node,
                           CC cc)
      • remove

        public boolean remove​(javafx.scene.Node node)
      • remove

        public javafx.scene.Node remove​(int ix)
      • layoutChildren

        protected void layoutChildren()
        This is where the actual layout happens
        Overrides:
        layoutChildren in class javafx.scene.Parent
      • setWidth

        protected void setWidth​(double newWidth)
        Overrides:
        setWidth in class javafx.scene.layout.Region
      • setHeight

        protected void setHeight​(double newHeight)
        Overrides:
        setHeight in class javafx.scene.layout.Region
      • requestLayout

        public void requestLayout()
        Overrides:
        requestLayout in class javafx.scene.Parent
      • incLayoutInhibit

        void incLayoutInhibit()
      • decLayoutInhibit

        void decLayoutInhibit()
      • getGrid

        private Grid getGrid()
      • invalidateGrid

        public void invalidateGrid()
        Removes the grid so it is recreated as needed next time. Should only be needed when the grid structure, or the interpretation of it, has changed. Should normally don't have to be called by client code since this should be fully handled by MigPane.
      • adjustWindowSize

        private void adjustWindowSize()
        Checks the parent window/popup if its size is within parameters as set by the LC.
      • usesMirroring

        public boolean usesMirroring()
        Overrides:
        usesMirroring in class javafx.scene.Node
      • clearDebug

        public void clearDebug()
      • addDebugRectangle

        private void addDebugRectangle​(double x,
                                       double y,
                                       double w,
                                       double h,
                                       MigPane.DebugRectangleType type)
      • snap

        private double snap​(double v)
      • getDebugCellColor

        public javafx.scene.paint.Color getDebugCellColor()
        debugCellColor
      • setDebugCellColor

        public void setDebugCellColor​(javafx.scene.paint.Color value)
      • getDebugExternalColor

        public javafx.scene.paint.Color getDebugExternalColor()
        debugExternalColor
      • setDebugExternalColor

        public void setDebugExternalColor​(javafx.scene.paint.Color value)
      • getDebugOutlineColor

        public javafx.scene.paint.Color getDebugOutlineColor()
        debugOutlineColor
      • setDebugOutlineColor

        public void setDebugOutlineColor​(javafx.scene.paint.Color value)
      • getDebugContainerOutlineColor

        public javafx.scene.paint.Color getDebugContainerOutlineColor()
        debugContainerOutlineColor
      • setDebugContainerOutlineColor

        public void setDebugContainerOutlineColor​(javafx.scene.paint.Color value)