Class RgbPaperType
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.paper.RgbPaperType
-
- All Implemented Interfaces:
PaperType
- Direct Known Subclasses:
MonoPaperType
,RgbPaperType2D
,RgbPaperType3D
public abstract class RgbPaperType extends java.lang.Object implements PaperType
Abstract bitmapped PaperType which uses an RgbImage to store graphics. Abstract subclasses are provided for different geometries, and concrete implementations have to provide their own compositing which operates on the supplied RgbImage, using either the BufferedImage or the backing buffer.- Since:
- 14 Feb 2013
- Author:
- Mark Taylor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
RgbPaperType.RgbPaper
Paper for use by this type.
-
Constructor Summary
Constructors Modifier Constructor Description protected
RgbPaperType(java.lang.String name, boolean upLayer)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description javax.swing.Icon
createDataIcon(Surface surface, Drawing[] drawings, java.lang.Object[] plans, DataStore dataStore, boolean requireCached)
Paints the content of a list of drawing objects onto a given plot surface, and returns the result as an Icon.protected abstract RgbPaperType.RgbPaper
createPaper(java.awt.Rectangle bounds)
Creates a paper object for given bounds.boolean
isBitmap()
Returns true.void
placeDecal(Paper paper, Decal decal)
Simply calls theRgbPaperType.RgbPaper.placeDecal(uk.ac.starlink.ttools.plot2.Decal)
method.java.lang.String
toString()
-
-
-
Method Detail
-
isBitmap
public boolean isBitmap()
Returns true.
-
placeDecal
public void placeDecal(Paper paper, Decal decal)
Simply calls theRgbPaperType.RgbPaper.placeDecal(uk.ac.starlink.ttools.plot2.Decal)
method.- Specified by:
placeDecal
in interfacePaperType
- Parameters:
paper
- graphics destination, of appropriate type for this objectdecal
- graphic to paint
-
createDataIcon
public javax.swing.Icon createDataIcon(Surface surface, Drawing[] drawings, java.lang.Object[] plans, DataStore dataStore, boolean requireCached)
Description copied from interface:PaperType
Paints the content of a list of drawing objects onto a given plot surface, and returns the result as an Icon.The
requireCached
argument provides a hint about whether the output icon will cache computations. Set this true if you might want to paint the returned icon multiple times, false if it is one-shot only, or if keeping the memory footprint small is more important than speed.In general it's OK to call the
paintIcon
method of the returned object with a nullComponent
. The returned icon is the size of theplotBounds
rectangle, and will be painted at plotBounds.x, plotBounds.y. It contains everything in that region except perhaps for decorations, and it is opaque. It does not (cannot) contain external axis labels, but must contain any internal markings which appear underneath the data points.An implementation will usually create a Paper object and pass it in turn to the supplied
drawings
so that the returned icon can be based on the drawn-on paper.- Specified by:
createDataIcon
in interfacePaperType
- Parameters:
surface
- plot surfacedrawings
- array of drawing objects to be painted in sequenceplans
- array of plan objects corresponding to thedrawings
array argumentdataStore
- data storage objectrequireCached
- hint about whether to cache the calculation data- Returns:
- plotBounds-sized icon
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
createPaper
protected abstract RgbPaperType.RgbPaper createPaper(java.awt.Rectangle bounds)
Creates a paper object for given bounds.- Parameters:
bounds
- plot bounds- Returns:
- new paper instance
-
-