Module org.jcommon

Class JDesktopPane

    • Field Detail

      • CASCADE

        public static final int CASCADE
        This flag represents a cascade organization for the internal frames.
        See Also:
        NONE, MOSAIC, Constant Field Values
      • FIT_NONE

        public static final int FIT_NONE
        No fit is applied to the added components
        See Also:
        Constant Field Values
      • FIT_CENTER

        public static final int FIT_CENTER
        Added component are centered
        See Also:
        Constant Field Values
      • FIT_CENTER_RESIZE

        public static final int FIT_CENTER_RESIZE
        Added component are centered and resized to fit the default. The fit ratio is given by method getFrameDimensionRatio()
        See Also:
        Constant Field Values
      • FIT_CENTER_DELTA

        public static final int FIT_CENTER_DELTA
        Added component are centered then switched in x and y by a delta. The delta is available with methods setFitDeltaMax(double delta) and getFitDeltaMax
        See Also:
        Constant Field Values
      • FIT_CENTER_RESIZE_DELTA

        public static final int FIT_CENTER_RESIZE_DELTA
        Added component are centered, resized and switched by a delta. The fit ratio is given by method getFrameDimensionRatio(). The delta is available with methods setFitDeltaMax(double delta) and getFitDeltaMax
        See Also:
        Constant Field Values
    • Constructor Detail

      • JDesktopPane

        public JDesktopPane()
        Create a new default desktop pane.
    • Method Detail

      • setOrganizeMethod

        public void setOrganizeMethod​(int method)
        Set the organization method used by the desktop to organize components.
        Parameters:
        method - the method to use, can be CASCADE, MOSAIC or NONE.
      • getOrganizeMethod

        public int getOrganizeMethod()
        Get the organization method used by the desktop to organize components.
        Returns:
        the organization method.
      • setFrameDimensionRatio

        public void setFrameDimensionRatio​(double ratio)
        Set the frame dimension ratio for internal frame. All added internal frame will be redimensionned to fit the ratio of descktop dimension.
        Parameters:
        ratio - the ratio of desktop dimension.
      • getFrameDimensionRatio

        public double getFrameDimensionRatio()
        Get the frame dimension ratio for internal frame. All added internal frame will be redimensionned to fit the ratio of descktop dimension.
        Returns:
        ratio the ratio of desktop dimension.
      • setFitMethod

        public void setFitMethod​(int fitMethod)
        Set the fit method used to initialize space occupation of new components.
        Parameters:
        fitMethod - the fit method to use (FIT_CENTER, FIT_CENTER_RESIZE, ...)
      • getFitMethod

        public int getFitMethod()
        Get the fit method used to initialize space occupation of new components.
        Returns:
        the fit method to use (FIT_CENTER, FIT_CENTER_RESIZE, ...)
      • setFitDeltaMax

        public void setFitDeltaMax​(double delta)
        Set the fit delta maximum value. The delta is used when an organization with random delta is processed.
        Parameters:
        delta - the max delta value.
      • getFitDeltaMax

        public double getFitDeltaMax()
        Get the fit delta maximum value. The delta is used when an organization with random delta is processed.
        Returns:
        the max delta value.
      • organize

        public void organize()
        Organize the Internal frames following the default method
      • organize

        public void organize​(int method)
        Organize the Internal frames following the method given in parameter. MOSAIC
        Parameters:
        method - the method to use (can be MOSAIC or CASCADE)
      • cascade

        public void cascade()
        Reorganize the frames of the desktop by using cascading
      • mosaic

        public void mosaic()
        Reorganize the frames of the desktop by using mosaic
      • fit

        public void fit​(JInternalFrame frame)
        Fit the given frame to take all the available space within the desktop pane.
        Parameters:
        frame - the frame to fit.
      • addInternalFrame

        public void addInternalFrame​(String title,
                                     Container container,
                                     boolean fit)
        Add a container as internal frame in the current desktop.
        Parameters:
        title - String the title of the internal frame
        container - Container the conainer to add
        fit - If this boolean is true, the frame is redimensioned and relocated by the desktop to fit the default placement methods. If false is given, the internal frame is not resized and relocated.
      • addInternalFrame

        public void addInternalFrame​(String title,
                                     Container container)
        Add a container as internal frame in the current desktop.
        Parameters:
        title - String the title of the internal frame
        container - Container the conainer to add
      • addInternalFrame

        public void addInternalFrame​(JInternalFrame frame,
                                     boolean fit)
        Add an internal frame to the desktop.
        Parameters:
        frame - the frame to add.
        fit - is the frame has to fit within the desktop pane.