public class TLspLayerTreeNode extends TLspLayer implements ILcdLayerTreeNode
TLspLayer
that implements ILcdLayerTreeNode
and hence can also have child layers.ILspLayer.LayerType
Constructor and Description |
---|
TLspLayerTreeNode(ILcdModel aModel)
Constructs a new layer tree node for the specified model.
|
TLspLayerTreeNode(ILcdModel aModel,
String aLabel,
ILspLayer.LayerType aLayerType)
Initializes a new
ILcdLayerTreeNode object with given model, label and layer type. |
TLspLayerTreeNode(String aLabel)
Constructs a new instance of
ILcdLayerTreeNode with label aLabel . |
TLspLayerTreeNode(String aLabel,
ILcdIcon aIcon)
Constructs a new instance of
ILcdLayerTreeNode with label aLabel and icon aIcon . |
Modifier and Type | Method and Description |
---|---|
void |
addHierarchyLayeredListener(ILcdLayeredListener aListener)
Registers the given
ILcdLayeredListener to receive
TLcdLayeredEvent s from all the ILcdLayerTreeNode s contained in the
tree with this node as root node. |
void |
addHierarchyPropertyChangeListener(PropertyChangeListener aListener)
Registers the given
PropertyChangeListener to
receive PropertyChangeEvent s from all the ILcdLayer s contained in the
tree with this node as root node. |
void |
addHierarchySelectionListener(ILcdSelectionListener aListener)
Registers the given
ILcdSelectionListener to
receive TLcdSelectionChangedEvent s from all the ILcdLayer s contained
in the tree with this node as root node. |
boolean |
addLayer(ILcdLayer aNewChildNode)
Adds a new node to the tree as a child of this node.
|
boolean |
addLayer(ILcdLayer aNewChildNode,
int aIndex)
Adds a new node to the tree as a child of this node.
|
void |
addLayeredListener(ILcdLayeredListener aListener)
Registers the given
ILcdLayeredListener to be notified when layers are added, removed or moved. |
boolean |
addLayers(Collection<ILspLayer> aLayers)
Adds multiple child layers to this tree node.
|
boolean |
containsLayer(ILcdLayer aLayer)
Returns whether this
ILcdLayered contains the given layer. |
ILcdInitialLayerIndexProvider |
getInitialLayerIndexProvider()
Returns the initial layer index provider, which can be used to determine the best index when
a layer is added without specifying an index.
|
ILcdLayer |
getLayer(int aIndex)
Returns the
ILcdLayer in this ILcdLayered
with index aIndex . |
List<ILspLayer> |
getLayers()
Returns a
List of the layers. |
ILspLayer.LayerType |
getLayerType()
Returns the layer type of the first layer in this layer tree node.
|
int |
indexOf(ILcdLayer aLayer)
Returns the index if the given layer is in the list.
|
boolean |
isEditable()
Returns whether the layer allows editing the content that it visualizes.
|
boolean |
isEditableSupported()
Returns
true if the layer supports editing its objects. |
boolean |
isPaintOnTopOfChildrenHint()
Returns whether a node should be painted on top of its children when the node is added to a
view, or beneath its child layers.
|
boolean |
isSelectable()
Returns whether the layer's objects can be selected, for example, by clicking on them.
|
boolean |
isSelectableSupported()
Returns
true if this layer supports selecting objects, false otherwise. |
boolean |
isSelected(Object aObject)
Checks whether the given
Object is currently in the set of
selected objects. |
int |
layerCount()
Returns the number of
ILcdLayer objects in this ILcdLayered . |
ILcdLayer |
layerOf(ILcdModel aModel)
Returns the
ILcdLayer of this ILcdLayered that contains the given ILcdModel . |
Enumeration |
layers()
Returns an
Enumeration of all ILcdLayer objects currently
in this ILcdLayered ,
starting from the bottom layer to the top layer. |
Enumeration |
layersBackwards()
Returns an
Enumeration of all ILcdLayer objects currently in this ILcdLayered ,
starting from the top layer to the bottom layer. |
void |
moveLayerAt(int aIndex,
ILcdLayer aLayer)
Moves the given layer (which is already in
ILcdLayered ) to the existing index
aIndex. |
void |
removeAllLayers()
Removes all the
ILcdLayer objects from this ILcdLayered . |
void |
removeHierarchyLayeredListener(ILcdLayeredListener aListener)
Unregisters the given
ILcdLayeredListener from
receiving TLcdLayeredEvent s for the tree with this node as root node. |
void |
removeHierarchyPropertyChangeListener(PropertyChangeListener aListener)
Unregisters the given
PropertyChangeListener from
receiving PropertyChangeEvent s for the tree with this node as root node. |
void |
removeHierarchySelectionListener(ILcdSelectionListener aListener)
Unregisters the given
ILcdSelectionListener
from receiving TLcdSelectionChangedEvent s for the tree with this node as root
node. |
void |
removeLayer(ILcdLayer aLayer)
Removes aLayer from this
ILcdLayered . |
void |
removeLayer(int aIndex)
Removes the node at index
aIndex from this node and sends the appropriate
TLcdLayeredEvent . |
void |
removeLayeredListener(ILcdLayeredListener aListener)
Unregisters the given
ILcdLayeredListener from receiving layered events for
the ILcdLayered . |
void |
setInitialLayerIndexProvider(ILcdInitialLayerIndexProvider aInitialLayerIndexProvider)
Sets an initial layer index provider, which can be used to determine the best index when a
layer is added without specifying an index.
|
void |
setPaintOnTopOfChildrenHint(boolean aPaintOnTopOfChildrenHint)
Sets whether a node should be painted on top of its children when the node is added to a
view, or beneath its child layers.
|
addEditingStateListener, addPaintRepresentation, configureForSLDStyling, createScaleRange, createScaleRange, editedObjectChanged, editedObjectsChanged, getBounds, getEditor, getEditors, getMapScaleProvider, getMapScaleRange, getMinimumObjectSizeForPainting, getModelQueryConfiguration, getObjectsWithPaintState, getObjectViewMargin, getObjectWorldMargin, getPainter, getPainters, getPaintRepresentations, getRequiredOpenGLProfile, getScaleRange, getStyler, isCulling, isSnapTarget, isSynchronizePainters, paint, query, registerView, removeEditingStateListener, removePaintRepresentation, setCulling, setEditor, setFilter, setMapScaleProvider, setMapScaleRange, setMinimumObjectSizeForPainting, setModel, setModelQueryConfiguration, setObjectViewMargin, setObjectWorldMargin, setPainter, setScaleRange, setSelectableSupported, setSnapTarget, setStyler, setSynchronizePainters, setVisible, setVisible, setVisible, toString, unregisterView
addLayerStateListener, addPropertyChangeListener, addSelectionListener, addStatusListener, clearSelection, createModelXYZWorldTransformation, fireCollectedSelectionChanges, fireLayerStateChange, fireLayerStateChange, fireLayerStateChange, fireLayerStateChange, firePropertyChange, fireStatusEvent, getCurrentViews, getFilter, getIcon, getLabel, getLayerStyle, getModel, getModelXYZWorldTransformation, getSelectionCount, invalidate, isEditable, isSynchronous, isVisible, isVisible, isVisible, removeLayerStateListener, removePropertyChangeListener, removeSelectionListener, removeStatusListener, selectedObjects, selectObject, selectObjects, setEditable, setEditable, setIcon, setLabel, setLayerStyle, setSelectable, setSynchronous
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, removePropertyChangeListener
clearSelection, fireCollectedSelectionChanges, getIcon, getLabel, getModel, isVisible, selectObject, setEditable, setIcon, setLabel, setSelectable, setVisible
addSelectionListener, getSelectedObjects, getSelectionCount, removeSelectionListener, selectedObjects
addLayeredListener, removeLayeredListener
addPropertyChangeListener, removePropertyChangeListener
addLayerStateListener, addStatusListener, getCurrentViews, getLayerStyle, getModelXYZWorldTransformation, invalidate, isEditable, isVisible, isVisible, removeLayerStateListener, removeStatusListener, setEditable, setEditable, setLayerStyle
public TLspLayerTreeNode(ILcdModel aModel)
Constructs a new layer tree node for the specified model.
The layer label
will be the display name of the model descriptor, if available.
The typical use-case for this method is an ILspLayerFactory
which is creating a
layer structure which matches the structure of an incoming ILcdModelTreeNode
.
@Override
public Collection<ILspLayer> createLayers(ILcdModel aModel){
if (aModel instanceof ILcdModelTreeNode){
ILcdModelTreeNode modelNode = (ILcdModelTreeNode)aModel;
TLspLayerTreeNode result = new TLspLayerTreeNode(aModel);
for(int i = 0; i < modelNode.modelCount(); i++){
result.addLayers(createLayers(modelNode.getModel(i)));
}
return result;
} else {
ILspLayer layer = TLspShapeLayerBuilder.newBuilder().model(aModel).build();
return layer;
}
}
Note that the above snippet assumes that the ILcdModelTreeNode
itself does not contain any data (the most common scenario).
In case the ILcdModelTreeNode
contains data which should be visualized, you need to configure the layer tree node
just as you do for a regular layer: for example setting a painter.
aModel
- The modelpublic TLspLayerTreeNode(String aLabel)
Constructs a new instance of ILcdLayerTreeNode
with label aLabel
.
The node will be initialized with a default, empty model.
The main use-case for this constructor is the same as for the TLspLayerTreeNode(String, ILcdIcon)
constructor.
Consult the documentation of that constructor for more information.
aLabel
- A short textual representation of this nodepublic TLspLayerTreeNode(String aLabel, ILcdIcon aIcon)
Constructs a new instance of ILcdLayerTreeNode
with label aLabel
and icon aIcon
.
The node will be initialized with a default, empty model.
The typical use-case for this method is if you want to add a node to the view for grouping purposes. For example, if you have have several raster background layers which you want to group under a node in the view, you can use this constructor to create such a grouping node.
ILspLayer[] rasterBackgroundLayers = ...;
//create a node to group those background layers
ILcdIcon icon = TLcdIconFactory.create(TLcdIconFactory.RASTER_LAYER_ICON);
TLspLayerTreeNode node = new TLspLayerTreeNode("Background Data", icon);
for(ILspLayer backgroundLayer : rasterBackgroundLayers){
node.addLayer(backgroundLayer);
}
view.addLayer(node);
aLabel
- A short textual representation of this nodeaIcon
- A small visual representation of this nodepublic TLspLayerTreeNode(ILcdModel aModel, String aLabel, ILspLayer.LayerType aLayerType)
Initializes a new ILcdLayerTreeNode
object with given model, label and layer type.
The main use-case for this constructor is the same as for the TLspLayerTreeNode(ILcdModel)
constructor.
Consult the documentation of that constructor for more information.
aModel
- the model that is to be added to the new layeraLabel
- the label of the new layeraLayerType
- the LayerType
of the new layerpublic boolean addLayers(Collection<ILspLayer> aLayers)
aLayers
- the layers to addtrue
if all layers have been added, false
if the node already contained
one of the layerspublic boolean addLayer(ILcdLayer aNewChildNode) throws IllegalArgumentException
ILcdLayerTreeNode
Adds a new node to the tree as a child of this node. This newly added node will normally be
the last child node, but that can be implementation specific. Implementations could for example
decide to use the initial layer index provider to
determine the best index to add the layer. Notice that in order to avoid loops in the tree
aNewChildNode
must not already be an element of the tree. This method should also
generate a TLcdLayeredEvent
to warn its listeners that a node has been
added.
addLayer
in interface ILcdLayerTreeNode
aNewChildNode
- the node which must be added as a childtrue
when the layer was successfully added to this node, false
if the node already contained layer aNewChildNode
IllegalArgumentException
- when the node is already an element of the treepublic boolean addLayer(ILcdLayer aNewChildNode, int aIndex) throws IndexOutOfBoundsException, IllegalArgumentException
ILcdLayerTreeNode
Adds a new node to the tree as a child of this node. The child will be inserted at index
aIndex
in the child list of this node. Notice that in order to avoid loops in the
tree aNewChildNode
must not already be an element of the tree. This method should
also generate a TLcdLayeredEvent
to warn its listeners that a node has
been added.
addLayer
in interface ILcdLayerTreeNode
aNewChildNode
- the new childaIndex
- the index in the child list of this node for the new childtrue
when the layer was successfully added to this node, false
if the node already contained layer aNewChildNode
IndexOutOfBoundsException
- when index > ILcdLayerTreeNode.layerCount()
IllegalArgumentException
- when the node is already an element of the treepublic void removeLayer(ILcdLayer aLayer)
ILcdLayered
ILcdLayered
.removeLayer
in interface ILcdLayered
aLayer
- the layer to remove.public void removeLayer(int aIndex)
ILcdLayerTreeNode
Removes the node at index aIndex
from this node and sends the appropriate
TLcdLayeredEvent
.
removeLayer
in interface ILcdLayerTreeNode
aIndex
- the index of the child node which has to be removedpublic ILcdLayer getLayer(int aIndex) throws IndexOutOfBoundsException
ILcdLayered
ILcdLayer
in this ILcdLayered
with index aIndex
.getLayer
in interface ILcdLayered
aIndex
- the position of the layer to retrieve in the ILcdLayered
.ILcdLayer
in this ILcdLayered
with index aIndex
.ArrayIndexOutOfBoundsException
- if the given index is invalidIndexOutOfBoundsException
public List<ILspLayer> getLayers()
ILcdLayered
List
of the layers.getLayers
in interface ILcdLayered
List
of the layers in this ILcdLayered
public int layerCount()
ILcdLayerTreeNode
ILcdLayer
objects in this ILcdLayered
.
This number does not include this layer node. It is the number of child layers of this node that is returned.
layerCount
in interface ILcdLayered
layerCount
in interface ILcdLayerTreeNode
ILcdLayer
objects in this ILcdLayered
.public Enumeration layers()
ILcdLayerTreeNode
Enumeration
of all ILcdLayer
objects currently
in this ILcdLayered
,
starting from the bottom layer to the top layer.
This enumeration does not include this layer node, but only the child layers.
layers
in interface ILcdLayered
layers
in interface ILcdLayerTreeNode
Enumeration
of all ILcdLayer
objects currently
in this ILcdLayered
,
starting from the bottom layer to the top layer.public void moveLayerAt(int aIndex, ILcdLayer aLayer)
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.public int indexOf(ILcdLayer aLayer)
ILcdLayered
indexOf
in interface ILcdLayered
aLayer
- the layer whose index to returnaLayer
public void addLayeredListener(ILcdLayeredListener aListener)
ILcdLayerTreeNode
Registers the given ILcdLayeredListener
to be notified when layers are added, removed or moved.
In case you need to register a listener which keeps a reference to an object with a shorter life-time than this layered,
you can use a ALcdWeakLayeredListener
instance as layered listener.
This layer will only be informed when child layers are added, removed or moved in this layer node. To
receive the events of the whole hierarchical structure, the listener must be added as a hierarchical
listener (see ILcdLayerTreeNode.addHierarchyLayeredListener(ILcdLayeredListener)
).
addLayeredListener
in interface ILcdLayered
addLayeredListener
in interface ILcdLayerTreeNode
aListener
- the listener that from now on will be notified of all changes
to the ILcdLayered
ILcdLayered.removeLayeredListener(com.luciad.view.ILcdLayeredListener)
public void removeLayeredListener(ILcdLayeredListener aListener)
ILcdLayerTreeNode
ILcdLayeredListener
from receiving layered events for
the ILcdLayered
.
It is not possible to remove a hierarchy listener with this method. Use ILcdLayerTreeNode.removeHierarchyLayeredListener(ILcdLayeredListener)
for this purpose.
removeLayeredListener
in interface ILcdLayered
removeLayeredListener
in interface ILcdLayerTreeNode
aListener
- the listener that will no longer be notified of changes
to the ILcdLayered
ILcdLayered.addLayeredListener(ILcdLayeredListener)
public void addHierarchyLayeredListener(ILcdLayeredListener aListener)
ILcdLayerTreeNode
Registers the given ILcdLayeredListener
to receive
TLcdLayeredEvent
s from all the ILcdLayerTreeNode
s contained in the
tree with this node as root node. If the listener should only receive events for changes
occurring in this node, it should be registered as a regular listener (see ILcdLayerTreeNode.addLayeredListener(ILcdLayeredListener)
.
The source ILcdLayered
of the event can be retrieved by calling TLcdLayeredEvent.getLayered()
on the received TLcdLayeredEvent
.
addHierarchyLayeredListener
in interface ILcdLayerTreeNode
aListener
- the listenerpublic void removeHierarchyLayeredListener(ILcdLayeredListener aListener)
ILcdLayerTreeNode
Unregisters the given ILcdLayeredListener
from
receiving TLcdLayeredEvent
s for the tree with this node as root node.
removeHierarchyLayeredListener
in interface ILcdLayerTreeNode
aListener
- the listenerpublic void addHierarchyPropertyChangeListener(PropertyChangeListener aListener)
ILcdLayerTreeNode
Registers the given PropertyChangeListener
to
receive PropertyChangeEvent
s from all the ILcdLayer
s contained in the
tree with this node as root node. If the listener should only receive events for changes
occurring in this layer, it should be registered as a regular listener (see ILcdLayerTreeNode.addPropertyChangeListener(java.beans.PropertyChangeListener)
).
The source layer of the event can be retrieved by calling EventObject.getSource()
on the received PropertyChangeEvent
.
addHierarchyPropertyChangeListener
in interface ILcdLayerTreeNode
aListener
- the listenerpublic void removeHierarchyPropertyChangeListener(PropertyChangeListener aListener)
ILcdLayerTreeNode
Unregisters the given PropertyChangeListener
from
receiving PropertyChangeEvent
s for the tree with this node as root node.
removeHierarchyPropertyChangeListener
in interface ILcdLayerTreeNode
aListener
- the listenerpublic void addHierarchySelectionListener(ILcdSelectionListener aListener)
ILcdLayerTreeNode
Registers the given ILcdSelectionListener
to
receive TLcdSelectionChangedEvent
s from all the ILcdLayer
s contained
in the tree with this node as root node. If the listener should only receive events for
selection changes occurring in this layer, it should be registered as a regular listener (see
ILcdSelection.addSelectionListener(com.luciad.util.ILcdSelectionListener)
).
The source layer of the event can be retrieved by calling TLcdSelectionChangedEvent.getSelection()
on the received TLcdSelectionChangedEvent
.
addHierarchySelectionListener
in interface ILcdLayerTreeNode
aListener
- the listenerpublic void removeHierarchySelectionListener(ILcdSelectionListener aListener)
ILcdLayerTreeNode
Unregisters the given ILcdSelectionListener
from receiving TLcdSelectionChangedEvent
s for the tree with this node as root
node.
removeHierarchySelectionListener
in interface ILcdLayerTreeNode
aListener
- the listenerpublic void removeAllLayers()
ILcdLayerTreeNode
ILcdLayer
objects from this ILcdLayered
.
This method will generate a TLcdLayeredEvent
indicating a layer was removed for
every child layer.
removeAllLayers
in interface ILcdLayered
removeAllLayers
in interface ILcdLayerTreeNode
public Enumeration layersBackwards()
ILcdLayerTreeNode
Enumeration
of all ILcdLayer
objects currently in this ILcdLayered
,
starting from the top layer to the bottom layer.
This enumeration does not include this layer node, but only the child layers.
layersBackwards
in interface ILcdLayered
layersBackwards
in interface ILcdLayerTreeNode
Enumeration
of all ILcdLayer
objects currently in this ILcdLayered
,
starting from the top layer to the bottom layer.public ILcdLayer layerOf(ILcdModel aModel) throws NoSuchElementException
ILcdLayered
ILcdLayer
of this ILcdLayered
that contains the given ILcdModel
.layerOf
in interface ILcdLayered
aModel
- the model to check for in this ILcdLayered
.ILcdLayer
of this ILcdLayered
that contains the given ILcdModel
.NoSuchElementException
- if there is no layer containing the given modelpublic boolean containsLayer(ILcdLayer aLayer)
ILcdLayerTreeNode
ILcdLayered
contains the given layer.
More formally, returns true
if and only if the ILcdLayered
contains at least one layer l
such that
(aLayer==null ? l==null : aLayer.equals(l)).
Calling this method with this node as parameter will return false
, since this method only
checks the child layers and not the layer node itself.
containsLayer
in interface ILcdLayered
containsLayer
in interface ILcdLayerTreeNode
aLayer
- the layer to check whether it is in this layered.aLayer
is in this ILcdLayered
,
false otherwise.public void setPaintOnTopOfChildrenHint(boolean aPaintOnTopOfChildrenHint)
ILcdLayerTreeNode
Sets whether a node should be painted on top of its children when the node is added to a view, or beneath its child layers. Notice that this is only a hint, hence the paint order of the node and its children is not guaranteed.
This property must be set before the node is added to the view. Otherwise it will have no effect. Changing it afterwards will have no effect, unless the node is removed and re-added to the view.
The default behavior is to paint nodes underneath the child layers.
setPaintOnTopOfChildrenHint
in interface ILcdLayerTreeNode
aPaintOnTopOfChildrenHint
- true
when a node should be painted on top of its
children, false
when the node should be painted
underneath its child layersILcdLayerTreeNode.isPaintOnTopOfChildrenHint()
public boolean isPaintOnTopOfChildrenHint()
ILcdLayerTreeNode
Returns whether a node should be painted on top of its children when the node is added to a view, or beneath its child layers.
isPaintOnTopOfChildrenHint
in interface ILcdLayerTreeNode
true
when a node should be painted on top of its children,
false
when the node should be painted underneath its child layersILcdLayerTreeNode.setPaintOnTopOfChildrenHint(boolean)
public ILcdInitialLayerIndexProvider getInitialLayerIndexProvider()
ILcdLayerTreeNode
Returns the initial layer index provider, which can be used to determine the best index when a layer is added without specifying an index.
It is however up to the implementation to decide whether it uses the
ILcdInitialLayerIndexProvider
.
getInitialLayerIndexProvider
in interface ILcdLayerTreeNode
null
ILcdLayerTreeNode.setInitialLayerIndexProvider(ILcdInitialLayerIndexProvider)
public void setInitialLayerIndexProvider(ILcdInitialLayerIndexProvider aInitialLayerIndexProvider)
ILcdLayerTreeNode
Sets an initial layer index provider, which can be used to determine the best index when a layer is added without specifying an index.
setInitialLayerIndexProvider
in interface ILcdLayerTreeNode
aInitialLayerIndexProvider
- The new initial layer index provider. May be
null
ILcdLayerTreeNode.getInitialLayerIndexProvider()
public boolean isEditableSupported()
TLspLayer
true
if the layer supports editing its objects.
This implementation returns true if the layer has an editor.isEditableSupported
in interface ILcdLayer
isEditableSupported
in class TLspLayer
true
ILcdLayer.setEditable(boolean)
public boolean isSelectableSupported()
TLspLayer
true
if this layer supports selecting objects, false
otherwise.isSelectableSupported
in interface ILcdLayer
isSelectableSupported
in class TLspLayer
true
TLspLayer.setSelectableSupported(boolean)
public boolean isSelectable()
ILcdLayer
isSelectable
in interface ILcdLayer
isSelectable
in class ALspLayer
true
if the layer allows selection, false
otherwise.ILcdSelection
,
ILcdLayer.setSelectable(boolean)
public boolean isEditable()
ILcdLayer
isEditable
in interface ILcdLayer
isEditable
in class ALspLayer
true
if this ILcdLayer
is editable,
false
otherwiseILcdLayer.setEditable(boolean)
public boolean isSelected(Object aObject) throws IllegalArgumentException
ILcdSelection
Object
is currently in the set of
selected objects.isSelected
in interface ILcdSelection<Object>
isSelected
in class ALspLayer
aObject
- the Object
to be checked.true
if the Object
is in this ILcdSelection
,
false otherwise.IllegalArgumentException
public ILspLayer.LayerType getLayerType()
If this layer tree node is empty, returns EDITABLE
.
getLayerType
in interface ILspLayer
getLayerType
in class TLspLayer
EDITABLE
if empty.ILspLayer.LayerType