public interface ILcdLayer extends ILcdSelection<Object>, Serializable, ILcdPropertyChangeSource
ILcdView
of the objects
in an ILcdModel
. Extensions of this interface
will contain additional information how to represent (render) or edit
elements of an ILcdModel
in "specialized" ILcdView
interfaces (for example, in a 2D or 3D view).
A layer has the following properties that can be changed:
visible
in the viewselected
edited
ILcdView
, and unselected in another.
The layer allows to subscribe
for changes in these properties.
A layer can also be queried for selected elements
.
The selection can be changed by calling selectObject(java.lang.Object, boolean, int)
, provided that the layer
supports
it.
Modifier and Type | Method and Description |
---|---|
void |
clearSelection(int aDispatchEventMode)
Deselect all the Objects in this
ILcdLayer , i.e., the selection of
this ILcdLayer is empty afterward. |
void |
fireCollectedSelectionChanges()
Fires a
TLcdSelectionChangedEvent that contains all the
selection changes appended by successively calling
selectObject(Object, boolean, ILcdFireEventMode.FIRE_LATER) . |
ILcdIcon |
getIcon()
Returns a visual indication of the contents of this layer.
|
String |
getLabel()
A short textual representation of this
ILcdLayer . |
ILcdModel |
getModel() |
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 |
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 |
isVisible()
Returns whether or not the layer's content is painted.
|
void |
selectObject(Object aObject,
boolean aSelection,
int aDispatchEventMode)
Changes the selection state of any element contained in the
ILcdModel this ILcdLayer refers to. |
void |
setEditable(boolean aEditable)
Sets whether the layer should allow editing the content that it visualizes.
|
void |
setIcon(ILcdIcon aIcon)
Sets a visual indication of the contents of this layer.
|
void |
setLabel(String aLabel)
Sets the textual representation of this
ILcdLayer . |
void |
setSelectable(boolean aSelectable)
Sets the Selectable property of this
ILcdLayer . |
void |
setVisible(boolean aVisible)
Sets whether or not the layer's content is painted.
|
addSelectionListener, getSelectedObjects, getSelectionCount, isSelected, removeSelectionListener, selectedObjects
addPropertyChangeListener, removePropertyChangeListener
ILcdModel getModel()
ILcdModel
associated to this ILcdLayer
boolean isVisible()
true
if the layer is visible, false
otherwise.setVisible(boolean)
void setVisible(boolean aVisible)
aVisible
- true
if the layer should be visible, false
otherwise.isVisible()
boolean isSelectableSupported()
true
if this layer supports selecting objects, false
otherwise.true
if this ILcdLayer
supports the
selectable property, false
otherwise. I.e. if this
ILcdLayer
can be put or not in a selectable mode.setSelectable(boolean)
,
selectObject(java.lang.Object, boolean, int)
boolean isSelectable()
true
if the layer allows selection, false
otherwise.ILcdSelection
,
setSelectable(boolean)
void setSelectable(boolean aSelectable)
ILcdLayer
.
Check isSelectableSupported
to see if the layer supports selection.aSelectable
- true
if the layer allows selection, false
otherwise.isSelectable()
,
isSelectableSupported()
boolean isEditableSupported()
true
if the layer supports editing its objects.true
if the layer supports editing, false
otherwise.setEditable(boolean)
boolean isEditable()
true
if this ILcdLayer
is editable,
false
otherwisesetEditable(boolean)
void setEditable(boolean aEditable)
isEditableSupported
to see if the layer supports editing.aEditable
- true if the layer content can be editedisEditableSupported()
,
isEditable()
void selectObject(Object aObject, boolean aSelection, int aDispatchEventMode)
ILcdModel
this ILcdLayer
refers to. This method
shall have an effect only if isSelectableSupported and isSelectable return
true.aObject
- the Object
to select or deselect. The object should be in the model
of this layer. The implementation of this method is not responsible for checking this.aSelection
- the selection state, true
to select, false
to deselect.aDispatchEventMode
- shall be one among ILcdFireEventMode.FIRE_NOW
,
ILcdFireEventMode.FIRE_LATER
, ILcdFireEventMode.NO_EVENT
ILcdFireEventMode
void fireCollectedSelectionChanges()
TLcdSelectionChangedEvent
that contains all the
selection changes appended by successively calling
selectObject(Object, boolean, ILcdFireEventMode.FIRE_LATER)
.void clearSelection(int aDispatchEventMode)
ILcdLayer
, i.e., the selection of
this ILcdLayer
is empty afterward.aDispatchEventMode
- shall be one among ILcdFireEventMode.FIRE_NOW
,
ILcdFireEventMode.FIRE_LATER
, ILcdFireEventMode.NO_EVENT
ILcdFireEventMode
String getLabel()
ILcdLayer
.ILcdLayer
void setLabel(String aLabel)
ILcdLayer
.aLabel
- the the textual representation to use for this ILcdLayer
.ILcdIcon getIcon()