|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel jwo.utils.gui.JWPicture
public class JWPicture
Loads and displays an image in a form that can be added to graphical containers.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JWPicture(Image image)
Creates a displayable picture of the given image. |
|
JWPicture(Image image,
int width,
int height)
Creates a displayable picture of the given image at the given size. |
|
JWPicture(Image image,
int width,
int height,
int nRows,
int nCols)
Creates a set of displayable pictures of the given image at the given size. |
Method Summary | |
---|---|
JWPicture |
addCopy(int width,
int height)
Creates a copy of the picture but uses the same image as its source. |
Image |
getImage()
Reports the image displayed in this picture. |
void |
loadImage(String fileName)
Loads the given graphics file and updates the picture with it. |
void |
paintComponent(Graphics g)
Displays the image at the preferred size of the component. |
void |
setAlpha(float alpha)
Sets the transparency value of the image to display. |
void |
setDrawImage(boolean isDrawn)
Determines if image is drawn or not. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JWPicture(Image image)
image
- Image to display.public JWPicture(Image image, int width, int height)
image
- Image to display.width
- Width to display image.height
- Height to display image.public JWPicture(Image image, int width, int height, int nRows, int nCols)
image
- Image to display.width
- Width to display image.height
- Height to display image.nRows
- Number of images to display in the Y direction.nCols
- Number of images to display in the X direction.Method Detail |
---|
public void loadImage(String fileName)
fileName
- Name of graphics file to load.public JWPicture addCopy(int width, int height)
width
- Width of copy.height
- Height of copy.
public void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- Graphics context in which to draw.public void setAlpha(float alpha)
alpha
- Transparency value (0 is invisible, 1 is opaque).public Image getImage()
public void setDrawImage(boolean isDrawn)
isDrawn
- Image is drawn if true.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |