@ClientOnly public class SplitCombiner extends BasicCombiner
Combiner
, normally not used by this framework. This
Combiner
creates a SplitDockStation
if the parent station is a ScreenDockStation
.Constructor and Description |
---|
SplitCombiner() |
Modifier and Type | Method and Description |
---|---|
Dockable |
combine(CombinerSource source,
CombinerTarget target)
Merges two
Dockable s into a new Dockable. |
protected boolean |
isCentered(int width,
int height,
int x,
int y)
Tells whether the position
x/y is centered in width/height . |
CombinerTarget |
prepare(CombinerSource source,
Enforcement force)
Prepares information telling how two
Dockable s may be combined. |
aside
public CombinerTarget prepare(CombinerSource source, Enforcement force)
Combiner
Dockable
s may be combined.prepare
in interface Combiner
prepare
in class BasicCombiner
source
- the Dockable
s which may be combined, their parent station and
other helpful information.force
- how much the caller of this method would like the method not to return a
value of null
. Implementations should read the force
property, where a value of 1
means that this method must success, while 0
means that this method may or may not success. In general the modules in the framework expect that a value below
0.5
results in null
, while a value above 0.5f
results in a non-null
value.Dockable
s, may be null
to indicate that
a combination is not desiredprotected boolean isCentered(int width, int height, int x, int y)
x/y
is centered in width/height
.width
- the width of some areaheight
- the height of some areax
- x-coordinate of a pointy
- y-coordinate of a pointtrue
if x/y
is centeredpublic Dockable combine(CombinerSource source, CombinerTarget target)
Combiner
Dockable
s into a new Dockable. This method may
set the DockController
of the created element in order to initialize
it more efficiently.combine
in interface Combiner
combine
in class BasicCombiner
source
- information about the two Dockable
s that are going to be merged, not null
. This
object may or may not have been created by this Combiner
, some sanity checks are advised before using ittarget
- information that was created by Combiner.prepare(CombinerSource, Enforcement)
using source
, not null
Dockable
, not null