|
|||||||||
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
optics.graphics.Diagram2DPanel
optics.graphics.ImagePanel
public class ImagePanel
Class to display a image in a JPanel with resampling and scaling
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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected Grid |
grid
|
protected BufferedImage |
image
|
Fields inherited from class optics.graphics.Diagram2DPanel |
---|
bounds, diagram, drag, endDrag, inZoomMode, startDrag, startDragSet, transform |
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 | |
---|---|
ImagePanel()
Default constuctor to form a blank DisplayPanel |
|
ImagePanel(BufferedImage im)
Constructor to form s DisplayPanel with a BufferedImage |
Method Summary | |
---|---|
void |
addImage(BufferedImage im)
Methed to add a BufferedImage to the display |
void |
addImage(OpticalImage oi)
Method to add an OpticalImage |
ColourScale |
getColourScale()
Method to get the colourscale of the current image. |
BufferedImage |
getImage()
Method to get the image displayed image |
BufferedImage |
getImage(int w,
int h)
Method get the Displayed image, overrides the default version in Diagram2DPanel |
void |
mouseClicked(MouseEvent e)
Void mouseClicked event, implement Button 3 resetting to full bounds. |
void |
paintComponent(Graphics g)
Methed on overload paintComponent that actually displays the bounded image. |
void |
resetBounds()
Method to reset the bound to the default size |
Methods inherited from class optics.graphics.Diagram2DPanel |
---|
addComponent, addComponent, clear, exportImage, getDiagram2D, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, renderGraphics, setDiagram, setFontSize, setPenWidth, writeImage |
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 |
Field Detail |
---|
protected BufferedImage image
protected Grid grid
Constructor Detail |
---|
public ImagePanel()
An image must be added before this panel in rendered
public ImagePanel(BufferedImage im)
im
- the image to be displayedMethod Detail |
---|
public void addImage(BufferedImage im)
im
- the Bufferered Imagepublic void addImage(OpticalImage oi)
public void resetBounds()
resetBounds
in class Diagram2DPanel
public BufferedImage getImage()
BufferedIage
the displayed imagepublic BufferedImage getImage(int w, int h)
getImage
in class Diagram2DPanel
w
- image widthh
- image height
BufferedImage
image of the panelpublic ColourScale getColourScale()
ColourScale
the colourscale.public void paintComponent(Graphics g)
paintComponent
in class Diagram2DPanel
public void mouseClicked(MouseEvent e)
Diagram2DPanel
mouseClicked
in interface MouseListener
mouseClicked
in class Diagram2DPanel
e
- the mouse event.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |