|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JLayeredPane | +--javax.swing.JDesktopPane | +--did.gui.DIDImageCanvas
File: DIDImageCanvas.java Version: 1.1 Description: This component is an implementation of JComponent that is responsible for the display and manipulation of ground truth data (XML). This is accomplished through a heirarchal series of objects called ROIs (Regions of Interest). Each ROI has a corresponding node in the DIDDefaultDataModel which it communicates with to retrieve and store its vertex data. Note: For future versions of this software it would be wise to investigate turning this class into a viewer in the Swing MVC model. This would simplify the messaging routines(through listeners), make the code much more streamlined and easier to understand and maintain. Also it would provide a higher degree of abstraction further serparating the data form the view and possible allowing other methods for viewing the data using the same data model. Modification Log: Date Name Comment xx-xx-xxxx XXX xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Inner classes inherited from class javax.swing.JDesktopPane |
javax.swing.JDesktopPane.AccessibleJDesktopPane |
Inner classes inherited from class javax.swing.JLayeredPane |
javax.swing.JLayeredPane.AccessibleJLayeredPane |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
protected static DIDRoiIFC |
activeRoi
A reference to the DIDRoiIFC interface. |
protected java.awt.geom.AffineTransform |
at
JAVA 2D coordinate mapping object necessary to render main image. |
protected DIDCreationHandler |
cHandler
Reference to a class used to manage the creation of new ROIs. |
static int |
CREATE
These Constants define the state of the canvas. |
static int |
EDIT
These Constants define the state of the canvas. |
protected DIDEditHandler |
eHandler
Reference to a class used to manage the editing of a single ROI. |
static int |
IMAGE_ONLY
These Constants define the state of the canvas. |
protected java.awt.Image |
img
JAI implementation of RenderedImage interface used to display image files. |
protected boolean |
isSetNext
|
protected int |
maxUnitIncrement
An integer representing the maximum unit the component should be scrolled (when necessary). |
protected double |
myLeftRotationFactor
A double representing the degree and direction by which an ROI should be rotated. |
static int |
myMode
This integer holds the current state of the canvas: Creating OR Editing. |
protected DIDDefaultTreeModel |
myModel
Reference to the TreeModel for which this class is acting as a viewer. |
protected double |
myRightRotationFactor
A double representing the degree and direction by which an ROI should be rotated. |
protected static java.util.Vector |
myRoiChildren
Vector whose purpose is to hold and track all the DIDRoiIFC object implementations currently being displayed with the exception of the parent node's ROI. |
protected static java.util.Vector |
myROIs
Vector whose purpose is to hold and track all the DIDRoiIFC object implementations of the current data model. |
protected DIDTree |
myTree
Reference to the Tree viewer which is also viewing the data. |
static int |
myView
This integer determines what set of ROIs the canvas is to display. |
protected static DIDRoiIFC |
parentRoi
A reference to the DIDRoiIFC interface. |
protected java.awt.Image |
scaledImg
|
protected DIDSelectionHandler |
sHandler
Reference to a class used to manage the selection of multiple overlapping ROIs. |
Fields inherited from class javax.swing.JLayeredPane |
DEFAULT_LAYER,
DRAG_LAYER,
FRAME_CONTENT_LAYER,
LAYER_PROPERTY,
MODAL_LAYER,
PALETTE_LAYER,
POPUP_LAYER |
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 |
Constructor Summary | |
DIDImageCanvas(java.lang.String fileName,
int unit,
DIDTree newTree,
TrueViz frame)
Constructor used to initialize the component. |
Method Summary | |
boolean |
arrowDisplay()
|
void |
changeScale(float newscale)
|
void |
deleteNext()
|
void |
deleteRoi()
Method used to remove and ROI and its corresponding data from the display and data file respectively. |
void |
displayInfopanel()
|
int |
getMode()
Method used to get the Mode of the ImageCanvas. |
java.awt.Dimension |
getPreferredScrollableViewportSize()
Part of Scrollable Interface Implementation used to return the preferred display size of the ImageCanvas. |
float |
getScale()
|
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Method used to determine the amount for a block inrecment, which is the height or width of visibleRect, based on orientation. |
boolean |
getScrollableTracksViewportHeight()
Returns false to indicate that the height of the viewport does not determine the height of the table, unless the preferred height of the tree is smaller than the viewports height. |
boolean |
getScrollableTracksViewportWidth()
Returns false to indicate that the width of the viewport does not determine the width of the table, unless the preferred width of the tree is smaller than the viewports width. |
int |
getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Part of Scrollable Interface Implementation necessary to determine the amount by which to scroll the object in the viewport when necessary. |
int |
getView()
Method used to return the current view of this ImageCanvas (Page, Zone, Line, Character). |
void |
init()
Method used to initialize this object. |
void |
newRoi(int type)
Method used to create new ROIs. |
void |
paintComponent(java.awt.Graphics g)
Method used to perform the custom painting necessary to display the appropriate ROIs. |
void |
reset()
Method used to clear all the zones from the screen. |
void |
resetFocus()
Method used take the focus away from all the ROIs on the screen (mainly to releave formatting issues). |
void |
rotateLeft()
Method used rotate the selected ROI to the left. |
void |
rotateRight()
Method used rotate the selected ROI to the right. |
void |
searchFind()
|
void |
searchFindDir()
|
void |
setArrowDisplay(boolean boolVal)
|
void |
setArrowDisplay(int entityType,
boolean boolVal)
|
void |
setFillColors(boolean fill)
|
void |
setImage(java.lang.String fileName)
This method is responsible for creating an image object from a file reference. |
void |
setMaxUnitIncrement(int pixels)
Method used to set the maximum unit (in pixels) by which this object should scroll. |
void |
setMode(int mode)
Method used to set the Mode of the ImageCanvas. |
void |
setMouseCoordinate(int x,
int y)
|
void |
setNext()
|
void |
setNext(DIDRoiIFC nextRoi)
|
void |
setScale(float newscale)
|
boolean |
setView(int newView)
Method used to determine which level of ROIs the ImageCanvas should display. |
void |
showInfopanel()
|
void |
zoomIn()
|
void |
zoomOut()
|
Methods inherited from class javax.swing.JDesktopPane |
getAccessibleContext,
getAllFrames,
getAllFramesInLayer,
getDesktopManager,
getUI,
getUIClassID,
isOpaque,
paramString,
setDesktopManager,
setUI,
updateUI |
Methods inherited from class javax.swing.JLayeredPane |
addImpl,
getComponentCountInLayer,
getComponentsInLayer,
getComponentToLayer,
getIndexOf,
getLayer,
getLayer,
getLayeredPaneAbove,
getObjectForLayer,
getPosition,
highestLayer,
insertIndexForLayer,
isOptimizedDrawingEnabled,
lowestLayer,
moveToBack,
moveToFront,
paint,
putLayer,
remove,
setLayer,
setLayer,
setPosition |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paintBorder,
paintChildren,
paintImmediately,
paintImmediately,
print,
printAll,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
printComponents,
processContainerEvent,
processEvent,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int EDIT
public static final int CREATE
public static final int IMAGE_ONLY
public static int myMode
public static int myView
protected static java.util.Vector myRoiChildren
protected static java.util.Vector myROIs
protected static DIDRoiIFC activeRoi
protected static DIDRoiIFC parentRoi
protected int maxUnitIncrement
protected double myLeftRotationFactor
protected double myRightRotationFactor
protected java.awt.geom.AffineTransform at
protected java.awt.Image img
protected java.awt.Image scaledImg
protected boolean isSetNext
protected DIDSelectionHandler sHandler
protected DIDEditHandler eHandler
protected DIDCreationHandler cHandler
protected DIDDefaultTreeModel myModel
protected DIDTree myTree
Constructor Detail |
public DIDImageCanvas(java.lang.String fileName, int unit, DIDTree newTree, TrueViz frame)
fileName
- A string representing the absolute path to the image file that this class
is to display.unit
- The maximum amount to move the ImageCanvas when scrolling is necessary.newTree
- Reference to DIDTree that is also visualing data (XML).init()
,
setImage(java.lang.String)
Method Detail |
public void init()
public void paintComponent(java.awt.Graphics g)
g
- A Graphics object that represents all the visual data contained in this
object's Graphics window.public void showInfopanel()
public void displayInfopanel()
public void setImage(java.lang.String fileName)
e
- String reprsenting the filename from which an image object should be created.paintComponent(java.awt.Graphics)
public void setScale(float newscale)
public float getScale()
public void zoomIn()
public void zoomOut()
public void changeScale(float newscale)
public void newRoi(int type)
type
- An integer representing the type of ROI to create. This integer comes from
the DIDRoiIFC interface constants used to define the type of ROI.public void deleteRoi()
public void setMode(int mode)
An
- integer used to determine the mode of the object.paintComponent(java.awt.Graphics)
public int getMode()
public boolean setView(int newView)
newView
- An interger constant from the DIDRoiIFC class that represent the level
of ROIs to display.public int getView()
public void reset()
public void resetFocus()
public void rotateLeft()
public void rotateRight()
public java.awt.Dimension getPreferredScrollableViewportSize()
public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
visibleRect
- A Rectangle object representing the visible portion of the component.orientation
- Either SwingConstants.VERTICAL or SwingConstants.HORIZONTALdirection
- Less than zero to scroll up/left, greater than zero for down/right.public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
visibleRect
- The view area visible within the viewportorientation
- Either SwingConstants.VERTICAL or SwingConstants.HORIZONTALdirection
- Less than zero to scroll up/left, greater than zero for down/right.public boolean getScrollableTracksViewportHeight()
public boolean getScrollableTracksViewportWidth()
public void setMaxUnitIncrement(int pixels)
pixels
- An integer representing the number of pixels to scroll by when scrolling
is called necessary.public void setMouseCoordinate(int x, int y)
public void searchFind()
public void searchFindDir()
public boolean arrowDisplay()
public void setArrowDisplay(boolean boolVal)
public void setArrowDisplay(int entityType, boolean boolVal)
public void setFillColors(boolean fill)
public void setNext()
public void setNext(DIDRoiIFC nextRoi)
public void deleteNext()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |