uk.ac.starlink.ttools.plot2.paper
Class MonoPaperType

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.paper.RgbPaperType
      extended by uk.ac.starlink.ttools.plot2.paper.MonoPaperType
All Implemented Interfaces:
PaperType, PaperType2D, PaperType3D

public class MonoPaperType
extends RgbPaperType
implements PaperType2D, PaperType3D

Bitmapped PaperType which can paint transparent or opaque pixels as long as they are all the same colour. That means all painted glyphs and decals must have the same RGB (as specified at construction time), though they may have different alphas.

Since the compositing is pretty much the same (no attention needs to be paid to the depth coordinate) this class implements both the 2D and 3D PaperType interfaces.

Since:
14 Feb 2013
Author:
Mark Taylor

Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.starlink.ttools.plot2.paper.RgbPaperType
RgbPaperType.RgbPaper
 
Constructor Summary
MonoPaperType(Color color, Compositor compositor)
          Constructor.
 
Method Summary
protected  RgbPaperType.RgbPaper createPaper(Rectangle bounds)
          Creates a paper object for given bounds.
 void placeGlyph(Paper paper, double dx, double dy, double dz, Glyph glyph, Color color)
          Places a glyph at a 3-d position in the space.
 void placeGlyph(Paper paper, double dx, double dy, Glyph glyph, Color color)
          Places a glyph at a 2-d position on the paper.
 
Methods inherited from class uk.ac.starlink.ttools.plot2.paper.RgbPaperType
createDataIcon, isBitmap, placeDecal, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface uk.ac.starlink.ttools.plot2.paper.PaperType
createDataIcon, isBitmap, placeDecal
 
Methods inherited from interface uk.ac.starlink.ttools.plot2.paper.PaperType
createDataIcon, isBitmap, placeDecal
 

Constructor Detail

MonoPaperType

public MonoPaperType(Color color,
                     Compositor compositor)
Constructor.

Parameters:
color - single RGB colour for all drawing (alpha component is ignored)
compositor - compositing strategy for translating alphas to displayed colours
Method Detail

createPaper

protected RgbPaperType.RgbPaper createPaper(Rectangle bounds)
Description copied from class: RgbPaperType
Creates a paper object for given bounds.

Specified by:
createPaper in class RgbPaperType
Parameters:
bounds - plot bounds
Returns:
new paper instance

placeGlyph

public void placeGlyph(Paper paper,
                       double dx,
                       double dy,
                       Glyph glyph,
                       Color color)
Description copied from interface: PaperType2D
Places a glyph at a 2-d position on the paper.

Specified by:
placeGlyph in interface PaperType2D
Parameters:
paper - graphics destination specific to this PaperType
dx - X coordinate
dy - Y coordinate
glyph - graphics shape
color - colour for glyph

placeGlyph

public void placeGlyph(Paper paper,
                       double dx,
                       double dy,
                       double dz,
                       Glyph glyph,
                       Color color)
Description copied from interface: PaperType3D
Places a glyph at a 3-d position in the space.

Specified by:
placeGlyph in interface PaperType3D
Parameters:
paper - graphics destination specific to this PaperType
dx - graphics X coordinate
dy - graphics Y coordinate
dz - Z-buffer coordinate; lower values are closer to the viewer
glyph - graphics shape
color - colour for glyph


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.