bibliothek.gui.dock.station.layer
Class LayerPriority

java.lang.Object
  extended by bibliothek.gui.dock.station.layer.LayerPriority
All Implemented Interfaces:
Comparable<LayerPriority>

public class LayerPriority
extends Object
implements Comparable<LayerPriority>

A LayerPriority defines the basic ordering of DockStationDropLayers. 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 DockStationDropLayers with the same LayerPriority.
Several default LayerPrioritys 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.

Author:
Benjamin Sigg

Field Summary
static LayerPriority BASE
          Used for DockStations itself, this is the default priority for most layers.
static LayerPriority FALLBACK
          Describes the area where there are no stations, Dockables 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 Summary
LayerPriority(float priority, boolean reverse)
          Creates a new LayerPriority.
LayerPriority(float priority, boolean reverse, LayerPriority sub)
          Creates a new LayerPriority.
 
Method Summary
 int compareTo(LayerPriority o)
           
 float getPriority()
          Gets the priority of this LayerPriority.
 boolean isReverse()
          Tells whether the order of DockStationDropLayers 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 sub
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FALLBACK

public static final LayerPriority FALLBACK
Describes the area where there are no stations, Dockables dragged into this area normally start to float (i.e. become children of ScreenDockStation).


OUTSIDE_LOW

public static final LayerPriority OUTSIDE_LOW
Used for the area around a DockStation, the layer that is only accessed if all other layers are not used.


BASE

public static final LayerPriority BASE
Used for DockStations itself, this is the default priority for most layers.


OVERRIDE_GUESS

public static final 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.


OVERRIDE_PRECISE

public static final 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.


OUTSIDE_HIGH

public static final 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.


FLOAT_ANCHORED

public static final LayerPriority FLOAT_ANCHORED
Describes a layer that is floating above a window, but still attached to that window.


FLOAT_FREE

public static final LayerPriority FLOAT_FREE
Describes a layer that is floating freely above all other windows.

Constructor Detail

LayerPriority

public LayerPriority(float priority,
                     boolean reverse)
Creates a new LayerPriority.

Parameters:
priority - the priority, a number at least 0, where a higher number means that the priority is more important.
reverse - whether the order of DockStationDropLayers should be reversed

LayerPriority

public LayerPriority(float priority,
                     boolean reverse,
                     LayerPriority sub)
Creates a new LayerPriority.

Parameters:
priority - the priority, a number at least 0, where a higher number means that the priority is more important.
reverse - whether the order of DockStationDropLayers should be reversed
sub - further description of this priority
Method Detail

merge

public LayerPriority merge(LayerPriority sub)
Combines this LayerPriority with sub:

Parameters:
sub - the new sub layer
Returns:
the merged layer

isReverse

public boolean isReverse()
Tells whether the order of DockStationDropLayers should be reversed

Returns:
whether to reverse the order

getPriority

public float getPriority()
Gets the priority of this LayerPriority.

Returns:
the priority, a value at least 0, a higher number means that the priority is more important

compareTo

public int compareTo(LayerPriority o)
Specified by:
compareTo in interface Comparable<LayerPriority>

toString

public String toString()
Overrides:
toString in class Object