Class NoDimension

  • All Implemented Interfaces:
    Dimension

    public final class NoDimension
    extends java.lang.Object
    implements Dimension
    Dimension without constraint.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static NoDimension NO_DIMENSION
      NoDimension singleton to avoid creating several ones.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void computeOptimalSize​(Widget widget, int availableWidth, int availableHeight, Size optimalSize)
      Computes the optimal size of a widget.
      boolean equals​(java.lang.Object obj)  
      void getAvailableSize​(Widget widget, int availableWidth, int availableHeight, Size availableSize)
      Gets the available size for a widget.
      int hashCode()  
      void layOut​(Widget widget, Rectangle bounds)
      Lays out a widget.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NO_DIMENSION

        public static final NoDimension NO_DIMENSION
        NoDimension singleton to avoid creating several ones.
    • Method Detail

      • getAvailableSize

        public void getAvailableSize​(Widget widget,
                                     int availableWidth,
                                     int availableHeight,
                                     Size availableSize)
        Description copied from interface: Dimension
        Gets the available size for a widget.

        The given available size is the available width and height minus the outlines.

        The given size is updated by this method to set the available size for this dimension.

        Specified by:
        getAvailableSize in interface Dimension
        Parameters:
        widget - the widget.
        availableWidth - the available width.
        availableHeight - the available height.
        availableSize - the available size.
      • computeOptimalSize

        public void computeOptimalSize​(Widget widget,
                                       int availableWidth,
                                       int availableHeight,
                                       Size optimalSize)
        Description copied from interface: Dimension
        Computes the optimal size of a widget.

        The given optimal size is the optimal size of the widget considering the available size.

        The given size is updated by this method to set the optimal size for this dimension.

        Specified by:
        computeOptimalSize in interface Dimension
        Parameters:
        widget - the widget.
        availableWidth - the available width.
        availableHeight - the available height.
        optimalSize - the optimal size.
      • layOut

        public void layOut​(Widget widget,
                           Rectangle bounds)
        Description copied from interface: Dimension
        Lays out a widget.

        The style of the widget must be set before (not null).

        This dimension is applied to compute the widget bounds and align the widget in the given bounds. The given rectangle is updated with the updated bounds.

        Specified by:
        layOut in interface Dimension
        Parameters:
        widget - the widget.
        bounds - the bounds of the widget.
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object obj)
        Specified by:
        equals in interface Dimension
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface Dimension
        Overrides:
        hashCode in class java.lang.Object