public interface LayoutBuilder
LayoutBuilder
provides a specific Layout
instance. The
Builder pattern is more suitable for the Layout instantiation to allow
simpler reusability of Layout's code.
Only the LayoutBuilder of a given layout algorithm is exposed, this way, one can devise different layout algorithms (represented by their respective LayoutBuilder) that uses a same underlying Layout implementation, but that differs only by an aggregation, composition or a property that is set only during instantiation time.
See ClockwiseRotate
and CounterClockwiseRotate
for
a simple example of this pattern. Both are LayoutBuilders that instanciate
Layouts with a different behaviour (the direction of rotation), but both uses
the RotateLayout class. The only difference is the angle provided by the
LayoutBuilder on the time of instantiation of the RotateLayout object.
Modifier and Type | Method and Description |
---|---|
Layout |
buildLayout()
Builds an instance of the Layout.
|
String |
getName()
The name of the behaviour of the Layout's provided by this Builder.
|
LayoutUI |
getUI()
User interface attributes (name, description, icon...) for all Layouts
built by this builder.
|
String getName()
LayoutUI getUI()
LayoutUI
instanceLayout buildLayout()
Layout
instanceCopyright © 2007–2017 Gephi Consortium. All rights reserved.