public class IlvMapStyle extends Object implements IlvPersistentObject, IlvInheritable
IlvMapGraphic
graphic objects.
A single instance of IlvMapStyle
can be
shared by a collection of IlvMapGraphic
that can read their graphic (or other) attributes
from the style.Modifier and Type | Field and Description |
---|---|
static String |
ALPHA
The Alpha attribute name.
|
static String |
ALWAYS_ON_TOP
The AlwaysOnTop attribute name.
|
static String |
ATTRIBUTE_INFO
The AttributeInfo attribute name.
|
static String |
CATEGORY
The Category attribute name.
|
static String |
LABEL_ATTRIBUTE
The LabelAttribute attribute name.
|
static String |
LEGEND_GROUP
The LegendGroup attribute name.
|
static String |
PARENT
The Parent style.
|
static String |
THIN_CLIENT_BACKGROUND
The ThinClientBackground attribute name.
|
static String |
VISIBLE_IN_3DVIEW
The VisibleIn3DView attribute name.
|
static String |
VISIBLE_IN_OVERVIEW
The VisibleInOverview attribute name.
|
static String |
VISIBLE_IN_TREE
The VisibleInTree attribute name.
|
static String |
VISIBLE_IN_VIEW
The VisibleInView attribute name.
|
Constructor and Description |
---|
IlvMapStyle()
Constructs a
IlvMapStyle . |
IlvMapStyle(IlvInputStream stream)
Reads an
IlvMapStyle from an IlvInputStream . |
IlvMapStyle(IlvMapStyle source)
Creates a
IlvMapStyle by copying an existing one. |
Modifier and Type | Method and Description |
---|---|
void |
addAttributeListener(String name,
StyleListener listener)
Adds an attribute listener.
|
void |
addChild(IlvMapStyle style)
Deprecated.
Since JViews 8.1 This method no longer sets the parent of the style and will become private. Use
setParent(IlvMapStyle) instead |
void |
addStyleListener(StyleListener listener)
Add a listener on the style.
|
void |
addWeakStyleListener(StyleListener listener)
Add a weakly referenced listener on the style.
|
IlvMapStyle |
copy()
Return a copy of the style.
|
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one.
|
float |
getAlpha()
Retrieves the Alpha property value.
|
Object |
getAttribute(String name)
Retrieve the value of the attribute passed as argument.
|
protected Object |
getAttribute(String name,
boolean useDefault)
Retrieves the value for the attribute name.
|
IlvMapAttributeFilter |
getAttributeFilter()
Returns the
IlvMapAttributeFilter object set on this style. |
IlvAttributeInfoProperty |
getAttributeInfo()
Retrieves the AttributeInfo property value.
|
StyleListener[] |
getAttributeListeners(String name)
Retrieves the attribute listeners registered for the specified property.
|
String |
getCategory()
Retrieves the Category property value.
|
IlvMapStyle[] |
getChildren()
Retrieves an array containing the children of the style.
|
protected HashMap<String,Object> |
getDefaultValues()
Returns a
HashMap containing default attribute values. |
IlvGraphic |
getGraphic()
Returns an
IlvGraphic object previously set by a call to
setGraphic . |
String |
getLabelAttribute()
Retrieves the LabelAttribute property value.
|
String |
getLegendGroup()
Retrieves the LegendGroup property value.
|
protected WeakHashMap<StyleListener,Object> |
getListeners()
Returns the WeakHashMap of
StyleListener registered for this style. |
IlvMapStyle |
getParent()
Retrieves the parent for this style or
null if no parent has been set. |
Iterator<StyleListener> |
getStyleListeners()
Retrieves the
StyleListener registered for this style. |
int |
hashCode() |
boolean |
isAlwaysOnTop()
Retrieves the AlwaysOnTop property value.
|
boolean |
isInherited(String propertyName)
Retrieves the inherited state of the property.
|
boolean |
isThinClientBackground()
Retrieves the ThinClientBackground property value.
|
boolean |
isVisibleIn3DView()
Retrieves the VisibleIn3DView property value.
|
boolean |
isVisibleInOverview()
Retrieves the VisibleInOverview property value.
|
boolean |
isVisibleInTree()
Indicates whether or not the layer should be visible in the layer tree.
|
boolean |
isVisibleInView()
Retrieves the VisibleInView property value.
|
protected boolean |
objectEquals(Object o1,
Object o2)
Checks if the given objects are equal.
|
void |
removeAttributeListener(String name,
StyleListener listener)
Removes the listener that was registered to listen to an attribute name.
|
void |
removeChild(IlvMapStyle style)
Deprecated.
Since JViews 8.1 This method no longer sets the parent of the style to null and will become private. Use
setParent(IlvMapStyle) with a null parameter instead |
void |
removeStyleListener(StyleListener listener)
Removes the listener.
|
void |
setAlpha(float alpha)
Set the Alpha property value.
|
void |
setAlwaysOnTop(boolean v)
Set the AlwaysOnTop property value.
|
void |
setAttribute(String name,
Object o)
Sets the value for the attribute whose name is name
|
void |
setAttributeFilter(IlvMapAttributeFilter filter)
Sets an
IlvMapAttributeFilter for this style. |
void |
setAttributeInfo(IlvAttributeInfoProperty p)
Set the AttributeInfo property value.
|
void |
setCategory(String d)
Set the Category property value.
|
void |
setGraphic(IlvGraphic g)
Sets an
IlvGraphic object on the style. |
void |
setInherited(String propertyName,
boolean inherited)
Set the inherited state for this property.
|
void |
setLabelAttribute(String labelAttribute)
Set the LabelAttribute property value.
|
void |
setLegendGroup(String d)
Set the LegendGroup property value.
|
void |
setParent(IlvMapStyle p)
Sets the parent for this style.
|
void |
setThinClientBackground(boolean v)
Set the ThinClientBackground property value.
|
void |
setVisibleIn3DView(boolean v)
Set the VisibleIn3DView property value.
|
void |
setVisibleInOverview(boolean v)
Set the VisibleInOverview property value.
|
void |
setVisibleInTree(boolean b)
Determines whether or not the layer should be visible in the layer tree.
|
void |
setVisibleInView(boolean v)
Set the VisibleInView property value.
|
void |
write(IlvOutputStream stream)
Write a
IlvMapStyle on a IlvOutputStream |
public static final String LEGEND_GROUP
public static final String CATEGORY
public static final String PARENT
public static final String ALWAYS_ON_TOP
public static final String LABEL_ATTRIBUTE
public static final String ATTRIBUTE_INFO
public static final String ALPHA
public static final String VISIBLE_IN_OVERVIEW
public static final String VISIBLE_IN_VIEW
public static final String VISIBLE_IN_3DVIEW
public static final String VISIBLE_IN_TREE
public static final String THIN_CLIENT_BACKGROUND
public IlvMapStyle()
IlvMapStyle
.public IlvMapStyle(IlvInputStream stream) throws IlvReadFileException
IlvMapStyle
from an IlvInputStream
.stream
- The stream to read from.IlvReadFileException
public IlvMapStyle(IlvMapStyle source)
IlvMapStyle
by copying an existing one.source
- The style to copy.public void write(IlvOutputStream stream) throws IOException
IlvMapStyle
on a IlvOutputStream
write
in interface IlvPersistentObject
stream
- The stream to write to.IOException
public IlvMapStyle copy()
protected HashMap<String,Object> getDefaultValues()
HashMap
containing default attribute values.HashMap
containing default attribute values.protected WeakHashMap<StyleListener,Object> getListeners()
StyleListener
registered for this style.StyleListener
registered for this style or
null
if no listener has been registered for this style.protected final boolean objectEquals(Object o1, Object o2)
o1
- The first object to check.o2
- The second object to check.true
if the objects a equal or both null
.public boolean equals(Object o)
equals
in class Object
Object.equals(java.lang.Object)
public void addAttributeListener(String name, StyleListener listener)
name
- The name of the attribute to listen to.listener
- The listener to call.public void removeAttributeListener(String name, StyleListener listener)
name
- The name of the attribute.listener
- The listener to remove.public StyleListener[] getAttributeListeners(String name)
name
- The name of the property for which the listeners have to be retrieved.public void addStyleListener(StyleListener listener)
IlvMapAttributeFilter
, that class may not fire any StyleEvent
when it needs to update the graphic attributes. You should not use style listeners on the filtered attributes.listener
- The listener to register.public void addWeakStyleListener(StyleListener listener)
listener
- The listener to register.public void removeStyleListener(StyleListener listener)
listener
- The listener to remove.public Iterator<StyleListener> getStyleListeners()
StyleListener
registered for this style.StyleListener
registered for this style.protected Object getAttribute(String name, boolean useDefault)
name
- The name of the attribute from which to retrieve the value.useDefault
- If set to true
and if the attribute
has no value, return an eventual default value.setAttribute
..
public Object getAttribute(String name)
name
- The name of the attribute.public void setAttribute(String name, Object o)
name
- The name of the attribute.o
- The value for this attribute.public void setAttributeInfo(IlvAttributeInfoProperty p)
p
- The value of the AttributeInfo property.public IlvAttributeInfoProperty getAttributeInfo()
null
if no value as been
previously set.public void setLabelAttribute(String labelAttribute)
labelAttribute
- The value of the LabelAttribute property.public String getLabelAttribute()
null
if no value as been
previously set.public void setAlpha(float alpha)
alpha
- The value of the Alpha property.public float getAlpha()
1
if no value as been
previously set.public void setVisibleInView(boolean v)
v
- The value of the VisibleInView property.public boolean isVisibleInView()
true
if no value as been
previously set.public void setVisibleIn3DView(boolean v)
v
- The value of the VisibleIn3DView property.public boolean isVisibleIn3DView()
false
if no value as been
previously set.public void setVisibleInOverview(boolean v)
v
- The value of the VisibleInOverview property.public boolean isVisibleInOverview()
false
if no value as been
previously set.public boolean isAlwaysOnTop()
false
if no value as been
previously set.public void setAlwaysOnTop(boolean v)
v
- The value of the AlwaysOnTop property.public void setVisibleInTree(boolean b)
b
- true if the layer should be visible in the layer tree.public boolean isVisibleInTree()
public String getCategory()
null
if no value as been
previously set.public void setCategory(String d)
d
- The value of the Category property.public String getLegendGroup()
null
if no value as been
previously set.public void setLegendGroup(String d)
d
- The value of the Category property.public void setParent(IlvMapStyle p)
p
- The style of the parent.@Deprecated public void addChild(IlvMapStyle style)
setParent(IlvMapStyle)
insteadstyle
- A new child to be added to this style.@Deprecated public void removeChild(IlvMapStyle style)
setParent(IlvMapStyle)
with a null parameter insteadstyle
- A child to be removed from this style.public IlvMapStyle getParent()
null
if no parent has been set.public IlvMapStyle[] getChildren()
public void setInherited(String propertyName, boolean inherited)
setInherited
in interface IlvInheritable
propertyName
- The name of the property to markinherited
- true
if the property will be inherited, false
otherwise.public boolean isInherited(String propertyName)
isInherited
in interface IlvInheritable
propertyName
- The name of the property to check.true
if the property is marked as inherited, false
otherwise.public boolean isThinClientBackground()
false
if no value as been
previously set.public void setThinClientBackground(boolean v)
v
- The value of the ThinClientBackground property.public void setAttributeFilter(IlvMapAttributeFilter filter)
IlvMapAttributeFilter
for this style.filter
- The IlvMapAttributeFilter
.IlvMapAttributeFilter
, that class may not fire any StyleEvent
when it needs to update the graphic attributes.
You should not use style listeners on the filtered attributes.IlvMapAttributeFilter
public IlvMapAttributeFilter getAttributeFilter()
IlvMapAttributeFilter
object set on this style.IlvMapAttributeFilter
object set on this style or
null
if no attribute filter has been set.public void setGraphic(IlvGraphic g)
IlvGraphic
object on the style.
This method is called in preparation for a call to the get
method of an attribute filter.g
- The IlvGraphic
to set.public IlvGraphic getGraphic()
IlvGraphic
object previously set by a call to
setGraphic
.IlvGraphic
previously set.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.