edu.mines.jtk.mosaic
Class ContoursView

java.lang.Object
  extended by edu.mines.jtk.mosaic.TiledView
      extended by edu.mines.jtk.mosaic.ContoursView

public class ContoursView
extends TiledView

A view of a sampled function f(x1,x2), displayed with contour lines.

NOT YET IMPLEMENTED!

Version:
2006.01.02
Author:
Dave Hale, Colorado School of Mines

Nested Class Summary
static class ContoursView.Orientation
          Orientation of sample axes x1 and x2.
 
Constructor Summary
ContoursView(float[][] f)
          Constructs a pixels view of the specified sampled function f(x1,x2).
ContoursView(Sampling s1, Sampling s2, float[][] f)
          Constructs a pixels view of the specified sampled function f(x1,x2).
 
Method Summary
 float getClipMax()
          Gets the maximum clip value.
 float getClipMin()
          Gets the minimum clip value.
 ContoursView.Orientation getOrientation()
          Gets the orientation of sample axes.
 float getPercentileMax()
          Gets the maximum percentile.
 float getPercentileMin()
          Gets the minimum percentile.
 void paint(java.awt.Graphics2D g2d)
          Paints this tiled view.
 void set(float[][] f)
          Sets the sampled function f(x1,x2) for this view.
 void set(Sampling s1, Sampling s2, float[][] f)
          Sets the sampled function f(x1,x2) for this view.
 void setClips(float clipMin, float clipMax)
          Sets the clips for this view.
 void setOrientation(ContoursView.Orientation orientation)
          Sets the orientation of sample axes.
 void setPercentiles(float percMin, float percMax)
          Sets the percentiles used to compute clips for this view.
 
Methods inherited from class edu.mines.jtk.mosaic.TiledView
getBestHorizontalProjector, getBestVerticalProjector, getHorizontalProjector, getLineWidth, getTile, getTranscaler, getVerticalProjector, repaint, setBestProjectors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContoursView

public ContoursView(float[][] f)
Constructs a pixels view of the specified sampled function f(x1,x2). Assumes zero first sample values and unit sampling intervals.

Parameters:
f - array[n2][n1] of sampled function values f(x1,x2), where n1 = f[0].length and n2 = f.length.

ContoursView

public ContoursView(Sampling s1,
                    Sampling s2,
                    float[][] f)
Constructs a pixels view of the specified sampled function f(x1,x2).

Parameters:
s1 - the sampling of the variable x1; must be uniform.
s2 - the sampling of the variable x2; must be uniform.
f - array[n2][n1] of sampled function values f(x1,x2), where n1 and n2 denote the number of samples in s1 and s2, respectively.
Method Detail

set

public void set(float[][] f)
Sets the sampled function f(x1,x2) for this view. Assumes zero first sample values and unit sampling intervals.

Parameters:
f - array[n2][n1] of sampled function values f(x1,x2), where n1 = f[0].length and n2 = f.length.

set

public void set(Sampling s1,
                Sampling s2,
                float[][] f)
Sets the sampled function f(x1,x2) for this view.

Parameters:
s1 - the sampling of the variable x1; must be uniform.
s2 - the sampling of the variable x2; must be uniform.
f - array[n2][n1] of sampled function values f(x1,x2), where n1 and n2 denote the number of samples in s1 and s2, respectively.

setOrientation

public void setOrientation(ContoursView.Orientation orientation)
Sets the orientation of sample axes.

Parameters:
orientation - the orientation.

getOrientation

public ContoursView.Orientation getOrientation()
Gets the orientation of sample axes.

Returns:
the orientation.

setClips

public void setClips(float clipMin,
                     float clipMax)
Sets the clips for this view. Contour lines are not plotted for function values f(x1,x2) outside the specified min-max range.

Calling this method disables the computation of clips from percentiles. Any clip values computed or specified previously will be forgotten.

Parameters:
clipMin - the sample value corresponding to color map byte index 0.
clipMax - the sample value corresponding to color map byte index 255.

getClipMin

public float getClipMin()
Gets the minimum clip value.

Returns:
the minimum clip value.

getClipMax

public float getClipMax()
Gets the maximum clip value.

Returns:
the maximum clip value.

setPercentiles

public void setPercentiles(float percMin,
                           float percMax)
Sets the percentiles used to compute clips for this view. The default percentiles are 0 and 100, which correspond to the minimum and maximum values of the sampled function f(x1,x2).

Calling this method enables the computation of clips from percentiles. Any clip values specified or computed previously will be forgotten.

Parameters:
percMin - the percentile corresponding to clipMin.
percMax - the percentile corresponding to clipMax.

getPercentileMin

public float getPercentileMin()
Gets the minimum percentile.

Returns:
the minimum percentile.

getPercentileMax

public float getPercentileMax()
Gets the maximum percentile.

Returns:
the maximum percentile.

paint

public void paint(java.awt.Graphics2D g2d)
Description copied from class: TiledView
Paints this tiled view. This method is implemented by classes that extend this abstract base class. Implementations may modify the specified graphics context freely. Such modifications will not affect the paintings of other tiled views in the same tile or mosaic.

Tiled views should not replace (set) entirely the transform in the specified graphics context. This transform may already have been set by the tile or its mosaic. Therefore, tiled views should modify this transform only by specifying additional scaling, translation, etc.

Specified by:
paint in class TiledView
Parameters:
g2d - the graphics context in which to paint.