Class ALcdRasterPainter
- All Implemented Interfaces:
ILcdRasterPainter
,ILcdCloneable
,ILcdPropertyChangeSource
,ILcdGXYPainter
,ILcdGXYPainterProvider
,Serializable
,Cloneable
- Direct Known Subclasses:
TLcdAllInMemoryRasterPainter
,TLcdMultilevelRasterPainter
,TLcdNoWarpMultilevelRasterPainter
,TLcdNoWarpRasterPainter
,TLcdRasterPainter
,TLcdWarpMultilevelRasterPainter
,TLcdWarpRasterPainter
ILcdRasterPainter
interface.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
protected static final int
protected static final int
protected float
protected ColorModel
protected float
protected boolean
protected boolean
protected int
protected boolean
protected RGBImageFilter
protected double
protected double
protected float
Fields inherited from class com.luciad.view.gxy.ALcdGXYPainter
defaultCreationFillStyle, defaultCreationLineStyle, defaultFillStyle, defaultLineStyle, fWorkBounds
Fields inherited from interface com.luciad.view.gxy.ILcdGXYPainter
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
MakesObject.clone()
public.int
densityCheck
(ILcdRaster aRaster, ILcdGXYContext aGXYContext) Determines if the raster density of the given raster is suitable for processing or analysis in the given context, considering the start resolution factor and the stop resolution factor, and the forced painting flag.int
densityCheck
(ILcdRaster aRaster, ILcdGXYContext aGXYContext, Graphics aGraphics) Determines if the pixel density of the given raster is suitable for display, in the given context, considering the start resolution factor and the stop resolution factor, and the forced painting flag.float
float
int
int
Returns the style that is used to draw the outline of the area of raster and/or tiles.Returns the optional filter that is applied to painted rasters.Returns the icon that is used to paint snap target points of the object set to this painter.double
double
Returns the start scale.double
double
Returns the stop scale.float
final double
idealPixelDensity
(ILcdMultilevelRaster aRaster, ILcdGXYContext aGXYContext, Graphics aGraphics) Computes the ideal pixel density that a raster should have for display in the given context.final double
idealPixelDensity
(ILcdRaster aRaster, ILcdGXYContext aGXYContext, Graphics aGraphics) Computes the ideal pixel density that a raster should have for display in the given context.final double
idealPixelDensity
(ILcdBounds aModelBounds, ILcdGXYContext aGXYContext, Graphics aGraphics) Computes the ideal pixel density that a raster should have for display in the given context.boolean
boolean
boolean
boolean
isTouched
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Checks if the representation of the object in the given mode is touched at the location as defined in the supplied context.void
paint
(Graphics aGraphics, int aRenderMode, ILcdGXYContext aGXYContext) Displays the representation of the object in the given mode on the Graphics passed, taking into account the supplied context.double
resolutionFactor
(ILcdRaster aRaster, ILcdGXYContext aGXYContext, Graphics aGraphics) Computes the ratio between the given raster's pixel density and the ideal display density for the given context.void
setBrightness
(float aBrightness) Sets the brightness that is applied to painted rasters.void
setColorModel
(ColorModel aColorModel) Sets the ColorModel that determines how a raster pixel is transformed into color components for a screen pixel.void
setContrast
(float aContrast) Sets the contrast that is applied to painted rasters.void
setFillOutlineArea
(boolean aFillOutlineArea) Specifies whether the raster outlines and tile outlines should be filled when the pixel density (number of raster pixels per screen pixel) of the raster to be painted is higher than the startResolutionFactor.void
setForcePainting
(boolean aForcePainting) Specifies whether the visible portion of the raster should always be painted, irrespective of the startResolutionFactor and stopResolutionFactor.void
setMaxNoOfOutlineTiles
(int aMaxNumberOfOutlineTiles) void
setMaxNumberOfOutlineTiles
(int aMaxNumberOfOutlineTiles) Sets the maximum number of outlines of individual tiles to paint when the pixel density (number of raster pixels per screen pixel) of the raster to be painted is higher than the startResolutionFactor.void
setOutlineAreaFillStyle
(ILcdGXYPainterStyle aFillStyle) Sets the style that is used when filling the outline area of raster and/or tiles.void
setOutlineColor
(Color aColor) Sets the line color used to paint the raster outlines and tile outlines when the pixel density (number of raster pixels per screen pixel) of the raster to be painted is higher than the startResolutionFactor.void
setOutlineStyle
(ILcdGXYPainterStyle aOutlineStyle) Sets the style that is used when drawing the outline of the area of raster and/or tiles.void
setPaintOutline
(boolean aPaintOutline) Specifies whether the raster outlines and tile outlines should be painted when the pixel density (number of raster pixels per screen pixel) of the raster to be painted is higher than the startResolutionFactor.void
setRGBImageFilter
(RGBImageFilter aRGBImageFilter) Sets the optional filter that is applied to painted rasters.void
setSnapIcon
(ILcdIcon aSnapIcon) Sets the icon that marks snap targets of the object currently set to this painter.void
setStartResolutionFactor
(double aFactor) Sets the highest pixel density (number of raster pixels per screen pixel) at which a raster is painted.void
setStartScale
(double aStartScale) As an alternative for the start resolution factor and stop resolution factor, this method andgetStopScale()
can be used for more intuitive control on when to paint a raster and when to paint the outline.void
setStopResolutionFactor
(double aFactor) Sets the lowest pixel density (number of raster pixels per screen pixel) at which a raster is painted.void
setStopScale
(double aStopScale) As an alternative for the start resolution factor and stop resolution factor, this method andgetStartScale()
can be used for more intuitive control on when to paint a raster.void
setTransparency
(float aTransparency) Sets the transparency factor that is applied to painted rasters.snapTarget
(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns one of the bounds points of theILcdRaster
object if it is touched.boolean
supportSnap
(Graphics aGraphics, ILcdGXYContext aGXYContext) Override this method to support snapping.Methods inherited from class com.luciad.view.gxy.ALcdGXYPainter
addPropertyChangeListener, anchorPointSFCT, firePropertyChangeEvent, firePropertyChangeEvent, getCursor, getDisplayName, getGXYPainter, isTraceOn, removePropertyChangeListener, setClassTraceOn, setDisplayName, setTraceOn
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYPainter
anchorPointSFCT, boundsSFCT, getCursor, getDisplayName, getObject, setObject
Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Field Details
-
DENSITY_TOO_HIGH
protected static final int DENSITY_TOO_HIGH- See Also:
-
DENSITY_OK
protected static final int DENSITY_OK- See Also:
-
DENSITY_TOO_LOW
protected static final int DENSITY_TOO_LOW- See Also:
-
fStartResolutionFactor
protected double fStartResolutionFactor -
fStopResolutionFactor
protected double fStopResolutionFactor -
fForcePainting
protected boolean fForcePainting -
fMaxNumberOfOutlineTiles
protected int fMaxNumberOfOutlineTiles -
fPaintOutline
protected boolean fPaintOutline -
fFillOutlineArea
protected boolean fFillOutlineArea -
fColorModel
-
fRGBImageFilter
-
fTransparency
protected float fTransparency -
fBrightness
protected float fBrightness -
fContrast
protected float fContrast
-
-
Constructor Details
-
ALcdRasterPainter
public ALcdRasterPainter()
-
-
Method Details
-
setSnapIcon
Sets the icon that marks snap targets of the object currently set to this painter. This icon is painted when thepaint
method is called with the render modeILcdGXYPainter.SNAPS
.- Parameters:
aSnapIcon
- The icon that should be used to paint snap target points.- See Also:
-
getSnapIcon
Returns the icon that is used to paint snap target points of the object set to this painter.- Returns:
- the icon that is used to paint snap target points of the object set to this painter.
- See Also:
-
paint
Description copied from interface:ILcdGXYPainter
Displays the representation of the object in the given mode on the Graphics passed, taking into account the supplied context.The visual representation of an object depends on the context. Depending on the context (e.g. is the location covered by the view), an object may or may not have a representation. The context contains:
- transformations which allow to compute the location in view space of points and bounds given in model, space
- a pen which can connect points with a line or create arcs around a point,
- the view for which the object's representation must be painted. This can be useful when the painted object depends on the scale of the view, or the presence of other layers in the view.
- the current location(s) of the mouse or input device and the last location(s) the mouse or input device was pressed.
The mode passed in this method indicates what part of the object must be painted, whether it should be painted as selected or not, and whether user interaction (via mouse movements) must be taken into account.
When the mode passed contains either TRANSLATING, RESHAPING or CREATING, this method is also responsible for interpreting interaction on the representation of an object and modifying the representation of the object accordingly. The painter is not responsible for modifying the object itself, this is done by a corresponding
ILcdGXYEditor
. Implementations ofILcdGXYPainter
andILcdGXYEditor
interfaces must be consistent for an object: the painter must display the result of the user interaction on the object, while the editor is responsible for modifying the object as a result of the user interaction. A good practice to ensure a consistent implementation is to implement both theILcdGXYPainter
andILcdGXYEditor
interfaces in a single class.When the mode passed includes SNAPS, the part of the representation which corresponds to the object returned as snap target by the method
snapTarget
must be painted in order to provide the user with a visual indication of the snap target.The Graphics passed in this method can be different from the Graphics returned by a view due to techniques such as double buffering (as applied in Swing). Basic drawing operations must always be performed on the Graphics passed as an argument in this method.
- Specified by:
paint
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaRenderMode
- the mode the object is represented in (see class documentation).aGXYContext
- theILcdGXYContext
the drawing depends on.
-
isTouched
Description copied from interface:ILcdGXYPainter
Checks if the representation of the object in the given mode is touched at the location as defined in the supplied context.The location that must be taken into account to check whether the representation is touched can be retrieved from the context passed with the methods
ILcdGXYContext.getX()
andILcdGXYContext.getY()
. If the check is part of an ongoing operation of user interaction, for example, when the mouse is being dragged, the location of the start of the operation can also be taken into account using the methodsILcdGXYContext.getDeltaX()
andILcdGXYContext.getDeltaY()
. The context contains the transformations required to convert this location into the equivalent location in model space. Implementations of this interface usually follow either of the following patterns:- transform the location of the interaction back to model space and compare the coordinates with the object in model space.
- transform the location to world space and compare with a world representation of the object. This forces the painter into caching a world representation of the object. Caching a view representation of an object is not very practical as it would have to change whenever the view's scale changes or when it is panned. A world representation of an object only changes when the view's XYWorldReference changes, which happens less frequently.
As the mode influences the way an object is represented, it must also be taken into account when checking whether that representation is being touched. When the mode contains CREATING, RESHAPING or TRANSLATING which indicate that the object must be represented in a state for an ongoing operation, the location of the start of the operation may be taken into account as mentioned above. The painting result can take into account multiple locations, to respond to, for example, multi-touch input. When the mode contains SELECTED, the painter should also check if the non-selected representation is touched, since these are always painted on top of each other.
The
boundsSFCT
is often used to speed up the performance of this method as a location outside these bounds can never touch the representation of the object.Note that this method does not give an indication of what part of the object is touched. It is up to the painter implementations to provide methods to make this distinction. The method does also not indicate what sensitivity must be applied when checking if an object is touched. It is up to the implementation to decide what should be the maximum distance between the location given in the context and the closest relevant point or area of the representation of the object.
- Specified by:
isTouched
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaMode
- the mode the object is represented inaGXYContext
- contains the location of the interaction and the transformations to convert this location into model coordinates- Returns:
- true if the representation of the object in the given mode is touched by the location as defined in the context passed, false otherwise
- See Also:
-
supportSnap
Description copied from class:ALcdGXYPainter
Override this method to support snapping. This implementation does not support snapping.- Specified by:
supportSnap
in interfaceILcdGXYPainter
- Overrides:
supportSnap
in classALcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaGXYContext
- the context in which this object is represented and in which the editing of an object occurs.- Returns:
false
.
-
snapTarget
Returns one of the bounds points of the
ILcdRaster
object if it is touched. If no point was touched,null
will be returned.- Specified by:
snapTarget
in interfaceILcdGXYPainter
- Overrides:
snapTarget
in classALcdGXYPainter
- Parameters:
aGraphics
- the graphics on which is worked.aGXYContext
- the context of the snapping.- Returns:
- one of the bounds points of the
ILcdRaster
object if it is touched,null
otherwise. - See Also:
-
setStartResolutionFactor
public void setStartResolutionFactor(double aFactor) Description copied from interface:ILcdRasterPainter
Sets the highest pixel density (number of raster pixels per screen pixel) at which a raster is painted. If the pixel density is too high, only the raster outlines and tile outlines are painted (or a lower resolution level is chosen). This can avoid having to load a large raster to fill a relatively small view.- Specified by:
setStartResolutionFactor
in interfaceILcdRasterPainter
-
getStartResolutionFactor
public double getStartResolutionFactor()- Specified by:
getStartResolutionFactor
in interfaceILcdRasterPainter
- See Also:
-
setStopResolutionFactor
public void setStopResolutionFactor(double aFactor) Description copied from interface:ILcdRasterPainter
Sets the lowest pixel density (number of raster pixels per screen pixel) at which a raster is painted. If the pixel density is too low, nothing is painted. This can avoid painting overly pixelated rasters.- Specified by:
setStopResolutionFactor
in interfaceILcdRasterPainter
-
getStopResolutionFactor
public double getStopResolutionFactor()- Specified by:
getStopResolutionFactor
in interfaceILcdRasterPainter
- See Also:
-
getStartScale
public double getStartScale()Returns the start scale.- Returns:
- the start scale currently used to determine whether or not rasters or outlines should be painted at a certain view scale.
- See Also:
-
setStartScale
public void setStartScale(double aStartScale) As an alternative for the start resolution factor and stop resolution factor, this method andgetStopScale()
can be used for more intuitive control on when to paint a raster and when to paint the outline. When the internal scale of the view (ILcdGXYView.getScale()
is smaller than the start scale, the outline will be painted in stead of the raster. The default value is 0. Warning: when the view scale is in between the start and stop scale, the start resolution factor and the stop resolution factor are still used as a second check. If you don't want interference from these two settings, set the start resolution factor to Double.POSITIVE_INFINITY and the stop resolution factor to 0.- Parameters:
aStartScale
- The view scale at which one starts painting the raster rather that the outline (when zooming in).- See Also:
-
getStopScale
public double getStopScale()Returns the stop scale.- Returns:
- the stop scale currently used to determine whether or not rasters should be painted at a certain view scale.
- See Also:
-
setStopScale
public void setStopScale(double aStopScale) As an alternative for the start resolution factor and stop resolution factor, this method andgetStartScale()
can be used for more intuitive control on when to paint a raster. When the internal scale of the view (ILcdGXYView.getScale()
is larger than the stop scale, the raster won't be painted. The default value is Double.POSITIVE_INFINITY.- Parameters:
aStopScale
- The view scale at which one stops painting the raster (when zooming in).- See Also:
-
setForcePainting
public void setForcePainting(boolean aForcePainting) Description copied from interface:ILcdRasterPainter
Specifies whether the visible portion of the raster should always be painted, irrespective of the startResolutionFactor and stopResolutionFactor.- Specified by:
setForcePainting
in interfaceILcdRasterPainter
- See Also:
-
isForcePainting
public boolean isForcePainting()- Specified by:
isForcePainting
in interfaceILcdRasterPainter
- See Also:
-
setPaintOutline
public void setPaintOutline(boolean aPaintOutline) Description copied from interface:ILcdRasterPainter
Specifies whether the raster outlines and tile outlines should be painted when the pixel density (number of raster pixels per screen pixel) of the raster to be painted is higher than the startResolutionFactor.- Specified by:
setPaintOutline
in interfaceILcdRasterPainter
- See Also:
-
isPaintOutline
public boolean isPaintOutline()- Specified by:
isPaintOutline
in interfaceILcdRasterPainter
- See Also:
-
setOutlineStyle
Sets the style that is used when drawing the outline of the area of raster and/or tiles. If set to anon-null
value the configure style will take precedence over the configured outline color if the style modifies the Graphics current color.- Parameters:
aOutlineStyle
- the outline style to use- See Also:
-
getOutlineStyle
Returns the style that is used to draw the outline of the area of raster and/or tiles.- Returns:
- a painter style or
null
-
setOutlineColor
Description copied from interface:ILcdRasterPainter
Sets the line color used to paint the raster outlines and tile outlines when the pixel density (number of raster pixels per screen pixel) of the raster to be painted is higher than the startResolutionFactor.- Specified by:
setOutlineColor
in interfaceILcdRasterPainter
- See Also:
-
getOutlineColor
- Specified by:
getOutlineColor
in interfaceILcdRasterPainter
- See Also:
-
isFillOutlineArea
public boolean isFillOutlineArea()- See Also:
-
setFillOutlineArea
public void setFillOutlineArea(boolean aFillOutlineArea) Specifies whether the raster outlines and tile outlines should be filled when the pixel density (number of raster pixels per screen pixel) of the raster to be painted is higher than the startResolutionFactor.- See Also:
-
getOutlineAreaFillStyle
- See Also:
-
setOutlineAreaFillStyle
Sets the style that is used when filling the outline area of raster and/or tiles. If the fill style is set tonull
andfill outline area
is enabled the result visual result on screen is undefined.- Parameters:
aFillStyle
- the fill style to use- See Also:
-
setMaxNumberOfOutlineTiles
public void setMaxNumberOfOutlineTiles(int aMaxNumberOfOutlineTiles) Description copied from interface:ILcdRasterPainter
Sets the maximum number of outlines of individual tiles to paint when the pixel density (number of raster pixels per screen pixel) of the raster to be painted is higher than the startResolutionFactor. If the number of tiles is larger than this maximum, only the global outline of the raster is painted.- Specified by:
setMaxNumberOfOutlineTiles
in interfaceILcdRasterPainter
- See Also:
-
getMaxNumberOfOutlineTiles
public int getMaxNumberOfOutlineTiles()- Specified by:
getMaxNumberOfOutlineTiles
in interfaceILcdRasterPainter
- See Also:
-
setMaxNoOfOutlineTiles
public void setMaxNoOfOutlineTiles(int aMaxNumberOfOutlineTiles) - Specified by:
setMaxNoOfOutlineTiles
in interfaceILcdRasterPainter
-
getMaxNoOfOutlineTiles
public int getMaxNoOfOutlineTiles()- Specified by:
getMaxNoOfOutlineTiles
in interfaceILcdRasterPainter
-
setColorModel
Description copied from interface:ILcdRasterPainter
Sets the ColorModel that determines how a raster pixel is transformed into color components for a screen pixel. If it is not set, the raster itself determines the ColorModel. If that is not set either, the contained raster tiles determine the ColorModel.- Specified by:
setColorModel
in interfaceILcdRasterPainter
-
getColorModel
- Specified by:
getColorModel
in interfaceILcdRasterPainter
- See Also:
-
setRGBImageFilter
Sets the optional filter that is applied to painted rasters. The filter should be spatially invariant. Any brightness and transparency settings are applied on top of it. -
getRGBImageFilter
Returns the optional filter that is applied to painted rasters. -
setTransparency
public void setTransparency(float aTransparency) Description copied from interface:ILcdRasterPainter
Sets the transparency factor that is applied to painted rasters. It is an alpha value between 0 and 1, with 0 being perfectly transparent, and 1 (the default) being perfectly opaque.- Specified by:
setTransparency
in interfaceILcdRasterPainter
-
getTransparency
public float getTransparency()- Specified by:
getTransparency
in interfaceILcdRasterPainter
- See Also:
-
setBrightness
public void setBrightness(float aBrightness) Description copied from interface:ILcdRasterPainter
Sets the brightness that is applied to painted rasters. It is a value in[0, 2]
. A value of 1 (the default) leaves the brightness unchanged. Values larger than 1 makes the colors brighter, while a value smaller than 1 makes the colors less bright.- Specified by:
setBrightness
in interfaceILcdRasterPainter
- See Also:
-
getBrightness
public float getBrightness()- Specified by:
getBrightness
in interfaceILcdRasterPainter
- See Also:
-
setContrast
public void setContrast(float aContrast) Sets the contrast that is applied to painted rasters. It is a value in[0, 2]
. A value of 1 (the default) leaves the contrast unchanged. A value larger than 1 enhances the contrast of dark colors by making them brighter, while a value smaller than 1 enhances the contrast of bright colors by making them darker. -
getContrast
public float getContrast() -
densityCheck
Determines if the raster density of the given raster is suitable for processing or analysis in the given context, considering the start resolution factor and the stop resolution factor, and the forced painting flag.The raster density may be considered too high, meaning that too many raster pixels are mapped onto a single view pixel. This would typically make lazy loading the raster data disproportionally slow.
Conversely, the raster density may be considered too low, meaning that a single raster pixel is mapped onto too many view pixels. This would typically make the raster data insufficiently accurate to work with.
- Parameters:
aRaster
- the raster to be processed or analyzed.aGXYContext
- the context that contains the model of the raster, the model-to-world transformation, and the view-to-world transformation.- Returns:
DENSITY_TOO_HIGH
,DENSITY_OK
, orDENSITY_TOO_LOW
.- See Also:
-
densityCheck
Determines if the pixel density of the given raster is suitable for display, in the given context, considering the start resolution factor and the stop resolution factor, and the forced painting flag.The raster's pixel density may be considered too high, meaning that too many raster pixels are mapped onto a single view pixel. This would typically make lazy loading the raster data disproportionally slow.
Conversely, the raster's pixel density may be considered too low, meaning that a single raster pixel is mapped onto too many view pixels. This would typically make the raster data insufficiently accurate to display.
- Parameters:
aRaster
- the raster to be displayed.aGXYContext
- the context that contains the model of the raster, the model-to-world transformation, and the view-to-world transformation.aGraphics
- the Graphics instance on which the raster is to be painted.- Returns:
DENSITY_TOO_HIGH
,DENSITY_OK
, orDENSITY_TOO_LOW
.- See Also:
-
resolutionFactor
public double resolutionFactor(ILcdRaster aRaster, ILcdGXYContext aGXYContext, Graphics aGraphics) throws TLcdNoBoundsException Computes the ratio between the given raster's pixel density and the ideal display density for the given context.- Parameters:
aRaster
- the raster to be displayed.aGXYContext
- the context that contains the model of the raster, the model-to-world transformation, and the view-to-world transformation.aGraphics
- the Graphics instance on which the raster is to be painted.- Returns:
- the resolution factor.
- Throws:
TLcdNoBoundsException
- See Also:
-
idealPixelDensity
public final double idealPixelDensity(ILcdBounds aModelBounds, ILcdGXYContext aGXYContext, Graphics aGraphics) throws TLcdNoBoundsException Computes the ideal pixel density that a raster should have for display in the given context. The ideal density is a number of pixels per unit of area, expressed in model coordinates, such that one model pixel maps onto one view pixel, on average. This ideal density can serve as a reference for an actual raster with a pixel density that may or may not be ideal.- Parameters:
aModelBounds
- the area of the raster to be displayed, expressed in model coordinates.aGXYContext
- the context that contains the model of the raster, the model-to-world transformation, and the view-to-world transformation.aGraphics
- the Graphics instance on which the raster is to be painted.- Returns:
- the ideal pixel density.
- Throws:
TLcdNoBoundsException
-
idealPixelDensity
public final double idealPixelDensity(ILcdRaster aRaster, ILcdGXYContext aGXYContext, Graphics aGraphics) throws TLcdNoBoundsException Computes the ideal pixel density that a raster should have for display in the given context. The ideal density is a number of pixels per unit of area, expressed in model coordinates, such that one model pixel maps onto one view pixel, on average. This ideal density can serve as a reference for an actual raster with a pixel density that may or may not be ideal.- Parameters:
aRaster
- the raster to be displayedaGXYContext
- the context that contains the model of the raster, the model-to-world transformation, and the view-to-world transformation.aGraphics
- the Graphics instance on which the raster is to be painted.- Returns:
- the ideal pixel density.
- Throws:
TLcdNoBoundsException
-
idealPixelDensity
public final double idealPixelDensity(ILcdMultilevelRaster aRaster, ILcdGXYContext aGXYContext, Graphics aGraphics) throws TLcdNoBoundsException Computes the ideal pixel density that a raster should have for display in the given context. The ideal density is a number of pixels per unit of area, expressed in model coordinates, such that one model pixel maps onto one view pixel, on average. This ideal density can serve as a reference for an actual raster with a pixel density that may or may not be ideal.- Parameters:
aRaster
- the raster to be displayedaGXYContext
- the context that contains the model of the raster, the model-to-world transformation, and the view-to-world transformation.aGraphics
- the Graphics instance on which the raster is to be painted.- Returns:
- the ideal pixel density.
- Throws:
TLcdNoBoundsException
-
clone
Description copied from interface:ILcdCloneable
Makes
When for example extending fromObject.clone()
public.java.lang.Object
, it can be implemented like this:public Object clone() { try { return super.clone(); } catch ( CloneNotSupportedException e ) { // Cannot happen: extends from Object and implements Cloneable (see also Object.clone) throw new RuntimeException( e ); } }
- Specified by:
clone
in interfaceILcdCloneable
- Specified by:
clone
in interfaceILcdGXYPainterProvider
- Overrides:
clone
in classALcdGXYPainter
- Returns:
- a clone of this painter provider.
- See Also:
-