diff options
author | Yana Stamcheva <yana@jitsi.org> | 2010-09-29 07:37:36 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2010-09-29 07:37:36 +0000 |
commit | 15dc7d7c095970bfbe58af45b68cb9a88f6b2d06 (patch) | |
tree | a89073d35fe0a634179325d91e848e54198351c2 /src/net/java/sip/communicator/util/GuiUtils.java | |
parent | 5c166b35f0116b4936c3ff0f85d024c9b9061414 (diff) | |
download | jitsi-15dc7d7c095970bfbe58af45b68cb9a88f6b2d06.zip jitsi-15dc7d7c095970bfbe58af45b68cb9a88f6b2d06.tar.gz jitsi-15dc7d7c095970bfbe58af45b68cb9a88f6b2d06.tar.bz2 |
Moves the authentication window to the util package and removes any dependency to the protocol service and security authority.
Diffstat (limited to 'src/net/java/sip/communicator/util/GuiUtils.java')
-rw-r--r-- | src/net/java/sip/communicator/util/GuiUtils.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/util/GuiUtils.java b/src/net/java/sip/communicator/util/GuiUtils.java index 4bcdd6f..ace1efe 100644 --- a/src/net/java/sip/communicator/util/GuiUtils.java +++ b/src/net/java/sip/communicator/util/GuiUtils.java @@ -9,8 +9,10 @@ package net.java.sip.communicator.util; import java.awt.*; import java.awt.font.*; import java.awt.geom.*; +import java.io.*; import java.util.*; +import javax.imageio.*; import javax.swing.*; /** @@ -24,6 +26,11 @@ import javax.swing.*; public class GuiUtils { /** + * The logger for this class. + */ + private static Logger logger = Logger.getLogger(GuiUtils.class); + + /** * List of all windows owned by the app. */ private static final ArrayList<Window> WINDOW_LIST @@ -498,4 +505,25 @@ public class GuiUtils } } } + + /** + * Loads an image from a given bytes array. + * @param imageBytes The bytes array to load the image from. + * @return The image for the given bytes array. + */ + public static Image getBytesInImage(byte[] imageBytes) + { + Image image = null; + try + { + image = ImageIO.read( + new ByteArrayInputStream(imageBytes)); + + } + catch (Exception e) + { + logger.error("Failed to convert bytes to image.", e); + } + return image; + } } |