Class: ConstraintBasedLayouter
¶
Function: getPossibleInsertLocations
¶
Generates the list of all the possible locations where a new components can be placed
-
getPossibleInsertLocations
(container)¶ - Arguments
container (GL_Component) – A golden layout container
- Return GL_Component
The list of possible insert locations
Function: placeComponent
¶
Places a new component at the required location, orientation and with the specified percentage in the conxcerned orientation
-
placeComponent
(component, location, horizontal, percentage)¶ - Arguments
component (GL_Component_config) – Component config for the new component
location (GL_Component) – The component
horizontal (boolean) – Whether the orientation is horizontal or not (not=>vertical)
percentage (float) – Percentage of space in the concerned orienattion to give to the new component
Function: getSolutionFitness
¶
Calculates the fitness of placing a component at a giveb location in a certain orientation Fitness is the delta between the space that can be allocated in the given location as opposed to the prefered component size as specified in the component config (Smaller fitness is better)
-
getSolutionFitness
(location, component, horizontal)¶ - Arguments
location (GL_Component) – The location where to place the new component
component (GL_Component_config) – The config for the new component to place
horizontal (boolean) – Whether it is a horizontal placement (or vertical)
Function: _getChildSizeSize
¶
Retrieves a component effective sizes and prefered sizes
-
_getChildSizeSize
(component)¶ - Arguments
component (*) – Retrieves a component effective sizes and prefered sizes
- Return _getChildSizeSize(component)
The component effective sizes and prefered sizes
Function: reequilibrate
¶
Re-equilibrates the space allocated between components in the existing layout, recusrively and bottom up to approximate prefered sizes as much as possible.
-
reequilibrate
(container)¶ - Arguments
container (GL_Component) – The container to re-equilibrate
- Return reequilibrate(container)
The container effective sizes and prefered sizes
Function: verifyComponentRequirements
¶
Checks if the component config is valid Throws an exception if it is not the case
-
verifyComponentRequirements
(component)¶ - Arguments
component (GL_Component_config) – A Gl component config
Function: addComponent
¶
Layouter public method to be called by GL service when adding a new component
-
addComponent
(layout, component)¶ - Arguments
layout (GL_Component) – Layouter public method to be called by GL service when adding a new component
component (GL_Component_config) – Layouter public method to be called by GL service when adding a new component