ilog.views.maps.graphic.style
Class IlvMapStyle

java.lang.Object
  extended by ilog.views.maps.graphic.style.IlvMapStyle
All Implemented Interfaces:
IlvPersistentObject, IlvInheritable
Direct Known Subclasses:
IlvGeneralPathStyle, IlvGridStyle, IlvMapCompositeStyle, IlvMapLabelStyle, IlvMapTextStyle, IlvPointStyle, IlvPolylineStyle, IlvRasterStyle

public class IlvMapStyle
extends Object
implements IlvPersistentObject, IlvInheritable

A base class for the style intended to be used with 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.

Since:
JViews 7.5

Field Summary
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 Summary
IlvMapStyle()
          Constructs a IlvMapStyle.
IlvMapStyle(IlvInputStream stream)
          Reads an IlvMapStyle from an IlvInputStream.
IlvMapStyle(IlvMapStyle source)
          Creates a IlvMapStyle by copying an existing one.
 
Method Summary
 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 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 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 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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEGEND_GROUP

public static final String LEGEND_GROUP
The LegendGroup attribute name.

See Also:
Constant Field Values

CATEGORY

public static final String CATEGORY
The Category attribute name.

See Also:
Constant Field Values

PARENT

public static final String PARENT
The Parent style.

See Also:
Constant Field Values

ALWAYS_ON_TOP

public static final String ALWAYS_ON_TOP
The AlwaysOnTop attribute name.

See Also:
Constant Field Values

LABEL_ATTRIBUTE

public static final String LABEL_ATTRIBUTE
The LabelAttribute attribute name.

See Also:
Constant Field Values

ATTRIBUTE_INFO

public static final String ATTRIBUTE_INFO
The AttributeInfo attribute name.

See Also:
Constant Field Values

ALPHA

public static final String ALPHA
The Alpha attribute name.

See Also:
Constant Field Values

VISIBLE_IN_OVERVIEW

public static final String VISIBLE_IN_OVERVIEW
The VisibleInOverview attribute name.

See Also:
Constant Field Values

VISIBLE_IN_VIEW

public static final String VISIBLE_IN_VIEW
The VisibleInView attribute name.

See Also:
Constant Field Values

VISIBLE_IN_3DVIEW

public static final String VISIBLE_IN_3DVIEW
The VisibleIn3DView attribute name.

Since:
JViews 7.5
See Also:
Constant Field Values

VISIBLE_IN_TREE

public static final String VISIBLE_IN_TREE
The VisibleInTree attribute name.

Since:
JViews 7.5
See Also:
Constant Field Values

THIN_CLIENT_BACKGROUND

public static final String THIN_CLIENT_BACKGROUND
The ThinClientBackground attribute name.

Since:
JViews 8.0
See Also:
Constant Field Values
Constructor Detail

IlvMapStyle

public IlvMapStyle()
Constructs a IlvMapStyle.


IlvMapStyle

public IlvMapStyle(IlvInputStream stream)
            throws IlvReadFileException
Reads an IlvMapStyle from an IlvInputStream.

Parameters:
stream - The stream to read from.
Throws:
IlvReadFileException

IlvMapStyle

public IlvMapStyle(IlvMapStyle source)
Creates a IlvMapStyle by copying an existing one.

Parameters:
source - The style to copy.
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Write a IlvMapStyle on a IlvOutputStream

Specified by:
write in interface IlvPersistentObject
Parameters:
stream - The stream to write to.
Throws:
IOException

copy

public IlvMapStyle copy()
Return a copy of the style.

Returns:
A copy of the style.

getDefaultValues

protected HashMap getDefaultValues()
Returns a HashMap containing default attribute values.

Returns:
The HashMap containing default attribute values.

getListeners

protected WeakHashMap getListeners()
Returns the WeakHashMap of StyleListener registered for this style.

Returns:
The set of StyleListener registered for this style or null if no listener has been registered for this style.

objectEquals

protected final boolean objectEquals(Object o1,
                                     Object o2)
Checks if the given objects are equal.

