Class JDesktopPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class JDesktopPane extends JDesktopPane
This class extends a JDesktopPane and provide organization methods for the internal frames.
Since:
1.0.1
Version:
"1.0.14" - b202111241200L
Author:
Julien SEINTURIER - Université de Toulon / CNRS LIS umr 7020 - github.com/jorigin/jcommon (contact@jorigin.org)
See Also:
  • Field Details

    • NONE

      public static final int NONE
      This flag represent a no organization method for the internal frames.
      See Also:
    • MOSAIC

      public static final int MOSAIC
      This flag represents a mosaic organization for the internal frames.
      See Also:
    • CASCADE

      public static final int CASCADE
      This flag represents a cascade organization for the internal frames.
      See Also:
    • FIT_NONE

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

      public static final int FIT_CENTER
      Added component are centered
      See Also:
    • 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:
    • 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:
    • 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:
  • Constructor Details

    • JDesktopPane

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

    • 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.