Package gov.nih.mipav.view
Class ViewJComponentFunct
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
gov.nih.mipav.view.ViewJComponentFunct
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable
This is a custom made Swing component. It is coordinates for the ViewJComponentGraph as well as the line color. The
graph then uses this information to draw the function.
- Version:
- 1.0 Jun 1, 1999
- Author:
- Neva Cherniavsky
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringDOCUMENT ME!private ColorDOCUMENT ME!static final intMaximum size of the coordinate arrays.private int[]DOCUMENT ME!private intDOCUMENT ME!private int[]DOCUMENT ME!private intDOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private static final longUse serialVersionUID for interoperability.private booleanDOCUMENT ME!private booleanDOCUMENT ME!private VOIDOCUMENT ME!float[]DOCUMENT ME!int[][]xy coordinates of voi boundarfloat[]DOCUMENT ME!Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionConstructor - creates empty function.ViewJComponentFunct(float[] x, float[] y, int name, VOI v, int[][] xyCoords) Constructor - creates functions with specified coordinates, and number for name.ViewJComponentFunct(float[] x, float[] y, Color lineColor, int name, VOI v, int[][] xyCoords) Constructor - creates functions with specified coordinates, color, and number for name.ViewJComponentFunct(float[] x, float[] y, Color lineColor, VOI v, int[][] xyCoords) Constructor - creates functions with specified coordinates and color.ViewJComponentFunct(float[] x, float[] y, Color lineColor, String name, VOI v) Constructor - creates functions with specified coordinates, color, and name string. -
Method Summary
Modifier and TypeMethodDescriptiongetColor()getColor - gets the color of the line on the graph.booleangetFitFunctionVisible - accessor that gets the visible flag of the fitted function.booleangetFunctionVisible - accessor that gets the visible flag of the function.getFunctNames - gets the names of the functions.int[]getNewXs()getNewXs - accessor that gets the array of x coordinates to be plotted; used by the graphics for the actual plotting of the graph.intAccessor that gets the number of x coordinates to be plotted.int[]getNewYs()getNewYs - accessor that gets the array of y coordinates to be plotted used by the graphics for the actual plotting of the graph.intAccessor that gets the number of y coordinates to be plotted.float[]getOriginalXs - accessor that gets the array of x coordinates to be plotted; used by the zoom to reset the graph.float[]getOriginalYs - accessor that gets the array of y coordinates to be plotted used by the zoom for the rest of the graph.getVOI()gets the voi associated with this function if it corresponds to a point, otherwise returns null.float[]getXs()getXs - accessor that gets the array of x coordinates to be plotted.int[][]float[]getYs()getYs - accessor that gets the array of y coordinates to be plotted.voidsetColor(int color) setColor - sets the color of the line on the graph.voidsetColor - sets the color of the line on the graph.voidsetFitFunctionVisible(boolean visible) setFitFunctionVisible - accessor that tells whether to show the fitted function.voidsetFunctionVisible(boolean visible) setFunctionVisible - accessor that tells whether to show the function.voidsetFunctName(int i) setFunctName - sets the names of the functions to default names (function + number).voidsetFunctName(String name) setFunctName - sets the names of the functons.voidsetNewXs(int[] oldX, int len) setNewXs - accessor that sets the integer array of x coordinates to be plotted; used by the graphics for the actual plotting of the graph.voidsetNewYs(int[] oldY, int len) setNewYs - accessor that sets the integer array of y coordinates to be plotted; used by the graphics for the actual plotting of the graph.voidsetOriginalXs(float[] oldX) setOriginalXs - accessor that sets the array of x coordinates to be plotted; used by the zoom to reset the graph.voidsetOriginalYs(float[] oldY) setOriginalYs - accessor that sets the array of y coordinates to be plotted; used by the zoom for reseting the graph.voidsetXs(float[] oldX) setXs - accessor that sets the array of x coordinates to be plotted.voidsetYs(float[] oldY) setYs - accessor that sets the array of y coordinates to be plotted.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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, updateUIMethods 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, transferFocusDownCycle, validate, validateTreeMethods 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, getAccessibleContext, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
MAX_NUM_COORDS
public static final int MAX_NUM_COORDSMaximum size of the coordinate arrays.- See Also:
-
X
public float[] XDOCUMENT ME! -
Y
public float[] YDOCUMENT ME! -
XYCoords
public int[][] XYCoordsxy coordinates of voi boundar -
functName
DOCUMENT ME! -
lineColor
DOCUMENT ME! -
newX
private int[] newXDOCUMENT ME! -
newXLength
private int newXLengthDOCUMENT ME! -
newY
private int[] newYDOCUMENT ME! -
newYLength
private int newYLengthDOCUMENT ME! -
originalX
private float[] originalXDOCUMENT ME! -
originalY
private float[] originalYDOCUMENT ME! -
showFitFunction
private boolean showFitFunctionDOCUMENT ME! -
showFunction
private boolean showFunctionDOCUMENT ME! -
voi
DOCUMENT ME!
-
-
Constructor Details
-
ViewJComponentFunct
public ViewJComponentFunct()Constructor - creates empty function. -
ViewJComponentFunct
Constructor - creates functions with specified coordinates and color.- Parameters:
x- x coordinates of the functiony- y coordinates of the functionlineColor- color for the functionv- voi this is drawn for if it is for a point, should be null otherwise
-
ViewJComponentFunct
Constructor - creates functions with specified coordinates, and number for name.- Parameters:
x- x coordinates of the functiony- y coordinates of the functionname- integer for name of functionv- voi this is drawn for if it is for a point, should be null otherwise
-
ViewJComponentFunct
Constructor - creates functions with specified coordinates, color, and name string.- Parameters:
x- x coordinates of the functiony- y coordinates of the functionlineColor- color for the functionname- name of functionv- voi this is drawn for if it is for a point, should be null otherwise
-
ViewJComponentFunct
public ViewJComponentFunct(float[] x, float[] y, Color lineColor, int name, VOI v, int[][] xyCoords) Constructor - creates functions with specified coordinates, color, and number for name.- Parameters:
x- x coordinates of the functiony- y coordinates of the functionlineColor- color for the functionname- integer for name of functionv- voi this is drawn for if it is for a point, should be null otherwise
-
-
Method Details
-
getColor
getColor - gets the color of the line on the graph.- Returns:
- color of the line on the graph
-
getFitFunctionVisible
public boolean getFitFunctionVisible()getFitFunctionVisible - accessor that gets the visible flag of the fitted function.- Returns:
- the boolean visible flag
-
getFunctionVisible
public boolean getFunctionVisible()getFunctionVisible - accessor that gets the visible flag of the function.- Returns:
- the boolean visible flag
-
getFunctName
getFunctNames - gets the names of the functions.- Returns:
- names of the functions
-
getNewXs
public int[] getNewXs()getNewXs - accessor that gets the array of x coordinates to be plotted; used by the graphics for the actual plotting of the graph.- Returns:
- the array of x coordinates
-
getNewXsLength
public int getNewXsLength()Accessor that gets the number of x coordinates to be plotted.- Returns:
- DOCUMENT ME!
-
getNewYs
public int[] getNewYs()getNewYs - accessor that gets the array of y coordinates to be plotted used by the graphics for the actual plotting of the graph.- Returns:
- the array of y coordinates
-
getNewYsLength
public int getNewYsLength()Accessor that gets the number of y coordinates to be plotted.- Returns:
- DOCUMENT ME!
-
getOriginalXs
public float[] getOriginalXs()getOriginalXs - accessor that gets the array of x coordinates to be plotted; used by the zoom to reset the graph.- Returns:
- the array of x coordinates
-
getOriginalYs
public float[] getOriginalYs()getOriginalYs - accessor that gets the array of y coordinates to be plotted used by the zoom for the rest of the graph.- Returns:
- the array of y coordinates
-
getVOI
gets the voi associated with this function if it corresponds to a point, otherwise returns null.- Returns:
- DOCUMENT ME!
-
getXs
public float[] getXs()getXs - accessor that gets the array of x coordinates to be plotted.- Returns:
- the array of x coordinates
-
getXYCoords
public int[][] getXYCoords() -
getYs
public float[] getYs()getYs - accessor that gets the array of y coordinates to be plotted.- Returns:
- the array of y coordinates
-
setColor
setColor - sets the color of the line on the graph.- Parameters:
color- color to set the line to
-
setColor
public void setColor(int color) setColor - sets the color of the line on the graph.- Parameters:
color- code for the color to set the line to
-
setFitFunctionVisible
public void setFitFunctionVisible(boolean visible) setFitFunctionVisible - accessor that tells whether to show the fitted function.- Parameters:
visible- boolean to set it to
-
setFunctionVisible
public void setFunctionVisible(boolean visible) setFunctionVisible - accessor that tells whether to show the function.- Parameters:
visible- boolean to set it to
-
setFunctName
setFunctName - sets the names of the functons.- Parameters:
name- - String of function name
-
setFunctName
public void setFunctName(int i) setFunctName - sets the names of the functions to default names (function + number).- Parameters:
i- - number of functions
-
setNewXs
public void setNewXs(int[] oldX, int len) setNewXs - accessor that sets the integer array of x coordinates to be plotted; used by the graphics for the actual plotting of the graph.- Parameters:
oldX- the array of x coordinateslen- number of coordinates
-
setNewYs
public void setNewYs(int[] oldY, int len) setNewYs - accessor that sets the integer array of y coordinates to be plotted; used by the graphics for the actual plotting of the graph.- Parameters:
oldY- the array of y coordinateslen- the number of y coordinates
-
setOriginalXs
public void setOriginalXs(float[] oldX) setOriginalXs - accessor that sets the array of x coordinates to be plotted; used by the zoom to reset the graph.- Parameters:
oldX- the array of x coordinates
-
setOriginalYs
public void setOriginalYs(float[] oldY) setOriginalYs - accessor that sets the array of y coordinates to be plotted; used by the zoom for reseting the graph.- Parameters:
oldY- the array of y coordinates
-
setXs
public void setXs(float[] oldX) setXs - accessor that sets the array of x coordinates to be plotted.- Parameters:
oldX- the array of x coordinates
-
setYs
public void setYs(float[] oldY) setYs - accessor that sets the array of y coordinates to be plotted.- Parameters:
oldY- the array of y coordinates
-