Parameters:
o1 - The first object to check.
o2 - The second object to check.
Returns:
true if the objects a equal or both null.

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

addAttributeListener

public void addAttributeListener(String name,
                                 StyleListener listener)
Adds an attribute listener. The listener will be notified when the attribute of the name name changes.

Parameters:
name - The name of the attribute to listen to.
listener - The listener to call.

removeAttributeListener

public void removeAttributeListener(String name,
                                    StyleListener listener)
Removes the listener that was registered to listen to an attribute name.

Parameters:
name - The name of the attribute.
listener - The listener to remove.

getAttributeListeners

public StyleListener[] getAttributeListeners(String name)
Retrieves the attribute listeners registered for the specified property.

Parameters:
name - The name of the property for which the listeners have to be retrieved.
Returns:
An array containing the listeners registered for this property.

addStyleListener

public void addStyleListener(StyleListener listener)
Add a listener on the style. The listener will be notified when any of the attributes of the style change.

Parameters:
listener - The listener to register.

addWeakStyleListener

public void addWeakStyleListener(StyleListener listener)
Add a weakly referenced listener on the style. The listener will be notified when any of the attributes of the style change. If the listener passed is not strongly referenced from another object, it might be removed at any time following garbage collection.

Parameters:
listener - The listener to register.
Since:
JViews 8.1

removeStyleListener

public void removeStyleListener(StyleListener listener)
Removes the listener.

Parameters:
listener - The listener to remove.

getStyleListeners

public Iterator getStyleListeners()
Retrieves the StyleListener registered for this style.

Returns:
An array containing the StyleListener registered for this style.

getAttribute

protected Object getAttribute(String name,
                              boolean useDefault)
Retrieves the value for the attribute name.

Parameters:
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.
Returns:
The value for the attribute as set by setAttribute.
See Also:
.

getAttribute

public Object getAttribute(String name)
Retrieve the value of the attribute passed as argument.

Parameters:
name - The name of the attribute.
Returns:
The value of the attribute.

setAttribute

public void setAttribute(String name,
                         Object o)
Sets the value for the attribute whose name is name

Parameters:
name - The name of the attribute.
o - The value for this attribute.

setAttributeInfo

public void setAttributeInfo(IlvAttributeInfoProperty p)
Set the AttributeInfo property value.

Parameters:
p - The value of the AttributeInfo property.

getAttributeInfo

public IlvAttributeInfoProperty getAttributeInfo()
Retrieves the AttributeInfo property value.

Returns:
The AttributeInfo property value or null if no value as been previously set.

setLabelAttribute

public void setLabelAttribute(String labelAttribute)
Set the LabelAttribute property value.

Parameters:
labelAttribute - The value of the LabelAttribute property.

getLabelAttribute

public String getLabelAttribute()
Retrieves the LabelAttribute property value.

Returns:
The LabelAttribute property value or null if no value as been previously set.

setAlpha

public void setAlpha(float alpha)
Set the Alpha property value.

Parameters:
alpha - The value of the Alpha property.

getAlpha

public float getAlpha()
Retrieves the Alpha property value.

Returns:
The Alpha property value or 1 if no value as been previously set.

setVisibleInView

public void setVisibleInView(boolean v)
Set the VisibleInView property value.

Parameters:
v - The value of the VisibleInView property.

isVisibleInView

public boolean isVisibleInView()
Retrieves the VisibleInView property value.

Returns:
The VisibleInView property value or true if no value as been previously set.

setVisibleIn3DView

public void setVisibleIn3DView(boolean v)
Set the VisibleIn3DView property value.

Parameters:
v - The value of the VisibleIn3DView property.
Since:
JViews 7.5

isVisibleIn3DView

public boolean isVisibleIn3DView()
Retrieves the VisibleIn3DView property value.

Returns:
The VisibleIn3DView property value or false if no value as been previously set.
Since:
JViews 7.5

setVisibleInOverview

public void setVisibleInOverview(boolean v)
Set the VisibleInOverview property value.

Parameters:
v - The value of the VisibleInOverview property.

