Package com.bc.ceres.glayer.support
Class ImageLayer
- java.lang.Object
-
- com.bc.ceres.core.ExtensibleObject
-
- com.bc.ceres.glayer.Layer
-
- com.bc.ceres.glayer.support.ImageLayer
-
- All Implemented Interfaces:
Extensible
public class ImageLayer extends Layer
A multi-resolution capable image layer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImageLayer.Type
-
Field Summary
Fields Modifier and Type Field Description static Color
DEFAULT_BORDER_COLOR
static boolean
DEFAULT_BORDER_SHOWN
static double
DEFAULT_BORDER_WIDTH
static Color
DEFAULT_PIXEL_BORDER_COLOR
static Boolean
DEFAULT_PIXEL_BORDER_SHOWN
static double
DEFAULT_PIXEL_BORDER_WIDTH
static String
PROPERTY_NAME_BORDER_COLOR
static String
PROPERTY_NAME_BORDER_SHOWN
static String
PROPERTY_NAME_BORDER_WIDTH
static String
PROPERTY_NAME_MULTI_LEVEL_SOURCE
static String
PROPERTY_NAME_PIXEL_BORDER_COLOR
static String
PROPERTY_NAME_PIXEL_BORDER_SHOWN
static String
PROPERTY_NAME_PIXEL_BORDER_WIDTH
-
Constructor Summary
Constructors Constructor Description ImageLayer(ImageLayer.Type layerType, MultiLevelSource multiLevelSource, PropertySet configuration)
ImageLayer(MultiLevelSource multiLevelSource)
Constructs a multi-resolution-level image layer.ImageLayer(RenderedImage image)
Constructs a single-resolution-level image layer.ImageLayer(RenderedImage image, AffineTransform imageToModelTransform, int levelCount)
Constructs a multi-resolution-level image layer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
disposeLayer()
Disposes the layer.Color
getBorderColor()
double
getBorderWidth()
RenderedImage
getImage()
RenderedImage
getImage(int level)
AffineTransform
getImageToModelTransform()
AffineTransform
getImageToModelTransform(int level)
protected Rectangle2D
getLayerModelBounds()
Gets the bounds (bounding box) of this layer in model coordinates.static int
getLevel(MultiLevelModel model, Viewport vp)
int
getLevel(Viewport vp)
AffineTransform
getModelToImageTransform()
AffineTransform
getModelToImageTransform(int level)
MultiLevelSource
getMultiLevelSource()
Color
getPixelBorderColor()
double
getPixelBorderWidth()
boolean
isBorderShown()
boolean
isPixelBorderShown()
void
regenerate()
Regenerates the layer.protected void
renderLayer(Rendering rendering)
Renders the layer.void
setMultiLevelSource(MultiLevelSource multiLevelSource)
-
Methods inherited from class com.bc.ceres.glayer.Layer
addListener, dispose, disposeChildren, fireLayerDataChanged, fireLayerPropertyChanged, fireLayerPropertyChanged, fireLayersAdded, fireLayersRemoved, getChildIndex, getChildren, getChildrenModelBounds, getComposite, getConfiguration, getConfigurationProperty, getId, getLayerType, getListeners, getModelBounds, getName, getParent, getSwipePercent, getTransparency, isCollectionLayer, isVisible, removeListener, render, render, renderChildren, setComposite, setId, setName, setSwipePercent, setTransparency, setVisible, toString
-
Methods inherited from class com.bc.ceres.core.ExtensibleObject
getExtension
-
-
-
-
Field Detail
-
PROPERTY_NAME_MULTI_LEVEL_SOURCE
public static final String PROPERTY_NAME_MULTI_LEVEL_SOURCE
- See Also:
- Constant Field Values
-
PROPERTY_NAME_BORDER_SHOWN
public static final String PROPERTY_NAME_BORDER_SHOWN
- See Also:
- Constant Field Values
-
PROPERTY_NAME_BORDER_WIDTH
public static final String PROPERTY_NAME_BORDER_WIDTH
- See Also:
- Constant Field Values
-
PROPERTY_NAME_BORDER_COLOR
public static final String PROPERTY_NAME_BORDER_COLOR
- See Also:
- Constant Field Values
-
PROPERTY_NAME_PIXEL_BORDER_SHOWN
public static final String PROPERTY_NAME_PIXEL_BORDER_SHOWN
- See Also:
- Constant Field Values
-
PROPERTY_NAME_PIXEL_BORDER_WIDTH
public static final String PROPERTY_NAME_PIXEL_BORDER_WIDTH
- See Also:
- Constant Field Values
-
PROPERTY_NAME_PIXEL_BORDER_COLOR
public static final String PROPERTY_NAME_PIXEL_BORDER_COLOR
- See Also:
- Constant Field Values
-
DEFAULT_BORDER_SHOWN
public static final boolean DEFAULT_BORDER_SHOWN
- See Also:
- Constant Field Values
-
DEFAULT_BORDER_COLOR
public static final Color DEFAULT_BORDER_COLOR
-
DEFAULT_BORDER_WIDTH
public static final double DEFAULT_BORDER_WIDTH
- See Also:
- Constant Field Values
-
DEFAULT_PIXEL_BORDER_SHOWN
public static final Boolean DEFAULT_PIXEL_BORDER_SHOWN
-
DEFAULT_PIXEL_BORDER_COLOR
public static final Color DEFAULT_PIXEL_BORDER_COLOR
-
DEFAULT_PIXEL_BORDER_WIDTH
public static final double DEFAULT_PIXEL_BORDER_WIDTH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ImageLayer
public ImageLayer(RenderedImage image)
Constructs a single-resolution-level image layer.- Parameters:
image
- the image
-
ImageLayer
public ImageLayer(RenderedImage image, AffineTransform imageToModelTransform, int levelCount)
Constructs a multi-resolution-level image layer.- Parameters:
image
- the imageimageToModelTransform
- the transformation from image to model CSlevelCount
- the number of resolution levels
-
ImageLayer
public ImageLayer(MultiLevelSource multiLevelSource)
Constructs a multi-resolution-level image layer.- Parameters:
multiLevelSource
- the multi-resolution-level image
-
ImageLayer
public ImageLayer(ImageLayer.Type layerType, MultiLevelSource multiLevelSource, PropertySet configuration)
-
-
Method Detail
-
regenerate
public void regenerate()
Description copied from class:Layer
Regenerates the layer. May be called to update the layer data. The default implementation does nothing.- Overrides:
regenerate
in classLayer
-
getImage
public RenderedImage getImage()
-
getMultiLevelSource
public MultiLevelSource getMultiLevelSource()
-
setMultiLevelSource
public void setMultiLevelSource(MultiLevelSource multiLevelSource)
-
getImageToModelTransform
public AffineTransform getImageToModelTransform()
-
getModelToImageTransform
public AffineTransform getModelToImageTransform()
-
getImage
public RenderedImage getImage(int level)
-
getImageToModelTransform
public AffineTransform getImageToModelTransform(int level)
-
getModelToImageTransform
public AffineTransform getModelToImageTransform(int level)
-
getLevel
public int getLevel(Viewport vp)
-
getLevel
public static int getLevel(MultiLevelModel model, Viewport vp)
-
getLayerModelBounds
protected Rectangle2D getLayerModelBounds()
Description copied from class:Layer
Gets the bounds (bounding box) of this layer in model coordinates. Called byLayer.getModelBounds()
. The default implementation returnsnull
.- Overrides:
getLayerModelBounds
in classLayer
- Returns:
- The bounds of the layer in model coordinates or
null
if this layer has no specified boundary.
-
renderLayer
protected void renderLayer(Rendering rendering)
Description copied from class:Layer
Renders the layer. Called byLayer.render(com.bc.ceres.grender.Rendering)
. The default implementation does nothing.- Overrides:
renderLayer
in classLayer
- Parameters:
rendering
- The rendering to which the layer will be rendered.
-
disposeLayer
protected void disposeLayer()
Description copied from class:Layer
Disposes the layer. Called byLayer.dispose()
. The default implementation does nothing.- Overrides:
disposeLayer
in classLayer
-
isBorderShown
public boolean isBorderShown()
-
getBorderWidth
public double getBorderWidth()
-
getBorderColor
public Color getBorderColor()
-
isPixelBorderShown
public boolean isPixelBorderShown()
-
getPixelBorderWidth
public double getPixelBorderWidth()
-
getPixelBorderColor
public Color getPixelBorderColor()
-
-