public class LayerPriority extends Object implements Comparable<LayerPriority>
LayerPriority
defines the basic ordering of DockStationDropLayer
s. Each
LayerPriority
has a custom priority
, as higher this value is,
as higher the priority of the DockStationDropLayer
is. The reverse
property tells whether the order should be reversed for DockStationDropLayer
s with the
same LayerPriority
.LayerPriority
s are defined, the framework itself uses only these
priorities. Clients may introduce additional priorities. The default priorities all lay within
a range of 0.1
to 0.9
. Clients introducing new layers can use code like
new LayerPriority( LAYER.getPriority()+0.5f, false );
to place their new layers between existing
default layers.Modifier and Type | Field and Description |
---|---|
static LayerPriority |
BASE
Used for
DockStation s itself, this is the default priority for most layers. |
static LayerPriority |
FALLBACK
Describes the area where there are no stations,
Dockable s dragged into this
area normally start to float (i.e. |
static LayerPriority |
FLOAT_ANCHORED
Describes a layer that is floating above a window, but still attached to that window.
|
static LayerPriority |
FLOAT_FREE
Describes a layer that is floating freely above all other windows.
|
static LayerPriority |
OUTSIDE_HIGH
Used for the area around a
DockStation , the layer has a high priority and
is accessed unless there are floating windows present. |
static LayerPriority |
OUTSIDE_LOW
Used for the area around a
DockStation , the layer that is only accessed if
all other layers are not used. |
static LayerPriority |
OVERRIDE_GUESS
Describes an area with special behavior more important than
BASE , but not an area
where the user has a clear indicator of what will happen.This priority has the reverse
flag set to true . |
static LayerPriority |
OVERRIDE_PRECISE
Describes an area with special behavior more important than
BASE , other than
OVERRIDE_GUESS this layer is very small but also has very clear indicators of
what will happen. |
Constructor and Description |
---|
LayerPriority(float priority,
boolean reverse)
Creates a new
LayerPriority . |
LayerPriority(float priority,
boolean reverse,
LayerPriority sub)
Creates a new
LayerPriority . |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(LayerPriority o) |
float |
getPriority()
Gets the priority of this
LayerPriority . |
boolean |
isReverse()
Tells whether the order of
DockStationDropLayer s should be reversed |
LayerPriority |
merge(LayerPriority sub)
Combines this
LayerPriority with sub :
The inner-layer priority is set to sub
The priority is to the priority of this
The reverse property is set to the value of this
|
String |
toString() |
public static final LayerPriority FALLBACK
Dockable
s dragged into this
area normally start to float (i.e. become children of ScreenDockStation
).public static final LayerPriority OUTSIDE_LOW
DockStation
, the layer that is only accessed if
all other layers are not used.public static final LayerPriority BASE
DockStation
s itself, this is the default priority for most layers.public static final LayerPriority OVERRIDE_GUESS
BASE
, but not an area
where the user has a clear indicator of what will happen.This priority has the reverse
flag set to true
.public static final LayerPriority OVERRIDE_PRECISE
BASE
, other than
OVERRIDE_GUESS
this layer is very small but also has very clear indicators of
what will happen.public static final LayerPriority OUTSIDE_HIGH
DockStation
, the layer has a high priority and
is accessed unless there are floating windows present.public static final LayerPriority FLOAT_ANCHORED
public static final LayerPriority FLOAT_FREE
public LayerPriority(float priority, boolean reverse)
LayerPriority
.priority
- the priority, a number at least 0, where a higher number means that
the priority is more important.reverse
- whether the order of DockStationDropLayer
s should be reversedpublic LayerPriority(float priority, boolean reverse, LayerPriority sub)
LayerPriority
.priority
- the priority, a number at least 0, where a higher number means that
the priority is more important.reverse
- whether the order of DockStationDropLayer
s should be reversedsub
- further description of this prioritypublic LayerPriority merge(LayerPriority sub)
LayerPriority
with sub
:
sub
- the new sub layerpublic boolean isReverse()
DockStationDropLayer
s should be reversedpublic float getPriority()
LayerPriority
.public int compareTo(LayerPriority o)
compareTo
in interface Comparable<LayerPriority>