public class Layer
extends java.lang.Object
implements java.io.Serializable
Layer
is used to manager display elements in different Z coordinate level
on network canvas. The Element
has set/get layerID interface, if the layerID
value is equal with getID()
then this element is belonged to this layer.
Notice that every LayerModel
contains a default layer whose ID property is null,
if an element whose layerID dosen't match any layers in layer model will belong to the default layer.
LayerModel
,
Element.setLayerID(Object)
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_ALPHA |
static java.lang.String |
PROPERTY_DESCRIPTION |
static java.lang.String |
PROPERTY_ID |
static java.lang.String |
PROPERTY_MOVABLE |
static java.lang.String |
PROPERTY_NAME |
static java.lang.String |
PROPERTY_RESIZABLE |
static java.lang.String |
PROPERTY_SELECTABLE |
static java.lang.String |
PROPERTY_VISIBLE |
Constructor and Description |
---|
Layer()
Creates a layer instance with id created by identifier factory.
|
Layer(java.lang.Object id)
Creates a layer instance with a specified id.
|
Layer(java.lang.Object id,
java.lang.String name)
Creates a layer instance with a specified id and name.
|
Layer(java.lang.Object id,
java.lang.String name,
java.lang.String description,
boolean visible)
Creates a layer instance with a specified id, name, description.
|
Modifier and Type | Method and Description |
---|---|
void |
exportValues(Layer otherLayer)
Exports this layer's properties to other given layer.
|
float |
getAlpha()
Gets the alpha transparent value of this layer.
|
java.util.Map |
getClientProperties()
Retrieve all client properties on the layer.
|
java.lang.Object |
getClientProperty(java.lang.Object key)
Get the client property value via the given key value.
|
java.lang.String |
getDescription()
Gets the description of this layer.
|
java.lang.Object |
getID()
Gets the id of this layer.
|
java.lang.String |
getName()
Gets the name of this layer.
|
java.beans.PropertyChangeSupport |
getPropertyChangeSupport()
Get property change support object.
|
boolean |
isMovable()
Checks whether the elements belonged to this layer is movable.
|
boolean |
isResizable()
Checks whether the elements belonged to this layer is resizable.
|
boolean |
isSelectable()
Checks whether the elements belonged to this layer is selectable.
|
boolean |
isVisible()
Checks whether this layer is visible.
|
void |
putClientProperty(java.lang.Object key,
java.lang.Object value)
Set the client property for the layer.
|
void |
setAlpha(float alpha)
Sets the alpha transparent value of this layer.
|
void |
setDescription(java.lang.String description)
Sets the description of this layer.
|
void |
setMovable(boolean movable)
Sets whether the elements belonged to this layer is movable.
|
void |
setName(java.lang.String name)
Sets the name of this layer.
|
void |
setResizable(boolean resizable)
Sets whether the elements belonged to this layer is resizable.
|
void |
setSelectable(boolean selectable)
Sets whether the elements belonged to this layer is selectable.
|
void |
setVisible(boolean visible)
Sets whether this layer is visible.
|
java.lang.String |
toString()
Reutrns the name of this layer.
|
public static final java.lang.String PROPERTY_ID
public static final java.lang.String PROPERTY_NAME
public static final java.lang.String PROPERTY_DESCRIPTION
public static final java.lang.String PROPERTY_VISIBLE
public static final java.lang.String PROPERTY_SELECTABLE
public static final java.lang.String PROPERTY_MOVABLE
public static final java.lang.String PROPERTY_RESIZABLE
public static final java.lang.String PROPERTY_ALPHA
public Layer()
TWaverUtil.getIdentifierFactory().
public Layer(java.lang.Object id)
id
- the identifier of this layer.public Layer(java.lang.Object id, java.lang.String name)
id
- the identifier of this layer.name
- the name of this layer.public Layer(java.lang.Object id, java.lang.String name, java.lang.String description, boolean visible)
id
- the identifier of this layer.name
- the name of this layer.description
- the description of this layer.visible
- the visibility of this layer.public void exportValues(Layer otherLayer)
otherLayer
- the other layer to be export.public java.beans.PropertyChangeSupport getPropertyChangeSupport()
public java.lang.Object getClientProperty(java.lang.Object key)
key
- Object the client property key.public void putClientProperty(java.lang.Object key, java.lang.Object value)
key
- Object the new property key.value
- Object the new property value.public java.util.Map getClientProperties()
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the new name of this layer.public boolean isVisible()
public void setVisible(boolean visible)
visible
- True if elements belonged to this layer is visible, false otherwise.public java.lang.Object getID()
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- the description of this layer.public float getAlpha()
public void setAlpha(float alpha)
alpha
- this value must between 0.0f and 1.0f.public boolean isMovable()
public void setMovable(boolean movable)
movable
- True if the elements belonged to this layer is movable. false otherwise.public boolean isSelectable()
public void setSelectable(boolean selectable)
movable
- True if the elements belonged to this layer is selectable. false otherwise.public boolean isResizable()
public void setResizable(boolean resizable)
movable
- True if the elements belonged to this layer is resizable. false otherwise.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.