The class MacaoPage is not a class itself, but it is used to document all the global properties and methods of the package core/road.js.
Method Summary | |
---|---|
void | addRoadType(String typeName, Function constructor)
Call this method to add a new road type, which you have implemented. |
MacaoRoad | createRoad(String roadType, integer gridLeft, integer gridTop, integer orientation, optional String roadName)
Call this method to add a new road element to your page. |
MacaoRoad | getRoadAt(integer gridX, integer gridY)
Call this method to get a road element at a specified position in the road grid. |
MacaoRoad | getRoadByName(String roadName)
Call this method, to get a road element by name. |
integer | getRoadCellSize()
Call this method to get the size of a road grid cell in pixels. |
void | linkRoads()
Call this method to link all road elements of the page. |
void | removeRoad(MacaoRoad road)
Call this method to remove a road element from the page. |
void | setRoadMetrics(integer roadLeft, integer roadTop, integer cellSize)
Call this method to define the position of the road grid and the cell size of a grid cell. |
Method Details |
---|
Call this method to add a new road type, which you have implemented.
See MacaoRoad, on how to implement your own road types.
Call this method to add a new road element to your page.
You may use the Road Editor to generate a number of calls of this method. See also MacaoRoadGrid.
Call this method to get a road element at a specified position in the road grid.
See also createRoad() and MacaoRoadGrid.
Call this method, to get a road element by name.
See also createRoad() and MacaoRoadGrid.
Call this method to get the size of a road grid cell in pixels.
See also setRoadMetrics() and MacaoRoadGrid.
Call this method to link all road elements of the page.
This method runs the linker. The linker is looking for adjacent road elements and creates connections between the edge nodes. Call this method after all road elements are added to the page. This method may only be called once for a page. See also createRoad() and MacaoRoadGrid.
Call this method to remove a road element from the page.
This method currently does not remove the MacaoNode and MacaoConnection objects, which where created by the road element. See also createRoad() and MacaoRoadGrid.
Call this method to define the position of the road grid and the cell size of a grid cell.
You must call this method before you add any road elements to the page. Because when a road element is created, it uses these values to place its nodes on the page. See also createRoad() and MacaoRoadGrid.