edu.mines.jtk.mosaic
Class TiledView

java.lang.Object
  extended by edu.mines.jtk.mosaic.TiledView
Direct Known Subclasses:
ContoursView, GridView, PixelsView, PointsView, SequenceView, TensorsView, TriMeshView

public abstract class TiledView
extends java.lang.Object

A tiled view in a tile. To paint something in a tile, classes extend and use the methods of this abstract base class.

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

Constructor Summary
TiledView()
           
 
Method Summary
protected  Projector getBestHorizontalProjector()
          Gets the best horizontal projector for this tiled view.
protected  Projector getBestVerticalProjector()
          Gets the best vertical projector for this tiled view.
 Projector getHorizontalProjector()
          Gets the horizontal projector of this tiled view.
protected  float getLineWidth(java.awt.Graphics2D g2d)
          Gets the line width for the specified graphics context.
 Tile getTile()
          Gets the tile that contains this tiled view.
 Transcaler getTranscaler()
          Gets the transcaler of this tiled view.
 Projector getVerticalProjector()
          Gets the vertical projector of this tiled view.
abstract  void paint(java.awt.Graphics2D g2d)
          Paints this tiled view.
protected  void repaint()
          Requests a repaint of the tile that contains this tiled view.
protected  void setBestProjectors(Projector bhp, Projector bvp)
          Sets the best projectors for this tiled view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TiledView

public TiledView()
Method Detail

paint

public abstract void paint(java.awt.Graphics2D g2d)
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.

Parameters:
g2d - the graphics context in which to paint.

getTile

public Tile getTile()
Gets the tile that contains this tiled view.

Returns:
the tile; null, if none.

getHorizontalProjector

public Projector getHorizontalProjector()
Gets the horizontal projector of this tiled view. The returned horizontal projector is a reference to that for the tile that contains this tiled view or null, if this tiled view is not in a tile.

Returns:
the horizontal projector; null, if none.

getVerticalProjector

public Projector getVerticalProjector()
Gets the vertical projector of this tiled view. The returned vertical projector is a reference to that for the tile that contains this tiled view or null, if this tiled view is not in a tile.

Returns:
the vertical projector; null, if none.

getTranscaler

public Transcaler getTranscaler()
Gets the transcaler of this tiled view. The returned transcaler is a reference to that for the tile that contains this tiled view or null, if this tiled view is not in a tile.

Returns:
the transcaler; null, if none.

setBestProjectors

protected void setBestProjectors(Projector bhp,
                                 Projector bvp)
Sets the best projectors for this tiled view. Classes that extend this class call this method when their best projectors change. If this tiled view is in a tile, such a change may cause the tile to realign this view.


getBestHorizontalProjector

protected Projector getBestHorizontalProjector()
Gets the best horizontal projector for this tiled view.

Returns:
the best horizontal projector; by reference, not by copy.

getBestVerticalProjector

protected Projector getBestVerticalProjector()
Gets the best vertical projector for this tiled view.

Returns:
the best vertical projector; by reference, not by copy.

repaint

protected void repaint()
Requests a repaint of the tile that contains this tiled view.


getLineWidth

protected float getLineWidth(java.awt.Graphics2D g2d)
Gets the line width for the specified graphics context.

Parameters:
g2d - the graphics context.
Returns:
the line width.