com.compomics.util.gui
Class VennDiagramDialog

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by com.compomics.util.gui.VennDiagramDialog
All Implemented Interfaces:
ExportGraphicsDialogParent, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class VennDiagramDialog
extends JDialog
implements ExportGraphicsDialogParent

A dialog for creating and displaying Venn diagrams. (Work in progress...)

Author:
Harald Barsnes
See Also:
Serialized Form

Nested Class Summary
static class VennDiagramDialog.VennDiagramType
          The supported Venn diagram types.
 
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
 
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
VennDiagramDialog(Frame dialogParent, Image normalIcon, Image waitingIcon, boolean modal)
          Creates a new XYPlottingDialog.
 
Method Summary
 org.jfree.chart.ChartPanel getChartPanel()
          Returns the chart panel.
 VennDiagramDialog.VennDiagramType getCurrentVennDiagramType()
          Returns the current Venn diagram type.
 String getDefaultExportFolder()
          Returns the default folder used for the export.
 ArrayList<org.jfree.chart.entity.ChartEntity> getEntitiesForPoint(int viewX, int viewY)
          Returns a list of the entities at the given x, y view location.
 HashMap<String,String> getGroupNames()
          Returns a standard map of the group names.
 no.uib.jsparklines.data.XYDataPoint getLegendDatasetAFourWay()
          Returns the legend location of dataset A in a four way Venn diagram.
 no.uib.jsparklines.data.XYDataPoint getLegendDatasetAThreeWay()
          Returns the legend location of Dataset A in a three way Venn diagram.
 no.uib.jsparklines.data.XYDataPoint getLegendDatasetBFourWay()
          Returns the legend location of dataset B in a four way Venn diagram.
 no.uib.jsparklines.data.XYDataPoint getLegendDatasetBThreeWay()
          Returns the legend location of dataset B in a three way Venn diagram.
 no.uib.jsparklines.data.XYDataPoint getLegendDatasetCFourWay()
          Returns the legend location of dataset C in a four way Venn diagram.
 no.uib.jsparklines.data.XYDataPoint getLegendDatasetCThreeWay()
          Returns the legend location of dataset C in a three way Venn diagram.
 no.uib.jsparklines.data.XYDataPoint getLegendDatasetDFourWay()
          Returns the legend location of dataset D in a four way Venn diagram.
 Image getNormalIcon()
          Returns the normal icon.
 Image getWaitingIcon()
          Returns the waiting icon.
static void main(String[] args)
          Main method.
 void mouseClickedInChart(org.jfree.chart.ChartMouseEvent event)
          Handles mouse clicks in the chart panel.
 void mouseMovedInChart(org.jfree.chart.ChartMouseEvent event)
          Handles mouse movements in the chart panel.
 void setLegendDatasetAFourWay(no.uib.jsparklines.data.XYDataPoint legendDatasetAFourWay)
          Set the legend location of Dataset A in a four way Venn diagram.
 void setLegendDatasetAThreeWay(no.uib.jsparklines.data.XYDataPoint legendDatasetAThreeWay)
          Set the legend location of Dataset A in a three way Venn diagram.
 void setLegendDatasetBFourWay(no.uib.jsparklines.data.XYDataPoint legendDatasetBFourWay)
          Set the legend location of Dataset B in a four way Venn diagram.
 void setLegendDatasetBThreeWay(no.uib.jsparklines.data.XYDataPoint legendDatasetBThreeWay)
          Set the legend location of Dataset B in a three way Venn diagram.
 void setLegendDatasetCFourWay(no.uib.jsparklines.data.XYDataPoint legendDatasetCFourWay)
          Set the legend location of Dataset C in a four way Venn diagram.
 void setLegendDatasetCThreeWay(no.uib.jsparklines.data.XYDataPoint legendDatasetCThreeWay)
          Set the legend location of Dataset C in a three way Venn diagram.
 void setLegendDatasetDFourWay(no.uib.jsparklines.data.XYDataPoint legendDatasetDFourWay)
          Set the legend location of Dataset D in a four way Venn diagram.
 void setSelectedExportFolder(String selectedFolder)
          Set the default folder to use for exporting the graphics.
 void updatePlot()
          Update the plot.
 HashMap<String,ArrayList<String>> vennDiagramMaker(ArrayList<String> groupA, ArrayList<String> groupB, ArrayList<String> groupC, ArrayList<String> groupD)
          Create the Venn diagram groupings based on the provided data.
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VennDiagramDialog

public VennDiagramDialog(Frame dialogParent,
                         Image normalIcon,
                         Image waitingIcon,
                         boolean modal)
Creates a new XYPlottingDialog.

Parameters:
dialogParent - the dialog parent
modal -
normalIcon - the normal icon for the parent dialog
waitingIcon - the icon to use when busy
Method Detail

main

public static void main(String[] args)
Main method. For testing purposes only.

Parameters:
args -

updatePlot

public void updatePlot()
Update the plot.


mouseClickedInChart

public void mouseClickedInChart(org.jfree.chart.ChartMouseEvent event)
Handles mouse clicks in the chart panel.

Parameters:
event -

mouseMovedInChart

public void mouseMovedInChart(org.jfree.chart.ChartMouseEvent event)
Handles mouse movements in the chart panel.

Parameters:
event -

getEntitiesForPoint

public ArrayList<org.jfree.chart.entity.ChartEntity> getEntitiesForPoint(int viewX,
                                                                         int viewY)
Returns a list of the entities at the given x, y view location.

Parameters:
viewX - the x location
viewY - the y location
Returns:
a list of the entities

setSelectedExportFolder

public void setSelectedExportFolder(String selectedFolder)
Description copied from interface: ExportGraphicsDialogParent
Set the default folder to use for exporting the graphics. Can be changed by the user later.

Specified by:
setSelectedExportFolder in interface ExportGraphicsDialogParent
Parameters:
selectedFolder - the default folder

getDefaultExportFolder

public String getDefaultExportFolder()
Description copied from interface: ExportGraphicsDialogParent
Returns the default folder used for the export.

Specified by:
getDefaultExportFolder in interface ExportGraphicsDialogParent
Returns:
the default folder used for the export

vennDiagramMaker

public HashMap<String,ArrayList<String>> vennDiagramMaker(ArrayList<String> groupA,
                                                          ArrayList<String> groupB,
                                                          ArrayList<String> groupC,
                                                          ArrayList<String> groupD)
Create the Venn diagram groupings based on the provided data.

Parameters:
groupA -
groupB -
groupC -
groupD -
Returns:
the Venn diagram groupings

getNormalIcon

public Image getNormalIcon()
Description copied from interface: ExportGraphicsDialogParent
Returns the normal icon.

Specified by:
getNormalIcon in interface ExportGraphicsDialogParent
Returns:
the normal icon

getWaitingIcon

public Image getWaitingIcon()
Description copied from interface: ExportGraphicsDialogParent
Returns the waiting icon.

Specified by:
getWaitingIcon in interface ExportGraphicsDialogParent
Returns:
the waiting icon

getChartPanel

public org.jfree.chart.ChartPanel getChartPanel()
Returns the chart panel.

Returns:
the chart panel

getGroupNames

public HashMap<String,String> getGroupNames()
Returns a standard map of the group names. Keys: a, b, c and d.

Returns:
a standard map of the group names

getLegendDatasetAThreeWay

public no.uib.jsparklines.data.XYDataPoint getLegendDatasetAThreeWay()
Returns the legend location of Dataset A in a three way Venn diagram.

Returns:
the legendDatasetAThreeWay

setLegendDatasetAThreeWay

public void setLegendDatasetAThreeWay(no.uib.jsparklines.data.XYDataPoint legendDatasetAThreeWay)
Set the legend location of Dataset A in a three way Venn diagram.

Parameters:
legendDatasetAThreeWay - the legendDatasetAThreeWay to set

getLegendDatasetBThreeWay

public no.uib.jsparklines.data.XYDataPoint getLegendDatasetBThreeWay()
Returns the legend location of dataset B in a three way Venn diagram.

Returns:
the legendDatasetBThreeWay

setLegendDatasetBThreeWay

public void setLegendDatasetBThreeWay(no.uib.jsparklines.data.XYDataPoint legendDatasetBThreeWay)
Set the legend location of Dataset B in a three way Venn diagram.

Parameters:
legendDatasetBThreeWay - the legendDatasetBThreeWay to set

getLegendDatasetCThreeWay

public no.uib.jsparklines.data.XYDataPoint getLegendDatasetCThreeWay()
Returns the legend location of dataset C in a three way Venn diagram.

Returns:
the legendDatasetCThreeWay

setLegendDatasetCThreeWay

public void setLegendDatasetCThreeWay(no.uib.jsparklines.data.XYDataPoint legendDatasetCThreeWay)
Set the legend location of Dataset C in a three way Venn diagram.

Parameters:
legendDatasetCThreeWay - the legendDatasetCThreeWay to set

getLegendDatasetAFourWay

public no.uib.jsparklines.data.XYDataPoint getLegendDatasetAFourWay()
Returns the legend location of dataset A in a four way Venn diagram.

Returns:
the legendDatasetAFourWay

setLegendDatasetAFourWay

public void setLegendDatasetAFourWay(no.uib.jsparklines.data.XYDataPoint legendDatasetAFourWay)
Set the legend location of Dataset A in a four way Venn diagram.

Parameters:
legendDatasetAFourWay - the legendDatasetAFourWay to set

getLegendDatasetBFourWay

public no.uib.jsparklines.data.XYDataPoint getLegendDatasetBFourWay()
Returns the legend location of dataset B in a four way Venn diagram.

Returns:
the legendDatasetBFourWay

setLegendDatasetBFourWay

public void setLegendDatasetBFourWay(no.uib.jsparklines.data.XYDataPoint legendDatasetBFourWay)
Set the legend location of Dataset B in a four way Venn diagram.

Parameters:
legendDatasetBFourWay - the legendDatasetBFourWay to set

getLegendDatasetCFourWay

public no.uib.jsparklines.data.XYDataPoint getLegendDatasetCFourWay()
Returns the legend location of dataset C in a four way Venn diagram.

Returns:
the legendDatasetCFourWay

setLegendDatasetCFourWay

public void setLegendDatasetCFourWay(no.uib.jsparklines.data.XYDataPoint legendDatasetCFourWay)
Set the legend location of Dataset C in a four way Venn diagram.

Parameters:
legendDatasetCFourWay - the legendDatasetCFourWay to set

getLegendDatasetDFourWay

public no.uib.jsparklines.data.XYDataPoint getLegendDatasetDFourWay()
Returns the legend location of dataset D in a four way Venn diagram.

Returns:
the legendDatasetDFourWay

setLegendDatasetDFourWay

public void setLegendDatasetDFourWay(no.uib.jsparklines.data.XYDataPoint legendDatasetDFourWay)
Set the legend location of Dataset D in a four way Venn diagram.

Parameters:
legendDatasetDFourWay - the legendDatasetDFourWay to set

getCurrentVennDiagramType

public VennDiagramDialog.VennDiagramType getCurrentVennDiagramType()
Returns the current Venn diagram type.

Returns:
the currentVennDiagramType


Copyright © 2013. All Rights Reserved.