sources
Class FlowLayer

java.lang.Object
  extended bysources.Layer
      extended bysources.FlowLayer

public class FlowLayer
extends Layer

A class to draw flows between nodes (not aggregated, no transfer points)


Field Summary
 
Fields inherited from class sources.Layer
mode, nonCol, selCol
 
Constructor Summary
FlowLayer(LDataSet data, ContinuousVariable vx1, ContinuousVariable vy1, ContinuousVariable vx2, ContinuousVariable vy2, ContinuousVariable vweight, double vxmin, double vymin, double vxmax, double vymax, boolean onlySelected, int mod)
          Creates new FlowLayer
 
Method Summary
 void changeBinheight(int i)
          change the binheight
 void changeMaxBinheight(int i)
          change the maximal binheight
 void createPolygons(int width, int height, boolean onlyselected)
          prepare the polygons for painting
 void createValues(boolean onlySelected)
          calculate all values
 java.lang.Object getObjectAtKoord(int x, int y, boolean selected)
          returns a boolean Array of cases under x and y
 java.lang.Object getObjectsUnderRect(java.awt.Rectangle rect, boolean selected)
          returns a boolean array of cases intersecting with a rectangle
 boolean isOnly()
          Getter for property only.
 void paintLayer(java.awt.Graphics2D g, boolean selected, java.awt.Rectangle vsRect)
          paints all Flows
 void setOnly(boolean only)
          Setter for property only.
 
Methods inherited from class sources.Layer
getMode, setForegroundColor, setMode, setSelectionColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowLayer

public FlowLayer(LDataSet data,
                 ContinuousVariable vx1,
                 ContinuousVariable vy1,
                 ContinuousVariable vx2,
                 ContinuousVariable vy2,
                 ContinuousVariable vweight,
                 double vxmin,
                 double vymin,
                 double vxmax,
                 double vymax,
                 boolean onlySelected,
                 int mod)
Creates new FlowLayer

Parameters:
data - the parent LDataSet
vx1 - X-Coordinates of sources
vy1 - Y-Coordinates of sources
vx2 - X-Coordinates of targets
vy2 - Y-Coordinates of targets
vweight - weights of the flows
vxmin - minimal x-value for drawing
vymin - minimal y-value for drawing
vxmax - maximal x-value for drawing
vymax - maximal y-value for drawing
onlySelected - true, if only selected flows shall be visible
Method Detail

createPolygons

public void createPolygons(int width,
                           int height,
                           boolean onlyselected)
prepare the polygons for painting

Specified by:
createPolygons in class Layer
Parameters:
width - the width of the image
height - the height of the image
onlyselected - true, if only selected items shall be recalculated

paintLayer

public void paintLayer(java.awt.Graphics2D g,
                       boolean selected,
                       java.awt.Rectangle vsRect)
paints all Flows

Specified by:
paintLayer in class Layer
Parameters:
selected - true, if only selected values shall be recalculated
g - the Graphics to paint on
vsRect - visible Rectangle

getObjectAtKoord

public java.lang.Object getObjectAtKoord(int x,
                                         int y,
                                         boolean selected)
returns a boolean Array of cases under x and y

Specified by:
getObjectAtKoord in class Layer
Parameters:
x - the x coordinate
y - the y coordinate
Returns:
the boolean array

getObjectsUnderRect

public java.lang.Object getObjectsUnderRect(java.awt.Rectangle rect,
                                            boolean selected)
returns a boolean array of cases intersecting with a rectangle

Specified by:
getObjectsUnderRect in class Layer
Parameters:
selected - true, if only selected values are shown
rect - the Rectangle
Returns:
the boolean array

changeBinheight

public void changeBinheight(int i)
change the binheight

Specified by:
changeBinheight in class Layer
Parameters:
i - the new binheight

changeMaxBinheight

public void changeMaxBinheight(int i)
change the maximal binheight

Specified by:
changeMaxBinheight in class Layer
Parameters:
i - the new maximum binheight

createValues

public void createValues(boolean onlySelected)
calculate all values

Specified by:
createValues in class Layer
Parameters:
onlySelected - true, if only selected values shall be recalculated

isOnly

public boolean isOnly()
Getter for property only.

Specified by:
isOnly in class Layer
Returns:
Value of property only.

setOnly

public void setOnly(boolean only)
Setter for property only.

Specified by:
setOnly in class Layer
Parameters:
only - New value of property only.