public class DisplayUtilities extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DisplayUtilities.ImageComponent
An image viewer that displays and image and allows zooming and panning of
images.
|
static class |
DisplayUtilities.ScalingImageComponent
An extension of
DisplayUtilities.ImageComponent that scales the displayed image. |
Constructor and Description |
---|
DisplayUtilities() |
Modifier and Type | Method and Description |
---|---|
static JFrame |
createNamedWindow(String name)
Create a named window with a title that is also the name
|
static JFrame |
createNamedWindow(String name,
String title)
Create a named window with a title
|
static JFrame |
createNamedWindow(String name,
String title,
boolean autoResize)
Create a named window that auto resizes
|
static JFrame |
display(BufferedImage image)
Display an image with the default name
|
static JFrame |
display(BufferedImage image,
JFrame frame)
Display an image in the given frame
|
static JFrame |
display(BufferedImage image,
JFrame frame,
Image<?,?> originalImage)
Display an image in the given frame
|
static JFrame |
display(BufferedImage image,
String title)
Display an image with the given title
|
static JFrame |
display(BufferedImage image,
String title,
Image<?,?> originalImage)
Display an image with the given title
|
static JFrame |
display(ConnectedComponent input)
Render a connected component and display it
|
static JFrame |
display(ConnectedComponent input,
float col)
Render a connected component with a given grey level and display it
|
static JFrame |
display(Image<?,?> image)
Display an image with the default name
|
static JFrame |
display(Image<?,?> image,
JFrame frame)
Display an image in the given frame
|
static JFrame |
display(Image<?,?> image,
String title)
Display an image with the given title
|
static JFrame |
display(Polygon input)
Render a polygon to an image and display it.
|
static JFrame |
display(Polygon input,
float col)
Render a polygon with a given grey level and display it
|
static JFrame |
display(String title,
BufferedImage... images)
Display multiple images in an array of frames
|
static JFrame |
display(String title,
Collection<? extends Image<?,?>> images)
Display multiple images in a collection
|
static JFrame |
display(String title,
Image<?,?>... images)
Display multiple images in an array
|
static JFrame |
display(String title,
int cols,
Image<?,?>... images)
Display multiple images in an array
|
static JFrame |
displayLinked(String title,
int cols,
Image<?,?>... images)
Display multiple images in an array
|
static JFrame |
displayName(BufferedImage image,
String name)
Displays an image in the given named window
|
static JFrame |
displayName(Image<?,?> image,
String name)
Display an image in the given frame by name (will be created if not already
done so using
createNamedWindow(String) |
static JFrame |
displayName(Image<?,?> image,
String name,
boolean autoResize)
Display an image in the given frame by name (will be created if not already
done so using
createNamedWindow(String) |
static JFrame |
displaySimple(BufferedImage image)
Display an image with the default name.
|
static JFrame |
displaySimple(BufferedImage image,
String title)
Display an image with the given title.
|
static JFrame |
displaySimple(BufferedImage image,
String title,
Image<?,?> originalImage)
Display an image with the given title.
|
static JFrame |
displaySimple(Image<?,?> image)
Display an image with the default name No additional functionality, such as
zooming, is enabled.
|
static JFrame |
displaySimple(Image<?,?> image,
String title)
Display an image with the given title.
|
static JFrame |
makeDisplayFrame(String title,
int width,
int height)
Get a frame that will display an image.
|
static JFrame |
makeDisplayFrame(String title,
int width,
int height,
BufferedImage img)
Get a frame that will display an image.
|
static JFrame |
makeDisplayFrame(String title,
int width,
int height,
BufferedImage img,
Image<?,?> originalImage)
Get a frame that will display an image.
|
static JFrame |
makeDisplayFrameSimple(String title,
int width,
int height,
BufferedImage img,
Image<?,?> originalImage)
Get a frame that will display an image.
|
static JFrame |
makeFrame(String title)
Make a frame with the given title.
|
static int |
openWindowCount()
Get the number of open windows
|
static void |
positionNamed(String name,
int x,
int y)
Set the position of a named window.
|
static void |
updateNamed(String name,
Image<?,?> newImage,
String title)
Update the image that is being displayed in the given named window.
|
public DisplayUtilities()
public static int openWindowCount()
public static JFrame display(Image<?,?> image)
image
- the imagepublic static JFrame display(BufferedImage image)
image
- the imagepublic static JFrame display(Image<?,?> image, String title)
image
- the imagetitle
- the titlepublic static JFrame displaySimple(Image<?,?> image)
image
- the imagepublic static JFrame displaySimple(BufferedImage image)
image
- the imagepublic static JFrame displaySimple(Image<?,?> image, String title)
image
- the imagetitle
- the titlepublic static JFrame display(Image<?,?> image, JFrame frame)
image
- the imageframe
- the framepublic static void positionNamed(String name, int x, int y)
name
- The window namex
- the x positiony
- the y positionpublic static void updateNamed(String name, Image<?,?> newImage, String title)
name
- The named windownewImage
- The new image to displaytitle
- The window titlepublic static JFrame createNamedWindow(String name)
name
- public static JFrame createNamedWindow(String name, String title)
name
- title
- public static JFrame createNamedWindow(String name, String title, boolean autoResize)
name
- title
- autoResize
- public static JFrame displayName(Image<?,?> image, String name)
createNamedWindow(String)
image
- the imagename
- the name of the framepublic static JFrame displayName(Image<?,?> image, String name, boolean autoResize)
createNamedWindow(String)
image
- the imagename
- the name of the frameautoResize
- should the frame resize to fit its contentspublic static JFrame display(BufferedImage image, JFrame frame)
image
- the imageframe
- the framepublic static JFrame displayName(BufferedImage image, String name)
image
- The imagename
- The name of the windowpublic static JFrame display(BufferedImage image, JFrame frame, Image<?,?> originalImage)
image
- the imageframe
- the frameoriginalImage
- the original imagepublic static JFrame makeFrame(String title)
title
- the titlepublic static JFrame displaySimple(BufferedImage image, String title)
image
- the imagetitle
- the titlepublic static JFrame display(BufferedImage image, String title)
image
- the imagetitle
- the titlepublic static JFrame displaySimple(BufferedImage image, String title, Image<?,?> originalImage)
image
- the imagetitle
- the titleoriginalImage
- original imagepublic static JFrame makeDisplayFrameSimple(String title, int width, int height, BufferedImage img, Image<?,?> originalImage)
title
- the frame titlewidth
- the frame widthheight
- the frame heightimg
- the image to displayoriginalImage
- the original imageJFrame
that allows images to be displayed.public static JFrame display(BufferedImage image, String title, Image<?,?> originalImage)
image
- the imagetitle
- the titleoriginalImage
- original imagepublic static JFrame makeDisplayFrame(String title, int width, int height)
title
- the frame titlewidth
- the frame widthheight
- the frame heightJFrame
that allows images to be displayed.public static JFrame makeDisplayFrame(String title, int width, int height, BufferedImage img)
title
- the frame titlewidth
- the frame widthheight
- the frame heightimg
- the image to displayJFrame
that allows images to be displayed.public static JFrame makeDisplayFrame(String title, int width, int height, BufferedImage img, Image<?,?> originalImage)
title
- the frame titlewidth
- the frame widthheight
- the frame heightimg
- the image to displayoriginalImage
- the original imageJFrame
that allows images to be displayed.public static JFrame display(ConnectedComponent input)
input
- the connected componentpublic static JFrame display(ConnectedComponent input, float col)
input
- the connected componentcol
- the grey levelpublic static JFrame display(Polygon input)
input
- the polygonpublic static JFrame display(Polygon input, float col)
input
- the polygoncol
- the grey levelpublic static JFrame display(String title, Image<?,?>... images)
title
- the frame titleimages
- the imagespublic static JFrame display(String title, Collection<? extends Image<?,?>> images)
title
- the frame titleimages
- the imagespublic static JFrame display(String title, int cols, Image<?,?>... images)
title
- the frame titlecols
- number of columnsimages
- the imagespublic static JFrame displayLinked(String title, int cols, Image<?,?>... images)
title
- the frame titlecols
- number of columnsimages
- the imagespublic static JFrame display(String title, BufferedImage... images)
title
- the frame titleimages
- the images