Package | net.systemeD.halcyon.styleparser |
Class | public class RuleSet |
The RuleSet class has two principal methods: getStyles, which calculates the styles that apply to an entity (returned as a StyleList); and parse, which parses a MapCSS stylesheet into a complete RuleSet.
Property | Defined by | ||
---|---|---|---|
choosers : Array | RuleSet | ||
evals : Array | RuleSet | ||
images : Object Hash of loaded images.
| RuleSet | ||
imageWidths : Object Hash of image widths.
| RuleSet | ||
loaded : Boolean = false Is the RuleSet fully loaded and available for use?
| RuleSet |
Method | Defined by | ||
---|---|---|---|
RuleSet(mins:uint, maxs:uint, redrawCall:Function = null, iconLoadedCallback:Function = null)
Constructor
| RuleSet | ||
Create a StyleList for an Entity, by creating a blank StyleList, then running each StyleChooser over it.
| RuleSet | ||
loadFromCSS(str:String):void
Load and then parse a MapCSS stylesheet.
| RuleSet | ||
parse(css:String):void
Parse a MapCSS stylesheet into a set of StyleChoosers.
| RuleSet | ||
parseCSSColor(colorStr:String):uint
[static] Convert a colour string from CSS colour name ("blue"), short hex ("#abc") or long hex ("#a0b0c0"),
to an integer.
| RuleSet |
choosers | property |
public var choosers:Array
evals | property |
public var evals:Array
images | property |
public var images:Object
Hash of loaded images. Hash key is filename, value is BitmapData for the image.
imageWidths | property |
public var imageWidths:Object
Hash of image widths. Hash key is filename, value is pixel width.
loaded | property |
public var loaded:Boolean = false
Is the RuleSet fully loaded and available for use?
RuleSet | () | constructor |
public function RuleSet(mins:uint, maxs:uint, redrawCall:Function = null, iconLoadedCallback:Function = null)
Constructor
Parametersmins:uint |
|
maxs:uint |
|
redrawCall:Function (default = null )
|
|
iconLoadedCallback:Function (default = null )
|
getStyles | () | method |
public function getStyles(obj:Entity, tags:Object, zoom:uint):StyleList
Create a StyleList for an Entity, by creating a blank StyleList, then running each StyleChooser over it.
Parametersobj:Entity |
|
tags:Object |
|
zoom:uint |
StyleList |
See also
loadFromCSS | () | method |
public function loadFromCSS(str:String):void
Load and then parse a MapCSS stylesheet. Usually you will supply a filename, but you can also pass a complete stylesheet in the string parameter. (Any string containing space characters will be assumed to be a stylesheet rather than a filename.)
Parametersstr:String |
parse | () | method |
public function parse(css:String):void
Parse a MapCSS stylesheet into a set of StyleChoosers. The parser is regular expression-based and runs sequentially through the file from start to end.
Parameterscss:String |
parseCSSColor | () | method |
public static function parseCSSColor(colorStr:String):uint
Convert a colour string from CSS colour name ("blue"), short hex ("#abc") or long hex ("#a0b0c0"), to an integer.
ParameterscolorStr:String |
uint |