isVisibleInOverview

public boolean isVisibleInOverview()
Retrieves the VisibleInOverview property value.

Returns:
The VisibleInOverview property value or false if no value as been previously set.

isAlwaysOnTop

public boolean isAlwaysOnTop()
Retrieves the AlwaysOnTop property value.

Returns:
The AlwaysOnTop property value or false if no value as been previously set.

setAlwaysOnTop

public void setAlwaysOnTop(boolean v)
Set the AlwaysOnTop property value.

Parameters:
v - The value of the AlwaysOnTop property.

setVisibleInTree

public void setVisibleInTree(boolean b)
Determines whether or not the layer should be visible in the layer tree.

Parameters:
b - true if the layer should be visible in the layer tree.
Since:
JViews 7.5

isVisibleInTree

public boolean isVisibleInTree()
Indicates whether or not the layer should be visible in the layer tree.

Returns:
true if the layer should be visible in the layer tree.
Since:
JViews 7.5

getCategory

public String getCategory()
Retrieves the Category property value.

Returns:
The Category property value or null if no value as been previously set.

setCategory

public void setCategory(String d)
Set the Category property value.

Parameters:
d - The value of the Category property.

getLegendGroup

public String getLegendGroup()
Retrieves the LegendGroup property value.

Returns:
The LegendGroup property value or null if no value as been previously set.

setLegendGroup

public void setLegendGroup(String d)
Set the LegendGroup property value.

Parameters:
d - The value of the Category property.

setParent

public void setParent(IlvMapStyle p)
Sets the parent for this style.

Parameters:
p - The style of the parent.

addChild

public 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

Add a child to this style

Parameters:
style - A new child to be added to this style.

removeChild

public 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

Removes a child from this style.

Parameters:
style - A child to be removed from this style.

getParent

public IlvMapStyle getParent()
Retrieves the parent for this style or null if no parent has been set.

Returns:
The parent of this style.

getChildren

public IlvMapStyle[] getChildren()
Retrieves an array containing the children of the style.

Returns:
A (possibly empty) array of children of this style.

setInherited

public void setInherited(String propertyName,
                         boolean inherited)
Set the inherited state for this property. If a property is inherited, the value will be fetched on the parent if any.

Specified by:
setInherited in interface IlvInheritable
Parameters:
propertyName - The name of the property to mark
inherited - true if the property will be inherited, false otherwise.

isInherited

public boolean isInherited(String propertyName)
Retrieves the inherited state of the property.

Specified by:
isInherited in interface IlvInheritable
Parameters:
propertyName - The name of the property to check.
Returns:
true if the property is marked as inherited, false otherwise.

isThinClientBackground

public boolean isThinClientBackground()
Retrieves the ThinClientBackground property value.

Returns:
The ThinClientBackground property value or false if no value as been previously set.
Since:
JViews 8.0

setThinClientBackground

public void setThinClientBackground(boolean v)
Set the ThinClientBackground property value.

Parameters:
v - The value of the ThinClientBackground property.
Since:
JViews 8.0

setAttributeFilter

public void setAttributeFilter(IlvMapAttributeFilter filter)
Sets an IlvMapAttributeFilter for this style.

Parameters:
filter - The IlvMapAttributeFilter.
Since:
JViews 8.1
See Also:
IlvMapAttributeFilter

getAttributeFilter

public IlvMapAttributeFilter getAttributeFilter()
Returns the IlvMapAttributeFilter object set on this style.

Returns:
The IlvMapAttributeFilter object set on this style or null if no attribute filter has been set.
Since:
JViews 8.1

setGraphic

public void setGraphic(IlvGraphic g)
Sets an IlvGraphic object on the style. This method is called in preparation for a call to the get method of an attribute filter.

Parameters:
g - The IlvGraphic to set.
Since:
JViews 8.1

getGraphic

public IlvGraphic getGraphic()
Returns an IlvGraphic object previously set by a call to setGraphic.

Returns:
The IlvGraphic previously set.
Since:
JViews 8.1


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.