public class ImageDisplayJavaSE extends AbstractPlaceableJavaSE implements ImageDisplayInterface
ImageDisplayJavaSE is the implementation of the ImageDisplayInterface that uses AWT and Swing classes.
Note that this class does not work well when executed within Eclipse. In Eclipse, the Swing event thread blocks "waiting for: OGLRenderQueue$QueueFluher", and spends most of its time blocked rather than rendering. Hence, we do not get smooth updates of images.| Modifier and Type | Class and Description |
|---|---|
protected class |
ImageDisplayJavaSE.ImageWindow
Version of TableauFrame that removes its association with the
ImageDisplay upon closing, and also records the size of the display.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Container |
_container
The container for the image display, set by calling place().
|
protected ImageTokenEffigy |
_effigy
The effigy for the image data.
|
protected ImageDisplayJavaSE.ImageWindow |
_imageWindowFrame
The frame, if one is used.
|
protected int |
_oldXSize
The horizontal size of the previous image.
|
protected int |
_oldYSize
The vertical size of the previous image.
|
protected Picture |
_picture
The picture panel.
|
_frame, _paneSize, _windowClosingAdapter, _windowProperties| Constructor and Description |
|---|
ImageDisplayJavaSE() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp()
Free up memory when closing.
|
void |
display(Token in)
Display the specified token.
|
java.awt.Color |
getBackground()
Get the background.
|
java.lang.Object |
getFrame()
Get the image's frame.
|
java.lang.Object |
getPicture()
Get the platform dependent picture that contains the image.
|
java.lang.Object |
getPlatformContainer()
Get the platform dependent container that contains the image.
|
java.lang.Object |
getTableau()
Get the image tableau.
|
void |
init(ImageDisplay imageDisplayActor)
Initialize an object.
|
void |
initializeEffigy()
Initialize the effigy of the image.
|
void |
initWindowAndSizeProperties()
Initialize the effigy of the plotter.
|
void |
placeContainer(java.awt.Container container)
Remove the plot from the frame if the container is null.
|
void |
setBackground(java.awt.Color background)
Set the background.
|
void |
setFrame(java.lang.Object frame)
Set the frame of the image.
|
void |
setPicture(java.lang.Object picture)
Set the platform dependent picture of the image.
|
void |
setPlatformContainer(java.lang.Object container)
Set the platform dependent container of the image.
|
_exportMoMLContents, init, setFrameprotected java.awt.Container _container
protected ImageTokenEffigy _effigy
protected ImageDisplayJavaSE.ImageWindow _imageWindowFrame
protected int _oldXSize
protected int _oldYSize
public ImageDisplayJavaSE()
public void cleanUp()
cleanUp in interface ImageDisplayInterfacecleanUp in class AbstractPlaceableJavaSEpublic void display(Token in) throws IllegalActionException
display in interface ImageDisplayInterfacein - The token to displayIllegalActionException - If the input is not an ImageTokenpublic java.awt.Color getBackground()
getBackground in interface ImageDisplayInterfacesetBackground(Color)public java.lang.Object getFrame()
getFrame in interface ImageDisplayInterfacesetFrame(Object)public java.lang.Object getPicture()
getPicture in interface ImageDisplayInterfacesetPicture(Object)public java.lang.Object getPlatformContainer()
getPlatformContainer in interface ImageDisplayInterfacesetPlatformContainer(Object)public java.lang.Object getTableau()
getTableau in interface ImageDisplayInterfacepublic void init(ImageDisplay imageDisplayActor) throws IllegalActionException, NameDuplicationException
init in interface ImageDisplayInterfaceimageDisplayActor - The object to be initialized.IllegalActionException - If the entity cannot be contained
by the proposed container.NameDuplicationException - If the container already has an
actor with this name.public void initializeEffigy() throws IllegalActionException
initializeEffigy in interface ImageDisplayInterfaceIllegalActionException - If there is a problem initializing the effigypublic void initWindowAndSizeProperties() throws IllegalActionException, NameDuplicationException
initWindowAndSizeProperties in interface ImageDisplayInterfaceIllegalActionException - If there is a problem initializing the effigyNameDuplicationException - If there is a problem creating the attributes.public void placeContainer(java.awt.Container container)
placeContainer in interface ImageDisplayInterfacecontainer - The Container to be placed.public void setBackground(java.awt.Color background)
setBackground in interface ImageDisplayInterfacebackground - The background color.getBackground()public void setFrame(java.lang.Object frame)
setFrame in interface ImageDisplayInterfaceframe - The frame to set.getFrame()public void setPicture(java.lang.Object picture)
setPicture in interface ImageDisplayInterfacepicture - The picturegetPicture()public void setPlatformContainer(java.lang.Object container)
setPlatformContainer in interface ImageDisplayInterfacecontainer - the platform dependent container.getPlatformContainer()