org.fhcrc.cpl.toolbox.gui.chart
Class PanelWithRPerspectivePlot

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.fhcrc.cpl.toolbox.gui.chart.PanelWithChart
                      extended by org.fhcrc.cpl.toolbox.gui.chart.PanelWithBlindImageChart
                          extended by org.fhcrc.cpl.toolbox.gui.chart.PanelWithRPerspectivePlot
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class PanelWithRPerspectivePlot
extends PanelWithBlindImageChart

This class knows how to ask R to plot perspective 3D charts to a file and then display them in a panel

See Also:
Serialized Form

Nested Class Summary
static class PanelWithRPerspectivePlot.LineVariables
           
 
Nested classes/interfaces inherited from class org.fhcrc.cpl.toolbox.gui.chart.PanelWithBlindImageChart
PanelWithBlindImageChart.PopupListener, PanelWithBlindImageChart.ResizeListener
 
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
protected static org.apache.log4j.Logger _log
           
protected  java.lang.String backgroundColorString
           
protected  int chartHeight
           
protected  int chartWidth
           
static java.lang.String DEFAULT_BACKGROUND_COLOR_STRING
           
static int DEFAULT_CHART_DIALOG_HEIGHT
           
static int DEFAULT_CHART_DIALOG_WIDTH
           
static int DEFAULT_CHART_HEIGHT
           
static int DEFAULT_CHART_WIDTH
           
static java.lang.String DEFAULT_FOREGROUND_COLOR_STRING
           
static int DEFAULT_LINE_STYLE
           
static int DEFAULT_ROTATION_ANGLE
           
static double DEFAULT_SHADE
           
static int DEFAULT_TILT_ANGLE
           
protected  java.lang.String foregroundColorString
           
static int LINE_STYLE_DASHED
           
static int LINE_STYLE_DOTTED
           
static int LINE_STYLE_SOLID
           
protected  java.util.List<java.lang.Integer> lineStyleList
           
protected  java.util.List<PanelWithRPerspectivePlot.LineVariables> lineVariableList
           
protected  int millisToWait
           
protected  java.util.List<java.lang.Integer> rotationAngles
           
protected  double shade
           
protected  boolean showAxisDetails
           
protected  boolean showBorders
           
protected  boolean showBox
           
protected  java.util.List<java.lang.Integer> tiltAngles
           
protected  boolean useGradientForColor
           
protected  java.lang.String xAxisName
           
protected  java.lang.String yAxisName
           
protected  java.lang.String zAxisName
           
 
Fields inherited from class org.fhcrc.cpl.toolbox.gui.chart.PanelWithBlindImageChart
allImages, image, imagePanel, popupMenu, scrollPane
 
Fields inherited from class org.fhcrc.cpl.toolbox.gui.chart.PanelWithChart
_chart, _chartPanel, _plot, DEFAULT_HEIGHT_FOR_IMAGE_FILE, DEFAULT_WIDTH_FOR_IMAGE_FILE
 
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
PanelWithRPerspectivePlot()
           
 
Method Summary
 void addLine(double[] xValues, double[] yValues, double[] zValues, java.lang.String color)
          Draw a solid line
 void addLine(double[] xValues, double[] yValues, double[] zValues, java.lang.String color, int style)
          Draw a line in the specified style
protected  int calcBin(double val, double globalMin, double binSize)
           
protected  int countBins(double minValue, double maxValue, double binSize)
           
