|
||||||||||
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 Facemorph.psychomorph.ImageZoomPanel
public class ImageZoomPanel
ImageZoomPanel displays a resizable, scrollable etc view of an image and a template. Also has a selection rectangle and 3 point display and supports template editing
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
DISPLAY_NONE
Don't display a template or 3 points |
static int |
DISPLAY_POINTS
Display 3 points |
static int |
DISPLAY_TEMPLATE
Display the Template |
static int |
EDIT_ADD_LINE
Edit add line |
static int |
EDIT_ADD_POINT
Edit add points |
static int |
EDIT_ADD_TO_MASK
Edit add points / lines to mask |
static int |
EDIT_ADD_TO_SYMMETRY
Edit add points to symmetry data |
static int |
EDIT_DELETE
Edit delete points / lines |
static int |
EDIT_MOVE
Edit movement of points /lines |
static int |
EDIT_START_CLOSED_LINE
Edit start a closed line |
static int |
EDIT_START_OPEN_LINE
Edit start an open line |
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 | |
---|---|
ImageZoomPanel()
Constructor for image zoom panel (default size 300 x 300) |
|
ImageZoomPanel(java.awt.Image img,
Template tmplt)
Constructor for Image Zoom Panel |
Method Summary | |
---|---|
void |
drawAverage(java.awt.Image img,
Template tem,
int i,
int count)
Called when the average needs to be redrawn |
void |
drawImage(java.awt.Image img,
Template tem,
boolean warped)
Called when the image needs to be drawn |
int |
getEditState()
Gets the current edit state |
java.awt.Image |
getImage()
Get the current image |
java.lang.String |
getImgPath()
|
java.awt.geom.Point2D.Float |
getLeftEye()
Get the left eye circle position |
Mask |
getMask()
Get the current Mask |
java.awt.geom.Point2D.Float |
getMouth()
Get the mouth circle positions |
int[] |
getNormPoints()
Get the normalisation points |
java.awt.Dimension |
getPreferredScrollableViewportSize()
|
java.awt.Dimension |
getPreferredSize()
|
java.awt.Rectangle |
getRectangle()
Get the current rectangle |
java.awt.geom.Point2D.Float |
getRightEye()
Get the right eye circle position |
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
|
boolean |
getScrollableTracksViewportHeight()
|
boolean |
getScrollableTracksViewportWidth()
|
int |
getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
|
java.lang.String |
getTemPath()
|
Template |
getTemplate()
Return the Template |
java.util.Stack<Template> |
getUndoStack()
Get the undo stack for templates |
float |
getZoom()
Get the zoom (magnification/subsampling) |
boolean |
inRect(int X,
int Y,
float z)
Checks in the point is int the current rectangle at the current zoom |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
paintComponent(java.awt.Graphics g)
|
void |
setDisplayMask(boolean displayMask)
Swiches display of the mask on and off |
void |
setDisplayRectangle(boolean val)
Should the rectangle be displayed |
void |
setDisplayState(int state)
Set the display state |
void |
setEditState(int newState)
Set the edit state |
void |
setImage(java.awt.Image img)
Set the image to display |
void |
setImgPath(java.lang.String imgPath)
|
void |
setMask(Mask mask)
Set the mask |
void |
setNormPoints(int[] normPoints)
Sets the normalisation points |
void |
setRectangle(java.awt.Rectangle r)
Set teh rectangle |
void |
setTemPath(java.lang.String temPath)
|
void |
setTemplate(Template t)
Set teh Template |
void |
setUndoStack(java.util.Stack<Template> undoStack)
Set the undo stack for templates |
void |
setZoom(int zoom,
int sub)
Set the zoom level |
void |
undoMask()
Undo the last Mask edit |
static java.awt.Image |
zoomImage(java.awt.Image subjectImage,
java.awt.image.ImageObserver iob,
int zoom,
int sub)
Zooms and/or subsamples an image |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DISPLAY_NONE
public static final int DISPLAY_TEMPLATE
public static final int DISPLAY_POINTS
public static final int EDIT_MOVE
public static final int EDIT_ADD_POINT
public static final int EDIT_ADD_LINE
public static final int EDIT_START_CLOSED_LINE
public static final int EDIT_START_OPEN_LINE
public static final int EDIT_DELETE
public static final int EDIT_ADD_TO_MASK
public static final int EDIT_ADD_TO_SYMMETRY
Constructor Detail |
---|
public ImageZoomPanel()
public ImageZoomPanel(java.awt.Image img, Template tmplt)
img
- the image to displaytmplt
- the Template to displayMethod Detail |
---|
public java.awt.Rectangle getRectangle()
public void setRectangle(java.awt.Rectangle r)
r
- the new value for the rectanglepublic void setDisplayRectangle(boolean val)
val
- the new value of the rectangle display flagpublic void setEditState(int newState)
newState
- the new state, one of EDIT_MOVE, EDIT_ADD_POINT,
EDIT_ADD_LINE,t EDIT_START_CLOSED_LINE, EDIT_START_OPEN_LINE, EDIT_DELETE,
EDIT_ADD_TO_MASK or EDIT_ADD_TO_SYMMETRY.public int getEditState()
public void setUndoStack(java.util.Stack<Template> undoStack)
undoStack
- the new undo stackpublic java.util.Stack<Template> getUndoStack()
public void setMask(Mask mask)
mask
- the mask to usepublic void setDisplayMask(boolean displayMask)
displayMask
- true if the mask should be displayedpublic void setNormPoints(int[] normPoints)
normPoints
- the normalisation points to usepublic int[] getNormPoints()
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public Template getTemplate()
public void setTemplate(Template t)
t
- the new Template to use / displaypublic java.awt.geom.Point2D.Float getLeftEye()
public java.awt.geom.Point2D.Float getRightEye()
public java.awt.geom.Point2D.Float getMouth()
public void setDisplayState(int state)
state
- the new display state, one of DISPLAY_NONE, DISPLAY_TEMPLATE or DISPLAY_POINTSpublic void setImage(java.awt.Image img)
img
- public java.awt.Image getImage()
public void setZoom(int zoom, int sub)
zoom
- the pixel magnificationsub
- the pixel supsamplingpublic float getZoom()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void undoMask()
public Mask getMask()
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public boolean inRect(int X, int Y, float z)
X
- the x-coordY
- the y-coordz
- the zoom factor
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public static java.awt.Image zoomImage(java.awt.Image subjectImage, java.awt.image.ImageObserver iob, int zoom, int sub)
subjectImage
- The image to zoom/subsampleiob
- Image Observerzoom
- The zoom factor (each pixel is repeated zoom times)sub
- The subsampling factor (a jump of sub pixels is taken between sampling, after zooming)
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface javax.swing.Scrollable
public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface javax.swing.Scrollable
public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface javax.swing.Scrollable
public void drawImage(java.awt.Image img, Template tem, boolean warped)
TransformerListener
drawImage
in interface TransformerListener
img
- the image to drawtem
- the template to drawwarped
- indicates if this is the warped imagepublic void drawAverage(java.awt.Image img, Template tem, int i, int count)
TransformerListener
drawAverage
in interface TransformerListener
img
- the image to drawtem
- the template to drawi
- the number of this image in the averagecount
- the total number of images to be put in the averagepublic java.lang.String getTemPath()
public void setTemPath(java.lang.String temPath)
temPath
- the temPath to setpublic java.lang.String getImgPath()
public void setImgPath(java.lang.String imgPath)
imgPath
- the imgPath to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |