# Class SubPopGraph

    java.lang.Object
       |
       +----java.awt.Component
               |
               +----java.awt.Container
                       |
                       +----java.awt.Panel
                               |
                               +----SubPopGraph

public class SubPopGraph
extends Panel

This class is responsible for generating a visual representation of the sub-population exchanges. It uses double buffering and all that other cool stuff.....

See Also:
  SubPopFrame

##

exchanges
graphHeight
graphWidth
radius

##

SubPopGraph(SubPopFrame, int)
  Initialize instance variables and resize the panel

##

backgroundPaint(Graphics)
  The method that actually does all of the drawing.
minimumSize()
  Calculate the minimum size of the panel
paint(Graphics)
  The overridden paint method responsible for figuring out if we are double-buffered or not and then dispatching the drawing
preferredSize()
  Calculate the preferred size of the panel
refreshGraph(Exchange[])
  After accepting a new set of exchanges, redraw the sub pop graph

##

graphWidth

      public final static int graphWidth

graphHeight

      public final static int graphHeight

radius

      public final static int radius

exchanges

      public Exchange exchanges[]

##

SubPopGraph

      public SubPopGraph(SubPopFrame spf,
                         int n)

  Initialize instance variables and resize the panel
  Parameters:
    spf - a reference to the SubPopFrame that created me
    n - the number of sub populations

##

refreshGraph

      public void refreshGraph(Exchange exArray[])

  After accepting a new set of exchanges, redraw the sub pop graph
  Parameters:
    exArray - an array of `Exchange` objects

backgroundPaint

      public void backgroundPaint(Graphics g)

  The method that actually does all of the drawing. It paints the background, then the exchange links, the link arrowheads, and finally the sub pops.
  Parameters:
    g - the graphics object

paint

      public void paint(Graphics g)

  The overridden paint method responsible for figuring out if we are double-buffered or not and then dispatching the drawing
  Parameters:
    g - the graphics object
  Overrides:
    paint in class Component

minimumSize

      public Dimension minimumSize()

  Calculate the minimum size of the panel
  Returns:
    the dimensions of the graph
  Overrides:
    minimumSize in class Container

preferredSize

      public Dimension preferredSize()

  Calculate the preferred size of the panel
  Returns:
    the minimum size of the panel
  Overrides:
    preferredSize in class Container