Package com.compomics.util.gui.utils
Class SwingUtils
java.lang.Object
com.compomics.util.gui.utils.SwingUtils
public class SwingUtils extends Object
Swing utilities methods. Based on code from:
http://www.aurelienribon.com/blog/2012/07/tutorial-beautifying-the-dialogs-in-swing-applications/
- Author:
- Harald Barsnes
-
Constructor Summary
Constructors Constructor Description SwingUtils()
Empty default constructor -
Method Summary
Modifier and Type Method Description static void
fadeIn(JDialog dialog)
Creates an animation to fade the dialog opacity from 0 to 1.static void
fadeIn(JDialog dialog, int delay, float incrementSize)
Creates an animation to fade the dialog opacity from 0 to 1.static void
fadeInAndOut(JDialog dialog)
Creates an animation to fade the dialog opacity from 0 to 1, wait at 1 and then fade to 0.static void
fadeInAndOut(JDialog dialog, int delay, float incrementSize, int displayTime)
Creates an animation to fade the dialog opacity from 0 to 1, wait at 1 and then fade to 0 and dispose.static void
fadeOut(JDialog dialog)
Creates an animation to fade the dialog opacity from 1 to 0.static void
fadeOut(JDialog dialog, int delay, float incrementSize)
Creates an animation to fade the dialog opacity from 1 to 0, and then dispose.
-
Constructor Details
-
SwingUtils
public SwingUtils()Empty default constructor
-
-
Method Details
-
fadeIn
Creates an animation to fade the dialog opacity from 0 to 1. Using a default delay of 5 ms and an increment size of 0.05.- Parameters:
dialog
- the dialog to fade in
-
fadeIn
Creates an animation to fade the dialog opacity from 0 to 1.- Parameters:
dialog
- the dialog to fade indelay
- the delay in ms before starting and between each changeincrementSize
- the increment size
-
fadeOut
Creates an animation to fade the dialog opacity from 1 to 0. Using a default delay of 5 ms and an increment size of 0.05.- Parameters:
dialog
- the dialog to fade out
-
fadeOut
Creates an animation to fade the dialog opacity from 1 to 0, and then dispose.- Parameters:
dialog
- the dialog to fade outdelay
- the delay in ms before starting and between each changeincrementSize
- the increment size
-
fadeInAndOut
Creates an animation to fade the dialog opacity from 0 to 1, wait at 1 and then fade to 0. Default initial time of 50 ms, increment size of 0.05 and display time of 10000 ms.- Parameters:
dialog
- the dialog to display
-
fadeInAndOut
Creates an animation to fade the dialog opacity from 0 to 1, wait at 1 and then fade to 0 and dispose.- Parameters:
dialog
- the dialog to displaydelay
- the delay in ms before starting and between each changeincrementSize
- the increment sizedisplayTime
- the time in ms the dialog is fully visible
-