protected  double[] enumerateBins(double minValue, double binSize, int numBins)
           
 void finalize()
           
 java.lang.String getBackgroundColorString()
           
 int getChartHeight()
           
 int getChartWidth()
           
 java.lang.String getForegroundColorString()
           
 int getMillisToWait()
           
 java.util.List<java.lang.Integer> getRotationAngles()
           
 double getShade()
           
 boolean getShowAxisDetails()
           
 java.util.List<java.lang.Integer> getTiltAngles()
           
 boolean isShowBorders()
           
 boolean isShowBox()
           
 boolean isUseGradientForColor()
           
 void plot(double[] xArray, double[] yArray, double[][] zMatrix)
           
 void plot(float[] xArray, float[] yArray, double[][] zMatrix)
           
 void plot(float[] xArray, float[] yArray, float[][] zMatrix)
           
 void plotPointsSummary(double[] xValues, double[] yValues, double xBinSize, double yBinSize)
           
 void plotPointsSummary(java.util.List<java.lang.Float> xValuesList, java.util.List<java.lang.Float> yValuesList, double xBinSize, double yBinSize)
           
 void setAxisRVariableNames(java.lang.String xName, java.lang.String yName, java.lang.String zName)
           
 void setBackgroundColorString(java.lang.String backgroundColorString)
           
 void setChartHeight(int chartHeight)
           
 void setChartWidth(int chartWidth)
           
 void setForegroundColorString(java.lang.String foregroundColorString)
           
 void setMillisToWait(int millisToWait)
           
 void setRotationAngle(int rotationAngle)
           
 void setRotationAngles(java.util.List<java.lang.Integer> rotationAngles)
           
 void setShade(double shade)
           
 void setShowAxisDetails(boolean showAxisDetails)
           
 void setShowBorders(boolean showBorders)
           
 void setShowBox(boolean showBox)
           
 void setTiltAngle(int tiltAngle)
           
 void setTiltAngles(java.util.List<java.lang.Integer> tiltAngles)
           
 void setUseGradientForColor(boolean useGradientForColor)
           
 
Methods inherited from class org.fhcrc.cpl.toolbox.gui.chart.PanelWithBlindImageChart
addItemToPopupMenu, addSeparatorToPopupMenu, createImage, cycleImageNext, cycleImagePrevious, displayImage, getImage, initPopupMenu, saveAllImagesToFiles, saveChartDataToFile, saveChartToImageFile, setImage, setImage, setImageFiles, setImages, setPreferredSize
 
Methods inherited from class org.fhcrc.cpl.toolbox.gui.chart.PanelWithChart
createImage, displayDialog, displayInTab, displayInTab, getChart, getChartPanel, getPlot, getToolTipText, init, init, isShowLegend, saveChartDataToCSV, saveChartDataToTSV, saveChartToImageFile, setShowLegend
 
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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, 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, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_log

protected static org.apache.log4j.Logger _log

DEFAULT_CHART_WIDTH

public static final int DEFAULT_CHART_WIDTH
See Also:
Constant Field Values

DEFAULT_CHART_HEIGHT

public static final int DEFAULT_CHART_HEIGHT
See Also:
Constant Field Values

DEFAULT_CHART_DIALOG_WIDTH

public static final int DEFAULT_CHART_DIALOG_WIDTH
See Also:
Constant Field Values

DEFAULT_CHART_DIALOG_HEIGHT

public static final int DEFAULT_CHART_DIALOG_HEIGHT
See Also:
Constant Field Values

DEFAULT_ROTATION_ANGLE

public static final int DEFAULT_ROTATION_ANGLE
See Also:
Constant Field Values

DEFAULT_TILT_ANGLE

public static final int DEFAULT_TILT_ANGLE
See Also:
Constant Field Values

DEFAULT_SHADE

public static final double DEFAULT_SHADE
See Also:
Constant Field Values

useGradientForColor

protected boolean useGradientForColor

showBorders

protected boolean showBorders

showBox

protected boolean showBox

chartWidth

protected int chartWidth

chartHeight

protected int chartHeight

rotationAngles

protected java.util.List<java.lang.Integer> rotationAngles

tiltAngles

protected java.util.List<java.lang.Integer> tiltAngles

shade

protected double shade

LINE_STYLE_SOLID

public static final int LINE_STYLE_SOLID
See Also:
Constant Field Values

LINE_STYLE_DASHED

public static final int LINE_STYLE_DASHED
See Also:
Constant Field Values

LINE_STYLE_DOTTED

public static final int LINE_STYLE_DOTTED
See Also:
Constant Field Values

DEFAULT_LINE_STYLE

public static final int DEFAULT_LINE_STYLE
See Also:
Constant Field Values

DEFAULT_BACKGROUND_COLOR_STRING

public static final java.lang.String DEFAULT_BACKGROUND_COLOR_STRING
See Also:
Constant Field Values

