Class RadialLayout

  • All Implemented Interfaces:
    java.awt.LayoutManager, java.io.Serializable

    public class RadialLayout
    extends java.lang.Object
    implements java.awt.LayoutManager, java.io.Serializable
    RadialLayout is a component layout manager. Compents are laid out in a circle. If only one component is contained in the layout it is positioned centrally, otherwise components are evenly spaced around the centre with the first component placed to the North.

    This code was developed to display CTD rosette firing control WARNING: Not thoughly tested, use at own risk.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      RadialLayout()
      Constructs this layout manager with default properties.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addLayoutComponent​(java.awt.Component comp)
      Not used.
      void addLayoutComponent​(java.lang.String name, java.awt.Component comp)
      Not used.
      void layoutContainer​(java.awt.Container parent)
      This is called when the panel is first displayed, and every time its size changes.
      static void main​(java.lang.String[] args)
      Run a demonstration.
      java.awt.Dimension minimumLayoutSize​(java.awt.Container parent)
      Returns the minimum size.
      java.awt.Dimension preferredLayoutSize​(java.awt.Container parent)
      Returns the preferred size.
      void removeLayoutComponent​(java.awt.Component comp)
      Not used.
      void removeLayoutComponent​(java.lang.String name, java.awt.Component comp)
      Not used.
      private void setSizes​(java.awt.Container parent)
      Sets the sizes attribute of the RadialLayout object.
      java.lang.String toString()
      Returns the class name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        For serialization.
        See Also:
        Constant Field Values
      • minWidth

        private int minWidth
        The minimum width.
      • minHeight

        private int minHeight
        The minimum height.
      • maxCompWidth

        private int maxCompWidth
        The maximum component width.
      • maxCompHeight

        private int maxCompHeight
        The maximum component height.
      • preferredWidth

        private int preferredWidth
        The preferred width.
      • preferredHeight

        private int preferredHeight
        The preferred height.
      • sizeUnknown

        private boolean sizeUnknown
        Size unknown flag.
    • Constructor Detail

      • RadialLayout

        public RadialLayout()
        Constructs this layout manager with default properties.
    • Method Detail

      • addLayoutComponent

        public void addLayoutComponent​(java.awt.Component comp)
        Not used.
        Parameters:
        comp - the component.
      • removeLayoutComponent

        public void removeLayoutComponent​(java.awt.Component comp)
        Not used.
        Specified by:
        removeLayoutComponent in interface java.awt.LayoutManager
        Parameters:
        comp - the component.
      • addLayoutComponent

        public void addLayoutComponent​(java.lang.String name,
                                       java.awt.Component comp)
        Not used.
        Specified by:
        addLayoutComponent in interface java.awt.LayoutManager
        Parameters:
        name - the component name.
        comp - the component.
      • removeLayoutComponent

        public void removeLayoutComponent​(java.lang.String name,
                                          java.awt.Component comp)
        Not used.
        Parameters:
        name - the component name.
        comp - the component.
      • setSizes

        private void setSizes​(java.awt.Container parent)
        Sets the sizes attribute of the RadialLayout object.
        Parameters:
        parent - the parent.
        See Also:
        LayoutManager
      • preferredLayoutSize

        public java.awt.Dimension preferredLayoutSize​(java.awt.Container parent)
        Returns the preferred size.
        Specified by:
        preferredLayoutSize in interface java.awt.LayoutManager
        Parameters:
        parent - the parent.
        Returns:
        The preferred size.
        See Also:
        LayoutManager
      • minimumLayoutSize

        public java.awt.Dimension minimumLayoutSize​(java.awt.Container parent)
        Returns the minimum size.
        Specified by:
        minimumLayoutSize in interface java.awt.LayoutManager
        Parameters:
        parent - the parent.
        Returns:
        The minimum size.
        See Also:
        LayoutManager
      • layoutContainer

        public void layoutContainer​(java.awt.Container parent)
        This is called when the panel is first displayed, and every time its size changes. Note: You CAN'T assume preferredLayoutSize or minimumLayoutSize will be called -- in the case of applets, at least, they probably won't be.
        Specified by:
        layoutContainer in interface java.awt.LayoutManager
        Parameters:
        parent - the parent.
        See Also:
        LayoutManager
      • toString

        public java.lang.String toString()
        Returns the class name.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The class name.
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Run a demonstration.
        Parameters:
        args - ignored.
        Throws:
        java.lang.Exception - when an error occurs.