Class ExprProfileCanvas

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--ExprProfileCanvas
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

class ExprProfileCanvas
extends java.awt.Canvas

The ExprProfileCanvas is used to draw the expression profile. It also tracks locations of points drawn so they can be used with the event handler when the user clicks on a point or bar, etc.

This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government and Djamel Medjahed (SAIC-Frederick). As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file.

Version:
$Date: 2002/10/14 20:17:17 $ $Revision: $
Author:
P. Lemkin (NCI), Djamel Medjahed (SAIC), NCI-Frederick, Frederick, MD
See Also:
ProtPlot Home

This work was derived from prpxplorer under the Mozilla 1.1 Open Source Public License by Peter Lemkin of the National Cancer Institute, an agency of the United States Government subject to the limitations noted in the accompanying LEGAL file. See licence info on http://prpxplorer.sourceforge.org/, Serialized Form


Inner classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  boolean didDataSetupFlag
          set by setupData() if successful
(package private)  boolean drawAdditionalDataFlag
          draw title & additional data if larger format.
(package private)  boolean drawIntoImageFlag
          set if draw plot to GIF file
(package private)  boolean drawLabelsFlag
          ARG: draw labels for larger version
(package private)  ExprProfile ep
          expression profile for mPid
private  int fontHeight
          height font size of current font
private  int fontLeading
          leading font size of current font
private static java.awt.Font lblFont
           
(package private) static int MIN_CANVAS_HEIGHT
          default canvas height size
(package private) static int MIN_CANVAS_WIDTH
          default canvas width size
(package private) static int MODE_CIRCLE
          draw circles for each entry
(package private) static int MODE_CURVE
          draw continuous curve
(package private) static int MODE_LINE
          draw vertical bars
(package private)  java.lang.String oGifFileName
          full Gif file path name
(package private)  int plotStyleMode
          plot mode style: 0=line, 1=circle, 2=curve
 int preferredHeight
          preferred canvas height size
 int preferredWidth
          preferred canvas width size
(package private)  ProtPlot prp
          instance of ProtPlot so we can clear flags indicating the user did a manual quit()
(package private) static int TARGET_SIZE
          target Size for selecting a line
private  java.lang.String title
          ARG: opt.
private static java.awt.Font titleFont
           
(package private)  UtilPRP util
          instance of UtilPRP
(package private)  int xCursor
          event handler mouse X cursor coordinates
(package private)  int yCursor
          event handler mouse Y cursor coordinates
(package private)  int zoomBarsMag
          zoom magnification: by 1X, 2X, 5X, 10X, 20X mod
 
Fields inherited from class java.awt.Canvas
base, nameCounter, serialVersionUID
 
Fields inherited from class java.awt.Component
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dbg, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
(package private) ExprProfileCanvas(ProtPlot prp, int mPid, java.lang.String title, java.awt.Font lblFont, int preferredWidth, int preferredHeight, boolean drawLabelsFlag)
          ExprProfileCanvas() - Constructor to display an expression profile in a canvas.
 
Method Summary
(package private)  boolean drawGifFile(java.lang.String oGifFileName)
          drawGifFile() - draw expression plot into Gif image file.
 java.awt.Dimension getMinimumSize()
          getMinimumSize() - get the minimum preferred size
 java.awt.Dimension getPreferredSize()
          getPreferredSize() - get the preferred size
 void paint(java.awt.Graphics g)
          paint() - draw the expression profile in canvas if a legal protein mPid.
(package private)  boolean updateData(int mPid, java.lang.String title, boolean drawLabelsFlag)
          updateData() - update expression profile plot with new protein data.
 
Methods inherited from class java.awt.Canvas
, addNotify, constructComponentName, getAccessibleContext, postsOldMouseEvents
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkGD, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createChildHierarchyEvents, createHierarchyEvents, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getMaximumSize, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, initIDs, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, layout, lightweightPaint, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, numListening, paintAll, paintHeavyweightComponents, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, printHeavyweightComponents, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, readObject, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

