| Package | com.afcomponents.umap.styles |
| Class | public class Style |
| Subclasses | BitmapStyle, DropShadowStyle, GeometryStyle, GradientStyle, GroupStyle, IconStyle, StrokeStyle, TextStyle |
You should never create instance of the Style class directly.
Instead please create a subclass, define static public constant ENUM_PARAMS as an Array
holding all the tunable variable names. You constructor should accept a parameters Object
which holds the parameters that need to be modified. Simply pass this Object to a superclass.
MyStyle class, which subclasses Style.
package
{
import com.afcomponents.umap.styles.Style;
public class MyStyle extends Style
{
// constant that holds all tuneable parameter names
static public const ENUM_PARAMS:Array = ['a', 'b', 'c'];
// parameters & default values
public var a:String = "myString";
public var b:Number = 1.2345;
public var c:Boolean = true;
// class constructor
public function MyStyle (param:Object = null)
{
super(param);
}
}
}
var style:MyStyle = new MyStyle(); // all default parameters
trace(style);
style = null;
style = new MyStyle({a:"anotherString", b:0, c:false});
trace(style);
MyStyle {a: 'myString', b: 1.2345, c: true}
MyStyle {a: 'anotherString', b: 0, c: false}| Method | Defined by | ||
|---|---|---|---|
|
Style(param:Object = null)
Style constructor.
| Style | ||
|
Creates a copy of the
Style object. | Style | ||
|
Creates a clone of this
Style,
copies the properties from specified object and returns the new style. | Style | ||
|
copy(object:Object):void
Copies all the properties from the specified object into the
Style object. | Style | ||
|
copyStyle(dest:Object, src:Object):void
[static]
Copies all properties of one object into another.
| Style | ||
|
getStyleFromXML(xml:XML):Style
[static]
Returns new
Style object, from the source XML object. | Style | ||
|
getXMLFromStyle(style:Style, name:String = ""):XML
[static]
Returns an
XML object that represents all the style's properties. | Style | ||
|
toString():String
Returns a
String that represents all the style's properties. | Style | ||
|
toXML(afcTags:Boolean = false):XML
Abstract function.
| Style | ||
| Style | () | constructor |
public function Style(param:Object = null)
Style constructor.
Creates new Style object with the default parameters.
Properties defined in param object will override the default values.
You should never create an instance of this Class directly, instead use subclassing.
Don't forget to define public static constant ENUM_PARAMS as an Array where you should list
all the tuneable properties.
param:Object (default = null) — Object that holds all the properites of a style you wish to override upon its creation.
|
— Direct instantiation not allowed.
|
|
— com.afcomponents.umap.styles::Style.ENUM_PARAMS hasn't been defined.
|
| clone | () | method |
public function clone():Style
Creates a copy of the Style object.
Style —
A copy of this object.
|
| concat | () | method |
public function concat(param:Object):Style
Creates a clone of this Style,
copies the properties from specified object and returns the new style.
param:Object — Object that defines all the properties you wish to copy.
|
Style —
A cloned style concatennated with specified object.
|
| copy | () | method |
public function copy(object:Object):void
Copies all the properties from the specified object into the Style object.
object:Object — Object that defines all the properties you wish to copy.
|
| copyStyle | () | method |
public static function copyStyle(dest:Object, src:Object):voidCopies all properties of one object into another.
Parametersdest:Object — Destination object
|
|
src:Object — Source object
|
| getStyleFromXML | () | method |
public static function getStyleFromXML(xml:XML):Style
Returns new Style object, from the source XML object.
xml:XML — Source XML object.
|
Style —
Style object which will be created from the source XML object.
|
| getXMLFromStyle | () | method |
public static function getXMLFromStyle(style:Style, name:String = ""):XML
Returns an XML object that represents all the style's properties.
style:Style — Destination object
|
|
name:String (default = "") |
XML — Style's properties structured as an XML object.
|
| toString | () | method |
public function toString():String
Returns a String that represents all the style's properties.
The output will look like "Style Class Name {property1:value, property2:value, ...}"
ReturnsString — A textual representation of this Style object.
|
| toXML | () | method |
public function toXML(afcTags:Boolean = false):XMLAbstract function. Override to return XML data in KML 2.1 format.
ParametersafcTags:Boolean (default = false) — Flag that determines whether to generate KML data with extended AFC tags.
|
XML — XML object in KML 2.1 format, or null if KML export for the style is unsupported.
|