DEFAULT_FOREGROUND_COLOR_STRING

public static final java.lang.String DEFAULT_FOREGROUND_COLOR_STRING
See Also:
Constant Field Values

xAxisName

protected java.lang.String xAxisName

yAxisName

protected java.lang.String yAxisName

zAxisName

protected java.lang.String zAxisName

showAxisDetails

protected boolean showAxisDetails

backgroundColorString

protected java.lang.String backgroundColorString

foregroundColorString

protected java.lang.String foregroundColorString

lineVariableList

protected java.util.List<PanelWithRPerspectivePlot.LineVariables> lineVariableList

lineStyleList

protected java.util.List<java.lang.Integer> lineStyleList

millisToWait

protected int millisToWait
Constructor Detail

PanelWithRPerspectivePlot

public PanelWithRPerspectivePlot()
Method Detail

plotPointsSummary

public void plotPointsSummary(java.util.List<java.lang.Float> xValuesList,
                              java.util.List<java.lang.Float> yValuesList,
                              double xBinSize,
                              double yBinSize)

plotPointsSummary

public void plotPointsSummary(double[] xValues,
                              double[] yValues,
                              double xBinSize,
                              double yBinSize)

calcBin

protected int calcBin(double val,
                      double globalMin,
                      double binSize)

countBins

protected int countBins(double minValue,
                        double maxValue,
                        double binSize)

enumerateBins

protected double[] enumerateBins(double minValue,
                                 double binSize,
                                 int numBins)

plot

public void plot(float[] xArray,
                 float[] yArray,
                 float[][] zMatrix)

plot

public void plot(float[] xArray,
                 float[] yArray,
                 double[][] zMatrix)

addLine

public void addLine(double[] xValues,
                    double[] yValues,
                    double[] zValues,
                    java.lang.String color)
Draw a solid line

Parameters:
xValues -
yValues -
zValues -
color -

addLine

public void addLine(double[] xValues,
                    double[] yValues,
                    double[] zValues,
                    java.lang.String color,
                    int style)
Draw a line in the specified style

Parameters:
xValues -
yValues -
zValues -
color -
style - must be an accepted value of the 'lty' variable to R's 'par'

plot

public void plot(double[] xArray,
                 double[] yArray,
                 double[][] zMatrix)

setAxisRVariableNames

public void setAxisRVariableNames(java.lang.String xName,
                                  java.lang.String yName,
                                  java.lang.String zName)

getRotationAngles

public java.util.List<java.lang.Integer> getRotationAngles()

setRotationAngles

public void setRotationAngles(java.util.List<java.lang.Integer> rotationAngles)

getTiltAngles

public java.util.List<java.lang.Integer> getTiltAngles()

setTiltAngles

public void setTiltAngles(java.util.List<java.lang.Integer> tiltAngles)

setRotationAngle

public void setRotationAngle(int rotationAngle)

setTiltAngle

public void setTiltAngle(int tiltAngle)

getShade

public double getShade()

setShade

public void setShade(double shade)

getChartHeight

public int getChartHeight()

setChartHeight

public void setChartHeight(int chartHeight)

getChartWidth

public int getChartWidth()

setChartWidth

public void setChartWidth(int chartWidth)

getBackgroundColorString

public java.lang.String getBackgroundColorString()

setBackgroundColorString

public void setBackgroundColorString(java.lang.String backgroundColorString)

getForegroundColorString

public java.lang.String getForegroundColorString()

setForegroundColorString

public void setForegroundColorString(java.lang.String foregroundColorString)

getShowAxisDetails

public boolean getShowAxisDetails()

setShowAxisDetails

public void setShowAxisDetails(boolean showAxisDetails)

getMillisToWait

public int getMillisToWait()

setMillisToWait

public void setMillisToWait(int millisToWait)

isUseGradientForColor

public boolean isUseGradientForColor()

setUseGradientForColor

public void setUseGradientForColor(boolean useGradientForColor)

isShowBorders

public boolean isShowBorders()

setShowBorders

public void setShowBorders(boolean showBorders)

isShowBox

public boolean isShowBox()

setShowBox

public void setShowBox(boolean showBox)

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable


Fred Hutchinson Cancer Research Center