|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
ImageDisplay
public class ImageDisplay
Class to display an image and the current location with a + sign
| 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 | |
|---|---|
ImageDisplay(Image theImage)
Constructor that takes the image to display |
|
ImageDisplay(Image theImage,
int x,
int y)
Constructor that takes the image and current x and y |
|
| Method Summary | |
|---|---|
int |
getCurrentX()
Method to get the current x |
int |
getCurrentY()
Method to get the current y |
Image |
getImage()
Method to get the image |
Dimension |
getPreferredScrollableViewportSize()
Method to return the preferred size |
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
Method to return the block increment for scrolling |
boolean |
getScrollableTracksViewportHeight()
Method to check if the viewport height is the source height |
boolean |
getScrollableTracksViewportWidth()
Method to check if the viewport width is the source width |
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
Method to return the unit increment for scrolling |
void |
paintComponent(Graphics g)
Method to handle displaying this object |
void |
setCurrentX(int x)
Method to set the current x |
void |
setCurrentY(int y)
Method to set the current y |
void |
setImage(Image theImage)
Method to set the image |
| 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 ImageDisplay(Image theImage)
theImage - the image to display
public ImageDisplay(Image theImage,
int x,
int y)
theImage - the image to displayx - the current x value to usey - the current y value to use| Method Detail |
|---|
public int getCurrentX()
public int getCurrentY()
public Image getImage()
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize in interface Scrollable
public int getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
getScrollableBlockIncrement in interface ScrollablevisibleRect - the visible rectangleorientation - vertical or horizontaldirection - neg is up or left and pos is right or down
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight in interface Scrollablepublic boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth in interface Scrollable
public int getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
getScrollableUnitIncrement in interface ScrollablevisibleRect - the visible rectangleorientation - vertical or horizontaldirection - neg is up or left and pos is right or down
public void paintComponent(Graphics g)
paintComponent in class JComponentg - the graphics object for drawing withpublic void setCurrentX(int x)
x - the x value to usepublic void setCurrentY(int y)
y - the y value to usepublic void setImage(Image theImage)
theImage - the new image to use
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||