Package yearreview.app.grid
Class GridManager
java.lang.Object
yearreview.app.grid.GridManager
Parses the configuration of the grid and creates the segments with according sizes.
- Author:
- ColdStone37
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
Class to store the dimensions of a widget in screen space. -
Field Summary
-
Constructor Summary
ConstructorDescriptionGridManager
(XmlNode gridConfig) Constructs aGridManager
from a given configuration. -
Method Summary
Modifier and TypeMethodDescriptioniterator()
Gets an iterator for the widgets contained in the manager.private GridManager.WidgetPosition
transform
(int x, int y, int w, int h) Transforms widget coordinates from grid space to screen space.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
xScale
private final float xScaleHorizontal scale used to position the nodes. -
yScale
private final float yScaleVertical scale used to position the nodes. -
widgets
A List of all Widgets managed by thisGridManager
. -
logger
-
-
Constructor Details
-
GridManager
Constructs aGridManager
from a given configuration.- Parameters:
gridConfig
- configuration of the grid
-
-
Method Details
-
transform
Transforms widget coordinates from grid space to screen space.- Parameters:
x
- x-position of the widget in grid spacey
- y-position of the widget in grid spacew
- width of the widget in grid spaceh
- height of the widget in grid space- Returns:
- new dimensions bundled in
GridManager.WidgetPosition
-object
-
iterator
Gets an iterator for the widgets contained in the manager.
-