Packagenet.systemeD.halcyon.styleparser
Classpublic class Style
SubclassesInstructionStyle, PointStyle, ShapeStyle, ShieldStyle, TextStyle

A Style is a set of graphic properties (e.g. stroke colour and width, casing colour and width, font and text size), typically derived from a MapCSS descriptor. This is the base class for particular style groupings such as ShapeStyle and PointStyle.

See also

net.systemeD.halcyon.styleparser.StyleList
net.systemeD.halcyon.styleparser.StyleChooser


Public Properties
 PropertyDefined by
  drawn : Boolean
[read-only] Does this style require anything to be drawn? (To be overridden.)
Style
  edited : Boolean = false
Is the style active (properties have been set)?
Style
  evals : Object
Compiled SWFs for each eval.
Style
  interactive : Boolean = true
Does this style permit mouse interaction? (Some styling, such as P2's back-level yellow highlight for selected ways, should not respond to mouse events.)
Style
  merged : Boolean = false
Has this style had another style merged into it? (When styles cascade, then we need to merge the first style with any subsequent styles that apply.)
Style
  properties : Array
[read-only] Properties getter, to be overridden.
Style
  sublayer : Number = 5
The sublayer is the z-index property _within_ an OSM layer.
Style
Public Methods
 MethodDefined by
  
Make an exact copy of an object.
Style
  
hasEvals():Boolean
Are there any eval functions defined?
Style
  
mergeWith(additional:Style):void
Merge two Style objects.
Style
  
runEvals(tags:Object):void
Run all evals for this Style over the supplied tags.
Style
  
setPropertyFromString(k:String, v:*):Boolean
Set a property, casting as correct type.
Style
  
toString():String
Summarise Style as String - for debugging.
Style
Property detail
drawnproperty
drawn:Boolean  [read-only]

Does this style require anything to be drawn? (To be overridden.)

Implementation
    public function get drawn():Boolean
editedproperty 
public var edited:Boolean = false

Is the style active (properties have been set)?

evalsproperty 
public var evals:Object

Compiled SWFs for each eval. We keep it here, not in the property itself, so that we can retain typing for each property.

interactiveproperty 
public var interactive:Boolean = true

Does this style permit mouse interaction? (Some styling, such as P2's back-level yellow highlight for selected ways, should not respond to mouse events.)

mergedproperty 
public var merged:Boolean = false

Has this style had another style merged into it? (When styles cascade, then we need to merge the first style with any subsequent styles that apply.)

propertiesproperty 
properties:Array  [read-only]

Properties getter, to be overridden.

Implementation
    public function get properties():Array
sublayerproperty 
public var sublayer:Number = 5

The sublayer is the z-index property _within_ an OSM layer. It enables (for example) trunk roads to be rendered above primary roads within that OSM layer, and so on. "OSM layer 1 / sublayer 5" will render above "OSM layer 1 / sublayer 4", but below "OSM layer 2 / sublayer 4".

Method detail
deepCopy()method
public function deepCopy():*

Make an exact copy of an object. Used when merging cascading styles. (FIXME: this needs some benchmarking - it may be quicker to simply iterate over .properties, copying each one.

Returns
*
hasEvals()method 
public function hasEvals():Boolean

Are there any eval functions defined?

Returns
Boolean
mergeWith()method 
public function mergeWith(additional:Style):void

Merge two Style objects.

Parameters
additional:Style
runEvals()method 
public function runEvals(tags:Object):void

Run all evals for this Style over the supplied tags. If, for example, the stylesheet contains width=eval('_width+2'), then this will set Style.width to 7.

Parameters
tags:Object
setPropertyFromString()method 
public function setPropertyFromString(k:String, v:*):Boolean

Set a property, casting as correct type.

Parameters
k:String
 
v:*

Returns
Boolean
toString()method 
public function toString():String

Summarise Style as String - for debugging.

Returns
String