prp

ProtPlot prp
instance of ProtPlot so we can clear flags indicating the user did a manual quit()

util

UtilPRP util
instance of UtilPRP

ep

ExprProfile ep
expression profile for mPid

MODE_LINE

static final int MODE_LINE
draw vertical bars

MODE_CIRCLE

static final int MODE_CIRCLE
draw circles for each entry

MODE_CURVE

static final int MODE_CURVE
draw continuous curve

MIN_CANVAS_WIDTH

static final int MIN_CANVAS_WIDTH
default canvas width size

MIN_CANVAS_HEIGHT

static final int MIN_CANVAS_HEIGHT
default canvas height size

TARGET_SIZE

static final int TARGET_SIZE
target Size for selecting a line

preferredHeight

public int preferredHeight
preferred canvas height size

preferredWidth

public int preferredWidth
preferred canvas width size

lblFont

private static java.awt.Font lblFont

titleFont

private static java.awt.Font titleFont

xCursor

int xCursor
event handler mouse X cursor coordinates

yCursor

int yCursor
event handler mouse Y cursor coordinates

fontHeight

private int fontHeight
height font size of current font

fontLeading

private int fontLeading
leading font size of current font

title

private java.lang.String title
ARG: opt. from user. If drawLabel

plotStyleMode

int plotStyleMode
plot mode style: 0=line, 1=circle, 2=curve

zoomBarsMag

int zoomBarsMag
zoom magnification: by 1X, 2X, 5X, 10X, 20X mod

didDataSetupFlag

boolean didDataSetupFlag
set by setupData() if successful

drawLabelsFlag

boolean drawLabelsFlag
ARG: draw labels for larger version

drawAdditionalDataFlag

boolean drawAdditionalDataFlag
draw title & additional data if larger format.

drawIntoImageFlag

boolean drawIntoImageFlag
set if draw plot to GIF file

oGifFileName

java.lang.String oGifFileName
full Gif file path name
Constructor Detail

ExprProfileCanvas

ExprProfileCanvas(ProtPlot prp,
                  int mPid,
                  java.lang.String title,
                  java.awt.Font lblFont,
                  int preferredWidth,
                  int preferredHeight,
                  boolean drawLabelsFlag)
ExprProfileCanvas() - Constructor to display an expression profile in a canvas.
 If mPid >=0, then display protein info
 If mPid==-1, then display "request to click on a protein"
 If mPid==-2, then don't draw anything.
Parameters:
prp - is the ProtPlot instance
mPid - is the Master Protein Index if not -1
title - is the title for canvas label
lblFont - is the overide labels font if not null
preferredWidth - is the canvas size, 0 to use defaults
preferredHeight -  
drawLabelsFlag - if true
See Also:
ExprProfile.setupData(int)
Method Detail

drawGifFile

boolean drawGifFile(java.lang.String oGifFileName)
drawGifFile() - draw expression plot into Gif image file. This sets it up and lets paint() to the heavy lifting...
Parameters:
oGifFileName - is the full path GIF output file
See Also:
Component.repaint()

getPreferredSize

public java.awt.Dimension getPreferredSize()
getPreferredSize() - get the preferred size
Overrides:
getPreferredSize in class java.awt.Component
Returns:
window size

getMinimumSize

public java.awt.Dimension getMinimumSize()
getMinimumSize() - get the minimum preferred size
Overrides:
getMinimumSize in class java.awt.Component
Returns:
window size

updateData

boolean updateData(int mPid,
                   java.lang.String title,
                   boolean drawLabelsFlag)
updateData() - update expression profile plot with new protein data. Only repaint if a legal protein mPid.
Parameters:
mPid - is the Master Protein Index if not -1
title - is the title for canvas label
drawLabelsFlag - if true
See Also:
ExprProfile.setupData(int), repaint

paint

public void paint(java.awt.Graphics g)
paint() - draw the expression profile in canvas if a legal protein mPid.
Overrides:
paint in class java.awt.Canvas
Parameters:
g - is graphics context