public class TLcdGXYViewPlanarImage extends javax.media.jai.PlanarImage implements ILcdGXYView, ILcdModelProducerListener, ILcdGXYViewXYWorldTransformationProvider, ILcdRotationCapableGXYView, ILcdTreeLayered, ILcdStatusSource
TLcdGXYViewBufferedImage
. It additionally
supports internal tiling of the view, with the tiles being computed on the
fly. It is therefore more suitable for large views.
Note: if the view is tiled, painters and label painters that depend on the view bounds may introduce visual artifacts at the tile bounds. For instance, the current implementation may perform label decluttering per tile instead of for the entire view.
All code that might affect or depend on the state of the view should be executed in a single thread. This includes all methods that can cause the view to repaint implicitly or explicitly.
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width
CENTER, LOWERLEFT, LOWERRIGHT, UPPERLEFT, UPPERRIGHT
Constructor and Description |
---|
TLcdGXYViewPlanarImage(int aWidth,
int aHeight,
int aTileWidth,
int aTileHeight,
int aBufferedImageType)
Constructs a new TLcdGXYViewPlanarImage of the given size and type.
|
TLcdGXYViewPlanarImage(int aWidth,
int aHeight,
int aTileWidth,
int aTileHeight,
int aBufferedImageType,
ILcdTreeLayeredSupport aTreeLayeredSupport)
Constructs a new TLcdGXYViewPlanarImage of the given size and type.
|
TLcdGXYViewPlanarImage(int aWidth,
int aHeight,
int aTileWidth,
int aTileHeight,
int aBufferedImageType,
IndexColorModel aIndexColorModel)
Constructs a new TLcdGXYViewPlanarImage of the given size and with the
given IndexColorModel.
|
TLcdGXYViewPlanarImage(int aWidth,
int aHeight,
int aTileWidth,
int aTileHeight,
int aBufferedImageType,
IndexColorModel aIndexColorModel,
ILcdTreeLayeredSupport aTreeLayeredSupport)
Constructs a new TLcdGXYViewPlanarImage of the given size and with the
given IndexColorModel.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addGXYLayer(ILcdGXYLayer aLayer)
Adds the given
ILcdGXYLayer to this ILcdGXYView . |
boolean |
addGXYLayer(ILcdGXYLayer aLayer,
boolean aRepaint)
Adds the given
ILcdGXYLayer to this ILcdGXYView , forcing a repaint if
desired. |
void |
addLayeredListener(ILcdLayeredListener aLayeredListener)
Registers the given
ILcdLayeredListener to be notified when layers are added,
removed or moved in the flat list. |
void |
addLayerSelectionListener(ILcdSelectionListener aSelectionListener)
Registers the given
ILcdSelectionListener to be informed of selection change events
from any layer in this view. |
void |
addModel(ILcdModel aModel)
Adds
aModel to be displayed in this ILcdView . |
void |
addModelListener(ILcdModelListener aModelListener)
Registers the given
ILcdModelListener to be informed of ILcdModel change events
from any layer's model in this view. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Registers the given
PropertyChangeListener to be notified when this object's
properties change. |
void |
addStatusListener(ILcdStatusListener aStatusListener)
Registers the given
ILcdStatusListener to be notified of view status events. |
boolean |
containsLayer(ILcdLayer aLayer)
Returns whether the flat list representation of the hierarchical layer structure contains
the given layer.
|
Color |
getBackground()
Returns the background color of the view.
|
ILcdIcon |
getCornerIcon(int aPosition)
Returns the
ILcdIcon to be painted at the given corner of the view. |
ILcdGXYPen |
getDefaultPen()
Returns an
ILcdGXYPen supporting editing and painting on the view. |
Color |
getForeground()
Deprecated.
This property is not used.
|
Graphics |
getGraphics()
Returns a graphics context for this view.
|
ILcdGXYController |
getGXYController()
Returns the
ILcdGXYController handling the user interaction of the view. |
ILcdGXYLayerFactory |
getGXYLayerFactory()
Returns the layer factory used when adding models to the view.
|
ILcdGXYViewLabelPainter |
getGXYViewLabelPainter()
Returns the label painting algorithm for this view.
|
ILcdGXYViewLabelPlacer |
getGXYViewLabelPlacer()
Returns the label placer for this view.
|
ILcdGXYViewXYWorldTransformation |
getGXYViewXYWorldTransformation()
Returns a valid
ILcdGXYViewXYWorldTransformation for an ILcdGXYView . |
Image |
getImage()
Returns an
Image of this view. |
ILcdLayer |
getLayer(int aIndex)
Returns the
ILcdLayer with index aIndex in the flat list
representation of the hierarchical layer structure. |
double |
getMaxScale()
Returns the maximum zoomed in scale of the view.
|
double |
getMinScale()
Returns the maximum zoomed out scale of the view.
|
int |
getNumberOfCachedBackgroundLayers()
Returns the number of layers whose combined representation is cached across repaints.
|
ILcdPaintExceptionHandler |
getPaintExceptionHandler()
Returns a handler to report paint exceptions.
|
int |
getPaintingMode()
Gets the painting mode for this ILcdGXYView.
|
Dimension |
getPreferredSize()
Returns the preferred size of the view.
|
ILcdLayerTreeNode |
getRootNode()
Returns the root node of the tree structure.
|
double |
getRotation()
Returns the rotation of this
ILcdGXYView . |
double |
getScale()
Returns the scale for which to paint the view contents expressed in toolkit pixels per world unit.
|
Raster |
getTile(int aTileX,
int aTileY) |
Point |
getViewOrigin()
Returns the point in AWT pixel coordinates that maps onto the world origin.
|
ILcdPoint |
getWorldOrigin()
Returns the point in world coordinates that maps onto the view origin.
|
ILcdXYWorldReference |
getXYWorldReference()
Returns the view's 2D world coordinate system.
|
boolean |
hasValidImage()
Returns
true if the view has a valid image. |
int |
indexOf(ILcdLayer aLayer)
Returns the index of the given layer
aLayer in the flat list representation of
the hierarchical structure. |
void |
invalidate(boolean aRepaint,
Object aSource,
String aMessage)
Asks the view to invalidate its content,
optionally repainting the content asynchronously.
|
void |
invalidateAndWait(boolean aRepaint,
Object aSource,
String aMessage)
Asks the view to invalidate its content,
optionally repainting the content synchronously.
|
void |
invalidateGXYLayer(ILcdGXYLayer aGXYLayer,
boolean aRepaint,
Object aSource,
String aMessage)
Asks the view to invalidate the content of the given
ILcdGXYLayer ,
optionally repainting the content asynchronously. |
void |
invalidateGXYLayerAndWait(ILcdGXYLayer aGXYLayer,
boolean aRepaint,
Object aSource,
String aMessage)
Asks the view to invalidate the content of the given
ILcdGXYLayer ,
optionally repainting the content synchronously. |
void |
invalidateRegion(Rectangle aClip,
boolean aRepaint,
Object aSource,
String aMessage)
Asks the view to invalidate the content in the given AWT clip,
optionally repainting the content asynchronously.
|
void |
invalidateRegionAndWait(Rectangle aClip,
boolean aRepaint,
Object aSource,
String aMessage)
Asks the view to invalidate the content in the given AWT clip,
optionally repainting the content synchronously.
|
void |
invalidateRegionSelection(Rectangle aClip,
boolean aRepaint,
Object aSource,
String aMessage)
Asks the ILcdGXYView to invalidate its selection in the given AWT clip,
optionally repainting the content asynchronously.
|
void |
invalidateRegionSelectionAndWait(Rectangle aClip,
boolean aRepaint,
Object aSource,
String aMessage)
Asks the ILcdGXYView to invalidate its selection in the given AWT clip,
optionally repainting the content synchronously.
|
void |
invalidateSelection(boolean aRepaint,
Object aSource,
String aMessage)
Asks the ILcdGXYView to invalidate its selection,
optionally repainting the content asynchronously.
|
void |
invalidateSelectionAndWait(boolean aRepaint,
Object aSource,
String aMessage)
Asks the ILcdGXYView to invalidate its selection,
optionally repainting the content synchronously.
|
boolean |
isAntiAliased()
Specifies if anti-aliasing is enabled or not.
|
boolean |
isAsynchronousAllowed()
Returns whether this view allows asynchronous operations.
|
boolean |
isAutoUpdate()
Returns whether the view's contents are automatically updated when necessary.
|
boolean |
isDrawOffScreenImageOnPaint()
Returns whether the entire view's content is displayed, or only the controller's
representation.
|
boolean |
isPaintInBackground()
Returns whether the view is painted in a thread other than the event dispatch thread.
|
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
int |
layerCount()
Returns the number of layers in the flat list representation of the hierarchical layer
structure.
|
ILcdLayer |
layerOf(ILcdModel aModel)
Returns the
ILcdLayer of the flat list that contains the given
ILcdModel . |
Enumeration |
layers()
Returns an
Enumeration of all the ILcdLayer s currently in the flat
list representation of the hierarchical layer structure, starting from the bottom layer to the
top layer. |
Enumeration |
layersBackwards()
Returns an
Enumeration of all the ILcdLayer s currently in the flat
list representation of the hierarchical layer structure, starting from the top layer to the
bottom layer. |
void |
modelProduced(TLcdModelProducerEvent aModelProducerEvent)
The produced model is added to the view, provided that a layer factory supporting
the model is set.
|
void |
moveLayerAt(int aIndex,
ILcdLayer aLayer)
Moves the given layer (which is already in
ILcdLayered ) to the existing index
aIndex. |
void |
paint(Graphics aGraphics) |
void |
paintGXYView(Graphics aGraphics)
Paints the view on the given
Graphics . |
void |
pan(int aDeltaX,
int aDeltaY,
boolean aRepaint)
Changes the view and/or world origin of the view so that the view contents are panned
by the specified AWT delta.
|
void |
print(Graphics aGraphics)
Paints the representation of the
ILcdGXYView on the given Graphics ,
without using any buffers or off-screen images. |
void |
putCornerIcon(ILcdIcon aCornerIcon,
int aPosition)
Sets an
ILcdIcon to be painted at the given corner of this
view. |
void |
removeAllLayers()
Remove all the layers from the hierarchical layer structure and the flat list
representation.
|
void |
removeLayer(ILcdLayer aLayer)
Removes a layer from both the hierarchical layer structure and the flat list representation.
|
void |
removeLayeredListener(ILcdLayeredListener aLayeredListener)
Unregisters the given
ILcdLayeredListener from receiving layered events for the
flat list. |
void |
removeLayerSelectionListener(ILcdSelectionListener aSelectionListener)
Unregisters the given
ILcdSelectionListener from receiving selection change events
from any layer in this view. |
void |
removeModel(ILcdModel aModel)
Removes a single representation of the specified model from this
view, if it is present in the view.
|
void |
removeModelListener(ILcdModelListener aModelListener)
Unregisters the given
ILcdModelListener from receiving ILcdModel change events
from any layer's model in this view. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
De-registers the given
PropertyChangeListener from receiving property change events
for this object. |
void |
removeStatusListener(ILcdStatusListener aStatusListener)
Unregisters the given
ILcdStatusListener from being notified of view status events. |
void |
repaint()
TLcdGXYViewPlanarImage does not implement this method. |
void |
repaint(int aX,
int aY,
int aWidth,
int aHeight)
TLcdGXYViewPlanarImage does not implement this method. |
void |
setAntiAliased(boolean aAntiAliased)
Changes the anti-aliasing behavior.
|
void |
setAsynchronousAllowed(boolean aAsynchronousAllowed)
Sets if asynchronous operation are allowed for this view.
|
void |
setAutoUpdate(boolean aAutoUpdate)
Sets whether to update the view's representation automatically to keep it in sync with its
state and the state of its models.
|
void |
setBackground(Color aColor)
Sets the background color of the view.
|
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setCursor(Cursor aCursor)
Sets the view cursor to the given cursor.
|
void |
setDrawOffScreenImageOnPaint(boolean aDrawOffScreenImageOnPaint)
Sets whether the entire view's content is displayed, or only the current controller's
representation.
|
void |
setForeground(Color aColor)
Deprecated.
This property is not used.
|
void |
setGXYController(ILcdGXYController aGXYViewController)
Do not call this method.
|
void |
setGXYLayerFactory(ILcdGXYLayerFactory newGXYLayerFactory)
Sets the layer factory to use when adding models to the view.
|
void |
setGXYViewLabelPainter(ILcdGXYViewLabelPainter aGXYViewLabelPainter)
Sets the label painter algorithm for this
ILcdGXYView . |
void |
setGXYViewLabelPlacer(ILcdGXYViewLabelPlacer aGXYViewLabelPlacer)
This method sets an
ILcdGXYViewLabelPlacer to use for global labeling. |
void |
setMaxScale(double aMaxScale)
Limits the maximum zoomed in scale of the view.
|
void |
setMinScale(double aMinScale)
Limits the maximum zoomed out scale of the view.
|
void |
setNumberOfCachedBackgroundLayers(int aNumberOfCachedBackgroundLayers)
This operation is not supported, as this view does not cache background layers.
|
void |
setPaintExceptionHandler(ILcdPaintExceptionHandler aPaintExceptionHandler)
Sets a handler to report paint exceptions.
|
void |
setPaintInBackground(boolean aUpdateInBackground)
Painting in the background is not supported by this view implementation.
|
void |
setPaintingMode(int aPaintingMode)
Sets the type or types of layer content to display in the ILcdGXYView.
|
void |
setRotation(double aRotation)
Sets the rotation of this
ILcdGXYView , updating the view according to
ILcdView.isAutoUpdate() . |
void |
setRotation(double aRotation,
boolean aAdjusting)
Sets the rotation of this
ILcdGXYView , optionally indicating subsequent property changes. |
void |
setRotation(double aRotation,
boolean aRepaint,
boolean aAdjusting)
Sets the rotation of this
ILcdGXYView , optionally repainting the view. |
void |
setScale(double aScale)
Sets the scale of this view, repainting the view according to
isAutoUpdate . |
void |
setScale(double aScale,
boolean aRepaint)
Sets the scale of this view, optionally repainting the view.
|
void |
setScale(double aScale,
boolean aRepaint,
boolean aAdjusting)
Sets the scale of this view, optionally indicating subsequent property changes.
|
void |
setScale(double aScaleX,
double aScaleY,
boolean aRepaint,
boolean aAdjusting)
Sets the scale along the x-axis and y-axis of this view, repainting the view
according to
isAutoUpdate . |
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setViewOrigin(Point aViewOrigin)
Sets the view origin of the view, repainting the view according to
isAutoUpdate . |
void |
setViewOrigin(Point aViewOrigin,
boolean aRepaint)
Sets the view origin of the view, optionally repainting the view.
|
void |
setViewOrigin(Point aViewOrigin,
boolean aRepaint,
boolean aAdjusting)
Sets the view origin of the view, optionally indicating subsequent property changes.
|
void |
setWorldOrigin(ILcdPoint aWorldOrigin)
Sets the world origin of the view, repainting the view according to
isAutoUpdate . |
void |
setWorldOrigin(ILcdPoint aWorldOrigin,
boolean aRepaint)
Sets the world origin of the view, optionally repainting the view.
|
void |
setWorldOrigin(ILcdPoint aWorldOrigin,
boolean aRepaint,
boolean aAdjusting)
Sets the world origin of the view, optionally indicating subsequent property changes.
|
void |
setXYWorldReference(ILcdXYWorldReference aXYWorldReference)
Sets the view's 2D world coordinate system, repainting the view according to
isAutoUpdate . |
void |
setXYWorldReference(ILcdXYWorldReference aXYWorldReference,
boolean aRepaint)
Sets the view's 2D world coordinate system, optionally repainting the view.
|
void |
setXYWorldReference(ILcdXYWorldReference aXYWorldReference,
boolean aRepaint,
boolean aAdjusting)
Sets the view's 2D world coordinate system, optionally indicating subsequent property changes.
|
void |
update(Graphics aGraphics)
Calls
paintGXYView( aGraphics ) |
addPropertyChangeListener, addSink, addSink, addSource, addTileComputationListener, cancelTiles, copyData, copyData, copyExtendedData, createColorModel, createSnapshot, createWritableRaster, dispose, finalize, getAsBufferedImage, getAsBufferedImage, getBounds, getColorModel, getData, getData, getDefaultColorModel, getExtendedData, getHeight, getImageID, getMaxTileX, getMaxTileY, getMaxX, getMaxY, getMinTileX, getMinTileY, getMinX, getMinY, getNumBands, getNumSources, getNumXTiles, getNumYTiles, getProperties, getProperty, getPropertyClass, getPropertyNames, getPropertyNames, getSampleModel, getSinks, getSource, getSourceImage, getSourceObject, getSources, getSplits, getTileComputationListeners, getTileFactory, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileIndices, getTileRect, getTiles, getTiles, getTileWidth, getWidth, overlapsMultipleTiles, prefetchTiles, queueTiles, removeProperty, removePropertyChangeListener, removeSink, removeSink, removeSinks, removeSource, removeSources, removeTileComputationListener, setImageLayout, setProperties, setProperty, setSource, setSources, tileXToX, tileXToX, tileYToY, tileYToY, toString, wrapRenderedImage, XToTileX, XToTileX, YToTileY, YToTileY
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addViewInvalidationListener, getHeight, getLayers, getMapScale, getMapScaleRange, getWidth, removeViewInvalidationListener, setMapScale, setMapScaleRange
addLayeredListener, removeLayeredListener
public TLcdGXYViewPlanarImage(int aWidth, int aHeight, int aTileWidth, int aTileHeight, int aBufferedImageType)
After construction, a world coordinate system needs to be set using
setXYWorldReference(com.luciad.view.ILcdXYWorldReference)
.
aWidth
- the width of the view, expressed in pixels.aHeight
- the height of the view, expressed in pixels.aTileWidth
- the width of internal image tiles, expressed in pixels.aTileHeight
- the height of internal image tiles, expressed in pixels.aBufferedImageType
- the type of the view image, as defined in
BufferedImage
.public TLcdGXYViewPlanarImage(int aWidth, int aHeight, int aTileWidth, int aTileHeight, int aBufferedImageType, ILcdTreeLayeredSupport aTreeLayeredSupport)
After construction, a world coordinate system needs to be set using
setXYWorldReference(com.luciad.view.ILcdXYWorldReference)
.
aWidth
- the width of the view, expressed in pixels.aHeight
- the height of the view, expressed in pixels.aTileWidth
- the width of internal image tiles, expressed in pixels.aTileHeight
- the height of internal image tiles, expressed in pixels.aBufferedImageType
- the type of the view image, as defined in
BufferedImage
.aTreeLayeredSupport
- an instance of ILcdTreeLayeredSupport
used to store the layerspublic TLcdGXYViewPlanarImage(int aWidth, int aHeight, int aTileWidth, int aTileHeight, int aBufferedImageType, IndexColorModel aIndexColorModel)
After construction, a world coordinate system needs to be set using
setXYWorldReference(com.luciad.view.ILcdXYWorldReference)
.
aWidth
- the width of the view, expressed in pixels.aHeight
- the height of the view, expressed in pixels.aTileWidth
- the width of internal image tiles, expressed in pixels.aTileHeight
- the height of internal image tiles, expressed in pixels.aBufferedImageType
- the type of the view image, as defined in
BufferedImage
. The type must be compatible with
the specified index color model.aIndexColorModel
- the index color model of the view image.public TLcdGXYViewPlanarImage(int aWidth, int aHeight, int aTileWidth, int aTileHeight, int aBufferedImageType, IndexColorModel aIndexColorModel, ILcdTreeLayeredSupport aTreeLayeredSupport)
After construction, a world coordinate system needs to be set using
setXYWorldReference(com.luciad.view.ILcdXYWorldReference)
.
aWidth
- the width of the view, expressed in pixels.aHeight
- the height of the view, expressed in pixels.aTileWidth
- the width of internal image tiles, expressed in pixels.aTileHeight
- the height of internal image tiles, expressed in pixels.aBufferedImageType
- the type of the view image, as defined in
BufferedImage
. The type must be compatible with
the specified index color model.aIndexColorModel
- the index color model of the view image.aTreeLayeredSupport
- an instance of ILcdTreeLayeredSupport
used to store the layerspublic static void setClassTraceOn(boolean aClassTraceOn)
true
then all log messages are recorded, otherwise only
the informative, warning and error messages are recorded.aClassTraceOn
- if true then all log messages are recorded,
otherwise only the informative, warning and error messages are recorded.public void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.aTraceOn
- if true then all log messages are recorded for this
instance. If false, then only the informative, warning and
error log messages are recorded.public boolean isTraceOn()
true
if tracing is enabled for this class.public Raster getTile(int aTileX, int aTileY)
getTile
in interface RenderedImage
getTile
in class javax.media.jai.PlanarImage
public void pan(int aDeltaX, int aDeltaY, boolean aRepaint)
ILcdGXYView
pan
in interface ILcdGXYView
aDeltaX
- the shift in the X direction in screen coordinatesaDeltaY
- the shift in the Y direction in screen coordinatesaRepaint
- if true
, will trigger a repaint of the view's contents.
Depending on the implementation, only the newly exposed areas may be painted.
If false, the view is not repainted.public void paint(Graphics aGraphics)
public void paintGXYView(Graphics aGraphics)
ILcdGXYView
Graphics
.
The painted image contains the following:
view label painter
, if it is set;
invalidate
methods.paintGXYView
in interface ILcdGXYView
aGraphics
- the Graphics
to paint the contents of this view onILcdGXYView.invalidate(boolean, java.lang.Object, java.lang.String)
public void update(Graphics aGraphics)
paintGXYView( aGraphics )
aGraphics
- the graphics to paint the view onpaintGXYView(java.awt.Graphics)
public void print(Graphics aGraphics)
ILcdGXYView
on the given Graphics
,
without using any buffers or off-screen images.aGraphics
- the Graphics
to paint the contents of this view oninvalidate(boolean, java.lang.Object, java.lang.String)
,
paintGXYView(java.awt.Graphics)
public void addModel(ILcdModel aModel)
aModel
to be displayed in this ILcdView
.
This method creates an ILcdGXYLayer
containing the model and adds it to the view.
For this to work, a layer factory supporting the given model must be set on the view.
addModel
in interface ILcdView
IllegalArgumentException
- if the model is null
, if no layer factory is set, or if
the layer factory cannot create a layer for the given modelremoveModel(com.luciad.model.ILcdModel)
,
setGXYLayerFactory(com.luciad.view.gxy.ILcdGXYLayerFactory)
public void removeModel(ILcdModel aModel)
ILcdView
removeModel
in interface ILcdView
public void addLayeredListener(ILcdLayeredListener aLayeredListener)
ILcdTreeLayered
ILcdLayeredListener
to be notified when layers are added,
removed or moved in the flat list.addLayeredListener
in interface ILcdLayered
addLayeredListener
in interface ILcdTreeLayered
aLayeredListener
- the listener that from now on will be notified of all changes to the
flat list.ILcdTreeLayered.removeLayeredListener(com.luciad.view.ILcdLayeredListener)
public void removeLayeredListener(ILcdLayeredListener aLayeredListener)
ILcdTreeLayered
ILcdLayeredListener
from receiving layered events for the
flat list.removeLayeredListener
in interface ILcdLayered
removeLayeredListener
in interface ILcdTreeLayered
aLayeredListener
- the listener that will no longer be notified of changes in the flat
list.ILcdTreeLayered.addLayeredListener(com.luciad.view.ILcdLayeredListener)
public int layerCount()
ILcdTreeLayered
Returns the number of layers in the flat list representation of the hierarchical layer structure. This does not include the root node.
layerCount
in interface ILcdLayered
layerCount
in interface ILcdTreeLayered
public Enumeration layers()
ILcdTreeLayered
Returns an Enumeration
of all the ILcdLayer
s currently in the flat
list representation of the hierarchical layer structure, starting from the bottom layer to the
top layer. This does not include the root node.
layers
in interface ILcdLayered
layers
in interface ILcdTreeLayered
Enumeration
of all the ILcdLayer
s currently in the flat
list, starting from the bottom layer to the top layer. Does not include the root node.public Enumeration layersBackwards()
ILcdTreeLayered
Returns an Enumeration
of all the ILcdLayer
s currently in the flat
list representation of the hierarchical layer structure, starting from the top layer to the
bottom layer. This does not include the root node.
layersBackwards
in interface ILcdLayered
layersBackwards
in interface ILcdTreeLayered
Enumeration
of all the ILcdLayer
s currently in the flat
list, starting from the top layer to the bottom layer. Does not include the root node.public ILcdLayer getLayer(int aIndex) throws ArrayIndexOutOfBoundsException
ILcdTreeLayered
Returns the ILcdLayer
with index aIndex
in the flat list
representation of the hierarchical layer structure.
getLayer
in interface ILcdLayered
getLayer
in interface ILcdTreeLayered
aIndex
- the position of the layer to retrieve in the flat list representation.ILcdLayer
with index aIndex
in the flat list
representationArrayIndexOutOfBoundsException
- if the given index is invalidpublic ILcdLayer layerOf(ILcdModel aModel) throws NoSuchElementException
ILcdTreeLayered
ILcdLayer
of the flat list that contains the given
ILcdModel
.layerOf
in interface ILcdLayered
layerOf
in interface ILcdTreeLayered
aModel
- the model to check for in the flat listILcdLayer
of the flat list that contains the given
ILcdModel
.NoSuchElementException
- if there is no layer containing the given modelpublic int indexOf(ILcdLayer aLayer) throws NoSuchElementException
ILcdTreeLayered
Returns the index of the given layer aLayer
in the flat list representation of
the hierarchical structure.
indexOf
in interface ILcdLayered
indexOf
in interface ILcdTreeLayered
aLayer
- the layer whose index to returnaLayer
in the flat list representationNoSuchElementException
- if aLayer
is not in the flat listpublic void moveLayerAt(int aIndex, ILcdLayer aLayer) throws NoSuchElementException, ArrayIndexOutOfBoundsException
ILcdLayered
ILcdLayered
) to the existing index
aIndex.
When a layer is moved down, all layers in between the previous and future position of the given layer
(including the layer at index aIndex) are moved one position up.
When a layer is moved up, all layers in between the previous and future position of the given layer
(including the layer at index aIndex) are moved one position down.
More formally, let previousIndex be the index of aLayer
before the move.
If previousIndex < aIndex, then the index of all ILcdLayer
objects
in from previousIndex + 1 to aIndex is decremented with 1.
If previousIndex > aIndex, then the index of all ILcdLayer
objects
in from aIndex to previousIndex -1 is incremented with 1.
moveLayerAt
in interface ILcdLayered
aIndex
- the index of the position where to move the layer.aLayer
- the layer to move.NoSuchElementException
- if aLayer
is not in this ILcdLayered
.ArrayIndexOutOfBoundsException
- if aIndex
is not an index of one of
the layers of this ILcdLayered
.public void removeLayer(ILcdLayer aLayer)
ILcdTreeLayered
Removes a layer from both the hierarchical layer structure and the flat list representation.
When removing an ILcdLayerTreeNode
all of its children will also be removed. An
event will then be generated for every layer that has been removed (one for the node and one
for each of its child layers).
It is not possible to remove the root node
removeLayer
in interface ILcdLayered
removeLayer
in interface ILcdTreeLayered
aLayer
- the layer to remove. If the layer is not in the flat list, this method has no effect.public void removeAllLayers()
ILcdTreeLayered
Remove all the layers from the hierarchical layer structure and the flat list representation. An event will be fired for every layer that has been removed. This will not remove the root node.
removeAllLayers
in interface ILcdLayered
removeAllLayers
in interface ILcdTreeLayered
public boolean containsLayer(ILcdLayer aLayer)
ILcdTreeLayered
Returns whether the flat list representation of the hierarchical layer structure contains
the given layer. More formally, returns true
if and only if the flat list
representation contains at least one layer l
such that (aLayer==null ? l==null : aLayer.equals(l)).
Calling this method with the root node will return false
, since the
root node is not a part of the flat list representation.
containsLayer
in interface ILcdLayered
containsLayer
in interface ILcdTreeLayered
aLayer
- the layer to check whether it is in the flat list representationtrue
when the flat list representation contains the given layer,
false
otherwisepublic void putCornerIcon(ILcdIcon aCornerIcon, int aPosition)
ILcdGXYView
ILcdIcon
to be painted at the given corner of this
view. Only the last set icon for the given position is painted.putCornerIcon
in interface ILcdGXYView
aCornerIcon
- the ILcdIcon
to be painted at the given corner or null
to unregister the iconaPosition
- one of ILcdGXYView.UPPERLEFT
, ILcdGXYView.UPPERRIGHT
,
ILcdGXYView.LOWERRIGHT
, ILcdGXYView.LOWERLEFT
public ILcdIcon getCornerIcon(int aPosition)
ILcdIcon
to be painted at the given corner of the view.aPosition
- one of ILcdGXYView.UPPERLEFT
, ILcdGXYView.UPPERRIGHT
,
ILcdGXYView.LOWERRIGHT
, ILcdGXYView.LOWERLEFT
ILcdIcon
to be painted at the given corner or null
when
no icon has to be painted at the given cornerputCornerIcon(com.luciad.gui.ILcdIcon, int)
public boolean addGXYLayer(ILcdGXYLayer aLayer)
ILcdGXYView
ILcdGXYLayer
to this ILcdGXYView
. The layer is
normally added to the top of the view's layers, but that is implementation specific.
The view will be repainted depending on the result of isAutoUpdate
.
No action is performed if the given layer is already contained
in the list.addGXYLayer
in interface ILcdGXYView
aLayer
- the layer to add to this viewtrue
if the layer was added successfully,
false
if the view already contained the layerILcdLayered.containsLayer(com.luciad.view.ILcdLayer)
public boolean addGXYLayer(ILcdGXYLayer aLayer, boolean aRepaint)
ILcdGXYView
ILcdGXYLayer
to this ILcdGXYView
, forcing a repaint if
desired. The layer is normally added to the top of the view's layers, but that is
implementation specific. No action is performed if the given layer is already contained in the
list.addGXYLayer
in interface ILcdGXYView
aLayer
- the layer to add to this viewaRepaint
- if true, the view is repainted. If false, the view is not repainted.true
if the layer was added successfully,
false
if the view already contained the layerILcdLayered.containsLayer(com.luciad.view.ILcdLayer)
public int getNumberOfCachedBackgroundLayers()
ILcdGXYView
getNumberOfCachedBackgroundLayers
in interface ILcdGXYView
ILcdGXYView.setNumberOfCachedBackgroundLayers(int)
public void setNumberOfCachedBackgroundLayers(int aNumberOfCachedBackgroundLayers)
setNumberOfCachedBackgroundLayers
in interface ILcdGXYView
aNumberOfCachedBackgroundLayers
- should be zeroIllegalArgumentException
- when aNumberOfCachedBackgroundLayers != 0ILcdGXYView.getNumberOfCachedBackgroundLayers()
,
ILcdGXYView.invalidateGXYLayer(com.luciad.view.gxy.ILcdGXYLayer, boolean, java.lang.Object, java.lang.String)
public boolean hasValidImage()
ILcdGXYView
true
if the view has a valid image.hasValidImage
in interface ILcdGXYView
true
ILcdGXYView.getImage()
public Image getImage()
ILcdGXYView
Image
of this view. The image has not been painted on by the controller.
This method is guaranteed to return an up-to-date image: if the view has been invalidated in
some way (e.g. when a layer has been removed) then this method first updates the view before
returning an image.
To improve performance and conserve memory, the view is allowed to cache, reuse and overwrite the image
in subsequent repaints.
NOTE: While using High DPI mode, this method will return an image which is bigger than the view dimensions reported
by getWidth()
and getHeight()
methods.getImage
in interface ILcdGXYView
public Dimension getPreferredSize()
ILcdGXYView
getPreferredSize
in interface ILcdGXYView
public void setCursor(Cursor aCursor)
This method is not implemented: an image does not offer user-interaction.
setCursor
in interface ILcdGXYView
aCursor
- Cursor instance to use, or null to inherit the cursor
of a containing entity, if anyCursor
public void setBackground(Color aColor)
ILcdGXYView
setBackground
in interface ILcdGXYView
aColor
- the color which appears at a location where no data is painted.ILcdGXYView.getBackground()
public Color getBackground()
ILcdGXYView
getBackground
in interface ILcdGXYView
ILcdGXYView.setBackground(java.awt.Color)
public void setScale(double aScale)
ILcdGXYView
isAutoUpdate
.
The scale corresponds to the number of pixels per world unit, as determined by the
ILcdXYWorldReference
. Hence, increasing the scale zooms in, and decreasing the
scale zooms out.
A view displaying geographical data usually employs a scale in pixels per meter.
As an example, to fit the world on a view that is 1000 pixels wide, a scale of about
1000 pixels/40.000km, or 1.0/40.000 is needed.
For most use cases, we recommended setting the unitless map scale
instead.setScale
in interface ILcdGXYView
aScale
- the new scale of the view. The view is scaled using the world origin as center.
The scale is limited so that it does not exceed the interval defined by
the minimum and maximum scales.ILcdGXYView.getScale()
,
ILcdGXYView.getMinScale()
,
ILcdGXYView.getMaxScale()
public void setScale(double aScale, boolean aRepaint)
ILcdGXYView
ILcdXYWorldReference
. Hence, increasing the scale zooms in, and decreasing the
scale zooms out.
A view displaying geographical data usually employs a scale in pixels per meter.
As an example, to fit the world on a view that is 1000 pixels wide, a scale of about
1000 pixels/40.000km, or 1.0/40.000 is needed.
For most use cases, we recommended setting the unitless map scale
instead.setScale
in interface ILcdGXYView
aScale
- the new scale of the view. The view is scaled using the world origin as center.
The scale is limited so that it does not exceed the interval defined by
the minimum and maximum scales.aRepaint
- if true
, the view is repainted. If false, the view is not repainted.ILcdGXYView.getScale()
,
ILcdGXYView.getMinScale()
,
ILcdGXYView.getMaxScale()
public void setScale(double aScale, boolean aRepaint, boolean aAdjusting)
ILcdGXYView
ILcdXYWorldReference
. Hence, increasing the scale zooms in, and decreasing the
scale zooms out.
A view displaying geographical data usually employs a scale in pixels per meter.
As an example, to fit the world on a view that is 1000 pixels wide, a scale of about
1000 pixels/40.000km, or 1.0/40.000 is needed.
For most use cases, we recommended setting the unitless map scale
instead.setScale
in interface ILcdGXYView
aScale
- the new scale of the view. The view is scaled using the world origin as center.
The scale is limited so that it does not exceed the interval defined by
the minimum and maximum scales.aRepaint
- if true
, the view is repainted. If false, the view is not repainted.aAdjusting
- if true
, the caller indicates that he will trigger another property change
right after this call. This is reflected in the associated property change event.ILcdGXYView.getScale()
,
ILcdGXYView.getMinScale()
,
ILcdGXYView.getMaxScale()
public void setScale(double aScaleX, double aScaleY, boolean aRepaint, boolean aAdjusting)
ILcdGXYView
isAutoUpdate
.
The scale corresponds to the number of pixels per world unit,
as determined by the ILcdXYWorldReference
. For example, a view displaying geographical data
could use a scale in pixels per meter.
The default implementation in this interface sets both scales to the geometric mean of the requested scales. The concrete view implementations do respect the individual scales.
setScale
in interface ILcdGXYView
aScaleX
- the new scale along the x-axis of the view.aScaleY
- the new scale along the y-axis of the view.aRepaint
- if true
, the view is repainted. If false, the view is not repainted.aAdjusting
- if true
, the caller indicates that he will trigger another property change
right after this call. This is reflected in the associated property change event.TLcdGXYViewXYWorldTransformation.getScaleX()
,
TLcdGXYViewXYWorldTransformation.getScaleY()
public double getScale()
ILcdGXYView
unitless map scale
instead.getScale
in interface ILcdGXYView
ILcdGXYView.setScale(double)
,
ILcdGXYView.getMapScale(com.luciad.view.TLcdMapScale.ScaleLocation)
public void setMinScale(double aMinScale)
ILcdGXYView
ILcdGXYView.setScale(double)
or ILcdGXYView.setMapScale(com.luciad.view.TLcdMapScale, com.luciad.view.TLcdMapScale.ScaleLocation)
will ensure that the scale does not fall below the minimum scale.
For most use cases, we recommended using the unitless map scale
variant instead.setMinScale
in interface ILcdGXYView
aMinScale
- the new minimum scale of this viewILcdGXYView.setScale(double)
,
ILcdGXYView.getMinScale()
public double getMinScale()
ILcdGXYView
ILcdGXYView.setScale(double)
or ILcdGXYView.setMapScale(com.luciad.view.TLcdMapScale, com.luciad.view.TLcdMapScale.ScaleLocation)
will ensure that the scale does not fall below the minimum scale.
For most use cases, we recommended using the unitless map scale
variant instead.getMinScale
in interface ILcdGXYView
ILcdGXYView.setScale(double)
,
ILcdGXYView.setMinScale(double)
public void setMaxScale(double aMaxScale)
ILcdGXYView
ILcdGXYView.setScale(double)
or ILcdGXYView.setMapScale(com.luciad.view.TLcdMapScale, com.luciad.view.TLcdMapScale.ScaleLocation)
will ensure that the scale does not rise above the maximum scale.
For most use cases, we recommended using the unitless map scale
variant instead.setMaxScale
in interface ILcdGXYView
aMaxScale
- the new maximum scale of this viewILcdGXYView.setScale(double)
,
ILcdGXYView.getMaxScale()
public double getMaxScale()
ILcdGXYView
ILcdGXYView.setScale(double)
or ILcdGXYView.setMapScale(com.luciad.view.TLcdMapScale, com.luciad.view.TLcdMapScale.ScaleLocation)
will ensure that the scale does not rise above the maximum scale.
For most use cases, we recommended using the unitless map scale
variant instead.getMaxScale
in interface ILcdGXYView
ILcdGXYView.setScale(double)
,
ILcdGXYView.setMaxScale(double)
public void setWorldOrigin(ILcdPoint aWorldOrigin)
ILcdGXYView
isAutoUpdate
.
The world origin is a point in world coordinates that maps onto the view origin.setWorldOrigin
in interface ILcdGXYView
aWorldOrigin
- the new world origin of this view, expressed in world coordinates.
Only the XY coordinates are considered.ILcdGXYView.getWorldOrigin()
,
ILcdGXYView.getXYWorldReference()
public void setWorldOrigin(ILcdPoint aWorldOrigin, boolean aRepaint)
ILcdGXYView
setWorldOrigin
in interface ILcdGXYView
aWorldOrigin
- the new world origin of this view, expressed in world coordinates.
Only the XY coordinates are considered.aRepaint
- if true
, the view is repainted. If false, the view is not repainted.ILcdGXYView.getWorldOrigin()
,
ILcdGXYView.getXYWorldReference()
public void setWorldOrigin(ILcdPoint aWorldOrigin, boolean aRepaint, boolean aAdjusting)
ILcdGXYView
setWorldOrigin
in interface ILcdGXYView
aWorldOrigin
- the new world origin of this view, expressed in world coordinates.
Only the XY coordinates are considered.aRepaint
- if true
, the view is repainted. If false, the view is not repainted.aAdjusting
- if true
, the caller indicates that he will trigger another property change right
after this call.
This is reflected in the associated property change event.ILcdGXYView.getWorldOrigin()
,
ILcdGXYView.getXYWorldReference()
public ILcdPoint getWorldOrigin()
ILcdGXYView
getWorldOrigin
in interface ILcdGXYView
ILcdGXYView.setWorldOrigin(com.luciad.shape.ILcdPoint)
,
ILcdGXYView.getViewOrigin()
,
ILcdGXYView.getXYWorldReference()
public void setViewOrigin(Point aViewOrigin)
ILcdGXYView
isAutoUpdate
.
The view origin is a point in AWT pixel coordinates that maps onto the world origin.setViewOrigin
in interface ILcdGXYView
aViewOrigin
- the new view origin of this view, expressed in AWT pixel coordinatesILcdGXYView.getViewOrigin()
,
ILcdGXYView.getWorldOrigin()
public void setViewOrigin(Point aViewOrigin, boolean aRepaint)
ILcdGXYView
setViewOrigin
in interface ILcdGXYView
aViewOrigin
- the new view origin of this view, expressed in AWT pixel coordinatesaRepaint
- if true
, the view is repainted. If false, the view is not repainted.ILcdGXYView.getWorldOrigin()
,
ILcdGXYView.getViewOrigin()
public void setViewOrigin(Point aViewOrigin, boolean aRepaint, boolean aAdjusting)
ILcdGXYView
setViewOrigin
in interface ILcdGXYView
aViewOrigin
- the new view origin of this view, expressed in AWT pixel coordinatesaRepaint
- if true
, the view is repainted. If false, the view is not repainted.aAdjusting
- if true
, the caller indicates that he will trigger another property change
right after this call. This is reflected in the associated property change event.ILcdGXYView.getWorldOrigin()
,
ILcdGXYView.getViewOrigin()
public Point getViewOrigin()
ILcdGXYView
getViewOrigin
in interface ILcdGXYView
ILcdGXYView.getWorldOrigin()
,
ILcdGXYView.setViewOrigin(java.awt.Point)
public double getRotation()
ILcdRotationCapableGXYView
ILcdGXYView
. The rotation is expressed in degrees
and is positive counter-clockwise. The rotation is applied in the world reference system
around the worldOrigin.getRotation
in interface ILcdRotationCapable
getRotation
in interface ILcdRotationCapableGXYView
ILcdGXYView
. The rotation is expressed in degrees
and is positive counter-clockwise.ILcdRotationCapableGXYView.setRotation(double)
public void setRotation(double aRotation, boolean aRepaint, boolean aAdjusting)
ILcdGXYView
, optionally repainting the view.
The rotation is expressed in degrees and is positive counter-clockwise.
The rotation is applied in the world reference system around the worldOrigin.aRotation
- the new rotation value expressed in degrees (positive counter-clockwise)aAdjusting
- if true, the caller indicates that he will trigger another property change right after this call.
This is reflected in the associated property change event.aRepaint
- if true, the view is repaintedgetRotation()
public void setRotation(double aRotation)
ILcdRotationCapableGXYView
ILcdGXYView
, updating the view according to
ILcdView.isAutoUpdate()
.
The rotation is expressed in degrees
and is positive counter-clockwise. The rotation is applied in the world reference system
around the worldOrigin.setRotation
in interface ILcdRotationCapable
setRotation
in interface ILcdRotationCapableGXYView
aRotation
- the new rotation value expressed in degrees (positive counter-clockwise).ILcdRotationCapableGXYView.getRotation()
public void setRotation(double aRotation, boolean aAdjusting)
ILcdRotationCapableGXYView
ILcdGXYView
, optionally indicating subsequent property changes.
The rotation is expressed in degrees and is positive counter-clockwise.
The rotation is applied in the world reference system around the worldOrigin.setRotation
in interface ILcdRotationCapable
setRotation
in interface ILcdRotationCapableGXYView
aRotation
- the new rotation value expressed in degrees (positive counter-clockwise)aAdjusting
- if true, the caller indicates that he will trigger another property change right after this call.
This is reflected in the associated property change event.ILcdRotationCapableGXYView.getRotation()
public ILcdGXYViewXYWorldTransformation getGXYViewXYWorldTransformation()
ILcdGXYViewXYWorldTransformationProvider
ILcdGXYViewXYWorldTransformation
for an ILcdGXYView
.
Users of the transformation should update their reference when the view's
world origin
,
view origin
,
rotation
, or scale
changes.getGXYViewXYWorldTransformation
in interface ILcdGXYViewXYWorldTransformationProvider
ILcdGXYViewXYWorldTransformation
public void setXYWorldReference(ILcdXYWorldReference aXYWorldReference)
ILcdGXYView
isAutoUpdate
.setXYWorldReference
in interface ILcdGXYView
aXYWorldReference
- the new ILcdXYWorldReference
associated to this viewILcdXYWorldReference
,
ILcdGXYView.getXYWorldReference()
,
ILcdGXYView.setWorldOrigin(com.luciad.shape.ILcdPoint)
public void setXYWorldReference(ILcdXYWorldReference aXYWorldReference, boolean aRepaint)
ILcdGXYView
setXYWorldReference
in interface ILcdGXYView
aXYWorldReference
- the new ILcdXYWorldReference
associated to this viewaRepaint
- if true
, the view is repainted. If false, the view is not repainted.ILcdXYWorldReference
,
ILcdGXYView.getXYWorldReference()
,
ILcdGXYView.setWorldOrigin(com.luciad.shape.ILcdPoint)
public void setXYWorldReference(ILcdXYWorldReference aXYWorldReference, boolean aRepaint, boolean aAdjusting)
ILcdGXYView
setXYWorldReference
in interface ILcdGXYView
aXYWorldReference
- the new ILcdXYWorldReference
associated to this viewaRepaint
- if true
, the view is repainted. If false, the view is not repainted.aAdjusting
- if true
, the caller indicates that he will trigger another property change
right after this call. This is reflected in the associated property change event.ILcdXYWorldReference
,
ILcdGXYView.getXYWorldReference()
,
ILcdGXYView.setWorldOrigin(com.luciad.shape.ILcdPoint)
public ILcdXYWorldReference getXYWorldReference()
ILcdGXYView
getXYWorldReference
in interface ILcdGXYView
ILcdXYWorldReference
,
ILcdGXYView.setXYWorldReference(com.luciad.view.ILcdXYWorldReference)
,
ILcdGXYView.getWorldOrigin()
public void setGXYController(ILcdGXYController aGXYViewController)
TLcdGXYViewPlanarImage
does not support controllers:
an image has no user-interaction.
setGXYController
in interface ILcdGXYView
aGXYViewController
- the new controller of this view,
or null
if no controller is to be usedUnsupportedOperationException
- when this method is calledILcdGXYController.startInteraction(com.luciad.view.gxy.ILcdGXYView)
,
ILcdGXYController.terminateInteraction(com.luciad.view.gxy.ILcdGXYView)
,
TLcdGXYViewJPanel.setGXYController(ILcdGXYController)
,
ILcdGXYView.getGXYController()
public ILcdGXYController getGXYController()
ILcdGXYView
ILcdGXYController
handling the user interaction of the view.getGXYController
in interface ILcdGXYView
ILcdGXYController
,
ILcdGXYView.setGXYController(com.luciad.view.gxy.ILcdGXYController)
public ILcdGXYPen getDefaultPen()
ILcdGXYView
ILcdGXYPen
supporting editing and painting on the view.getDefaultPen
in interface ILcdGXYView
ILcdGXYPen
of this viewILcdGXYPen
public void setPaintingMode(int aPaintingMode)
ILcdGXYView
setPaintingMode
in interface ILcdGXYView
aPaintingMode
- a binary OR of ILcdGXYLayer.BODIES, ILcdGXYLayer.LABELS, ILcdGXYLayer.SELECTIONILcdGXYView.getPaintingMode()
public int getPaintingMode()
ILcdGXYView
getPaintingMode
in interface ILcdGXYView
ILcdGXYView.setPaintingMode(int)
public void invalidate(boolean aRepaint, Object aSource, String aMessage)
ILcdGXYView
invalidate
in interface ILcdGXYView
invalidate
in interface ILcdView
aRepaint
- if true
, the view is updated immediately, but the method will not wait
for the update to finish.
If false, the view is updated on the next paint or repaint method call.aSource
- class instance calling the method. For tracing purposes.aMessage
- a message associated to this method call. For tracing purposes.ILcdGXYView.repaint()
public void invalidateAndWait(boolean aRepaint, Object aSource, String aMessage)
ILcdGXYView
invalidateAndWait
in interface ILcdGXYView
aRepaint
- if true
the ILcdGXYView will be updated immediately, and the method will block
until the update is complete.
If false, the view is updated on the next paint or repaint method call.aSource
- class instance calling the method. For tracing purposes.aMessage
- a message associated to this method call. For tracing purposes.ILcdGXYView.repaint()
public void invalidateRegion(Rectangle aClip, boolean aRepaint, Object aSource, String aMessage)
ILcdGXYView
invalidateRegion
in interface ILcdGXYView
aClip
- the clip to invalidateaRepaint
- if true
, the view is updated immediately, but the method will not wait
for the update to finish.
If false, the view is updated on the next paint or repaint method call.aSource
- class instance calling the method. For tracing purposes.aMessage
- a message associated to this method call. For tracing purposes.ILcdGXYView.repaint()
public void invalidateRegionAndWait(Rectangle aClip, boolean aRepaint, Object aSource, String aMessage)
ILcdGXYView
invalidateRegionAndWait
in interface ILcdGXYView
aClip
- the clip to invalidateaRepaint
- if true
the ILcdGXYView will be updated immediately, and the method will block
until the update is complete.
If false, the view is updated on the next paint or repaint method call.aSource
- class instance calling the method. For tracing purposes.aMessage
- a message associated to this method call. For tracing purposes.ILcdGXYView.repaint()
public void invalidateGXYLayer(ILcdGXYLayer aGXYLayer, boolean aRepaint, Object aSource, String aMessage)
ILcdGXYView
ILcdGXYLayer
,
optionally repainting the content asynchronously.
A subsequent repaint will (at the least) ask the given layer to draw its bodies, labels and selection,
and may reuse earlier generated imagery for the other layers.
This method is typically called when a single layer needs to be redrawn, for example, when its painter
settings change.invalidateGXYLayer
in interface ILcdGXYView
aGXYLayer
- the layer to invalidateaRepaint
- if true
, the view is updated immediately, but the method will not wait
for the update to finish.
If false, the view is updated on the next paint or repaint method call.aSource
- class instance calling the method. For tracing purposes.aMessage
- a message associated to this method call. For tracing purposes.public void invalidateGXYLayerAndWait(ILcdGXYLayer aGXYLayer, boolean aRepaint, Object aSource, String aMessage)
ILcdGXYView
ILcdGXYLayer
,
optionally repainting the content synchronously.
A subsequent repaint will (at the least) ask the given layer to draw its bodies, labels and selection,
and may reuse earlier generated imagery for the other layers.
This method is typically called when a single layer needs to be redrawn, for example, when its painter
settings change.invalidateGXYLayerAndWait
in interface ILcdGXYView
aGXYLayer
- the layer to invalidateaRepaint
- if true
the ILcdGXYView will be updated immediately, and the method will block
until the update is complete.
If false, the view is updated on the next paint or repaint method call.aSource
- class instance calling the method. For tracing purposes.aMessage
- a message associated to this method call. For tracing purposes.ILcdGXYView.repaint()
public void invalidateSelection(boolean aRepaint, Object aSource, String aMessage)
ILcdGXYView
invalidateSelection
in interface ILcdGXYView
aRepaint
- if true
, the view is updated immediately, but the method will not wait
for the update to finish.
If false, the view is updated on the next paint or repaint method call.aSource
- class instance calling the method. For tracing purposes.aMessage
- a message associated to this method call. For tracing purposes.ILcdGXYView.repaint()
public void invalidateSelectionAndWait(boolean aRepaint, Object aSource, String aMessage)
ILcdGXYView
invalidateSelectionAndWait
in interface ILcdGXYView
aRepaint
- if true
the ILcdGXYView will be updated immediately, and the method will block
until the update is complete.
If false, the view is updated on the next paint or repaint method call.aSource
- class instance calling the method. For tracing purposes.aMessage
- a message associated to this method call. For tracing purposes.ILcdGXYView.repaint()
public void invalidateRegionSelection(Rectangle aClip, boolean aRepaint, Object aSource, String aMessage)
ILcdGXYView
invalidateRegionSelection
in interface ILcdGXYView
aClip
- the clip to invalidateaRepaint
- if true
, the view is updated immediately, but the method will not wait
for the update to finish.
If false, the view is updated on the next paint or repaint method call.aSource
- class instance calling the method. For tracing purposes.aMessage
- a message associated to this method call. For tracing purposes.ILcdGXYView.repaint()
public void invalidateRegionSelectionAndWait(Rectangle aClip, boolean aRepaint, Object aSource, String aMessage)
ILcdGXYView
invalidateRegionSelectionAndWait
in interface ILcdGXYView
aClip
- the clip to invalidateaRepaint
- if true
the ILcdGXYView will be updated immediately, and the method will block
until the update is complete.
If false, the view is updated on the next paint or repaint method call.aSource
- class instance calling the method. For tracing purposes.aMessage
- a message associated to this method call. For tracing purposes.ILcdGXYView.repaint()
public void setAutoUpdate(boolean aAutoUpdate)
When switching the autoUpdate property from false
to true
, a repaint
will be triggered.
setAutoUpdate
in interface ILcdView
aAutoUpdate
- if true
, the view automatically updates its representation on
reception of any event that might require an update (e.g. when its
properties change, when an Object
in a model has changed, or
when a model has been added/removed). If false, the view must be repainted
manually.ILcdView.isAutoUpdate()
public boolean isAutoUpdate()
ILcdView
isAutoUpdate
in interface ILcdView
true
if the view automatically updates its representation on reception of
any event that might require an update (e.g. when its properties change, when an
Object
in a model has changed, or when a model has been added/removed).
false
if the view must be repainted manually.ILcdView.setAutoUpdate(boolean)
public void setDrawOffScreenImageOnPaint(boolean aDrawOffScreenImageOnPaint)
ILcdGXYView
setDrawOffScreenImageOnPaint
in interface ILcdGXYView
aDrawOffScreenImageOnPaint
- true
to make the view paint itself
when one of the paint methods is called. False if only the current controller is painted.ILcdGXYView.isDrawOffScreenImageOnPaint()
,
ILcdGXYView.setGXYController(com.luciad.view.gxy.ILcdGXYController)
,
ILcdGXYView.paintGXYView(java.awt.Graphics)
public boolean isDrawOffScreenImageOnPaint()
ILcdGXYView
isDrawOffScreenImageOnPaint
in interface ILcdGXYView
true
if the view paints itself
when one of the paint methods is called. False if only the current controller is
painted.ILcdGXYView.setDrawOffScreenImageOnPaint(boolean)
,
ILcdGXYView.paintGXYView(java.awt.Graphics)
public void addPropertyChangeListener(PropertyChangeListener listener)
ILcdPropertyChangeSource
Registers the given PropertyChangeListener
to be notified when this object's
properties change.
In case you need to register a listener which keeps a reference to an object with a shorter life-time than this change source,
you can use a ALcdWeakPropertyChangeListener
instance as property change listener.
addPropertyChangeListener
in interface ILcdPropertyChangeSource
addPropertyChangeListener
in interface javax.media.jai.PropertyChangeEmitter
addPropertyChangeListener
in class javax.media.jai.PlanarImage
listener
- The listener to be notifiedALcdWeakPropertyChangeListener
,
ILcdPropertyChangeSource.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener listener)
ILcdPropertyChangeSource
De-registers the given PropertyChangeListener
from receiving property change events
for this object.
If the listener was added more than once, it will be notified one less time after being
removed.
If the listener is null
, or was never added, no exception is thrown and no action is taken.
removePropertyChangeListener
in interface ILcdPropertyChangeSource
removePropertyChangeListener
in interface javax.media.jai.PropertyChangeEmitter
removePropertyChangeListener
in class javax.media.jai.PlanarImage
listener
- the listener that should no longer be notified of changes of
this object's propertiesILcdPropertyChangeSource.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setGXYViewLabelPainter(ILcdGXYViewLabelPainter aGXYViewLabelPainter)
ILcdGXYView
.
A view label painter handles the labels of all the view's layers.
When the view label painter is null, the layers are asked to paint their labels themselves.
This will override any configured view label placer.
Note that it is recommended to use setGXYViewLabelPlacer
instead.
Label placers offer better decluttering behavior, more algorithm choices, support for asynchronous
label placement, and easier customization.
aGXYViewLabelPainter
- the painter handling this view's labels, or nullILcdGXYViewLabelPainter
,
getGXYViewLabelPainter()
public ILcdGXYViewLabelPainter getGXYViewLabelPainter()
ILcdGXYView
ILcdGXYLabelPainter
.getGXYViewLabelPainter
in interface ILcdGXYView
ILcdGXYViewLabelPainter
public ILcdGXYViewLabelPlacer getGXYViewLabelPlacer()
ILcdGXYView
getGXYViewLabelPlacer
in interface ILcdGXYView
null
.ILcdGXYView.setGXYViewLabelPlacer(com.luciad.view.gxy.labeling.ILcdGXYViewLabelPlacer)
public void setGXYViewLabelPlacer(ILcdGXYViewLabelPlacer aGXYViewLabelPlacer)
ILcdGXYView
ILcdGXYViewLabelPlacer
to use for global labeling.
This will override any configured view label painter.
setGXYViewLabelPlacer
in interface ILcdGXYView
aGXYViewLabelPlacer
- a view label placer.ILcdGXYView.getGXYViewLabelPlacer()
public void setGXYLayerFactory(ILcdGXYLayerFactory newGXYLayerFactory)
addGXYLayer(com.luciad.view.gxy.ILcdGXYLayer)
.newGXYLayerFactory
- the layer factory to use when adding models to the view, or nullgetGXYLayerFactory()
public ILcdGXYLayerFactory getGXYLayerFactory()
addGXYLayer(com.luciad.view.gxy.ILcdGXYLayer)
.setGXYLayerFactory(com.luciad.view.gxy.ILcdGXYLayerFactory)
public void addStatusListener(ILcdStatusListener aStatusListener)
ILcdStatusListener
to be notified of view status events.
The amount, type and order of the status events is subject to change.addStatusListener
in interface ILcdStatusSource
addStatusListener
in interface ILcdGXYView
aStatusListener
- the listener that will be informed of status eventsremoveStatusListener(com.luciad.util.ILcdStatusListener)
public void removeStatusListener(ILcdStatusListener aStatusListener)
ILcdStatusListener
from being notified of view status events.removeStatusListener
in interface ILcdStatusSource
removeStatusListener
in interface ILcdGXYView
aStatusListener
- the listener that will no longer be informed of status eventsaddStatusListener(com.luciad.util.ILcdStatusListener)
public void modelProduced(TLcdModelProducerEvent aModelProducerEvent)
modelProduced
in interface ILcdModelProducerListener
aModelProducerEvent
- the event describing the model productionsetGXYLayerFactory(com.luciad.view.gxy.ILcdGXYLayerFactory)
public void addModelListener(ILcdModelListener aModelListener)
ILcdGXYView
ILcdModelListener
to be informed of ILcdModel
change events
from any layer's model in this view.addModelListener
in interface ILcdGXYView
aModelListener
- a listener that will be notified of ILcdModel
change events
from any layer's model in this viewILcdGXYView.removeModelListener(com.luciad.model.ILcdModelListener)
public void removeModelListener(ILcdModelListener aModelListener)
ILcdGXYView
ILcdModelListener
from receiving ILcdModel
change events
from any layer's model in this view.removeModelListener
in interface ILcdGXYView
aModelListener
- a listener that the view will no longer notify of ILcdModel
change eventsILcdGXYView.addModelListener(com.luciad.model.ILcdModelListener)
public void addLayerSelectionListener(ILcdSelectionListener aSelectionListener)
ILcdGXYView
ILcdSelectionListener
to be informed of selection change events
from any layer in this view.addLayerSelectionListener
in interface ILcdGXYView
aSelectionListener
- a listener that will be notified of selection change events
from any layer in this view. The events will have the relevant layer as source.ILcdGXYView.removeLayerSelectionListener(com.luciad.util.ILcdSelectionListener)
public void removeLayerSelectionListener(ILcdSelectionListener aSelectionListener)
ILcdGXYView
ILcdSelectionListener
from receiving selection change events
from any layer in this view.removeLayerSelectionListener
in interface ILcdGXYView
aSelectionListener
- a listener that the view will no longer inform of selection change eventsILcdGXYView.addLayerSelectionListener(com.luciad.util.ILcdSelectionListener)
public void repaint()
TLcdGXYViewPlanarImage
does not implement this method. Use getImage()
to obtain
the up-to-date representation of the view.
Repaints the view.
The view is allowed to reuse earlier painted results as long as they are valid.
Invalidation of the contents may occur indirectly (e.g. by changing view or layer properties)
or directly by calling one of the invalidate
methods.
This method may return before the repaint is complete.
repaint
in interface ILcdGXYView
ILcdGXYView.repaint(int, int, int, int)
,
ILcdGXYView.invalidate(boolean, java.lang.Object, java.lang.String)
,
ILcdGXYView.paintGXYView(java.awt.Graphics)
public void repaint(int aX, int aY, int aWidth, int aHeight)
TLcdGXYViewPlanarImage
does not implement this method. Use getImage()
to obtain
the up-to-date representation of the view.
Repaints the view within the given AWT rectangle.
The view is allowed to reuse earlier painted results as long as they are valid.
Invalidation of the contents may occur indirectly (e.g. by changing view or layer properties)
or directly by calling one of the invalidate
methods.
This method may return before the repaint is complete.
repaint
in interface ILcdGXYView
aX
- the x-coordinate of the rectangle's top-left pointaY
- the y-coordinate of the rectangle's top-left pointaWidth
- the width of the rectangleaHeight
- the height of the rectangleILcdGXYView.repaint()
,
ILcdGXYView.invalidate(boolean, java.lang.Object, java.lang.String)
public Color getForeground()
getForeground
in interface ILcdGXYView
ILcdGXYView.setForeground(java.awt.Color)
public void setForeground(Color aColor)
setForeground
in interface ILcdGXYView
aColor
- the desired foreground Color
ILcdGXYView.getForeground()
public Graphics getGraphics()
ILcdGXYView
getGraphics
in interface ILcdGXYView
getGraphics
in class javax.media.jai.PlanarImage
public boolean isPaintInBackground()
ILcdGXYView
isPaintInBackground
in interface ILcdGXYView
true
if background painting is enabled; false
otherwisepublic void setPaintInBackground(boolean aUpdateInBackground)
setPaintInBackground
in interface ILcdGXYView
aUpdateInBackground
- true
to enable painting in the background; false
to disable itRuntimeException
- when the method is calledpublic ILcdPaintExceptionHandler getPaintExceptionHandler()
ILcdGXYView
getPaintExceptionHandler
in interface ILcdGXYView
public void setPaintExceptionHandler(ILcdPaintExceptionHandler aPaintExceptionHandler)
setPaintExceptionHandler
in interface ILcdGXYView
aPaintExceptionHandler
- a handler to report paint exceptions. This handler should
never be null.public ILcdLayerTreeNode getRootNode()
ILcdTreeLayered
Returns the root node of the tree structure.
getRootNode
in interface ILcdTreeLayered
public boolean isAsynchronousAllowed()
ILcdGXYView
Returns whether this view allows asynchronous operations. Painters, layers or other parts of a
view should not perform asynchronous operations when this method returns false
. If this
method returns true
, they can decide either way.
When asynchronous operations are allowed, intermediate results of time-consuming asynchronous operations are displayed in order to provide an interactive user experience. For non-interactive applications, it is useful to disable asynchronous operations, since they can lead to more unpredictable results. Examples are tests, or server side functionality like the OGC WMS protocol which paints the view and returns it as an image. In these cases, you want the view to be painted completely without having to deal with intermediate results.
isAsynchronousAllowed
in interface ILcdGXYView
public void setAsynchronousAllowed(boolean aAsynchronousAllowed)
Sets if asynchronous operation are allowed for this view. See ILcdGXYView.isAsynchronousAllowed()
for
more information.
This method returns false
by default.
Note: it is advised to only modify this flag at construction time, not at runtime.
aAsynchronousAllowed
- true
to allow asynchronous operations.public boolean isAntiAliased()
ILcdGXYView
false
, it does not mean anti-aliasing is fully disabled.
It only means anti-aliasing is not enabled on the view level, various layers and painters may still decide to
enable anti-aliasing for what they render.isAntiAliased
in interface ILcdGXYView
true
if anti-aliasing is enabled, false
otherwise.public void setAntiAliased(boolean aAntiAliased)
ILcdGXYView.isAntiAliased()
for more information.aAntiAliased
- true
to enable anti-aliasing, false
to let layers and painters decide.