public class TargetStackUtil extends Object
Utility method for manipulating GlimpseTargetStack
instances.
In order to uniquely name a GlimpseLayout, the stack containing the GlimpseLayout and all of its parent layouts down to the underlying GlimpseCanvas must be provided (because the GlimpseLayout may be reused and could have multiple parents).
Constructor and Description |
---|
TargetStackUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
contains(GlimpseTargetStack query,
GlimpseTarget target)
Returns true if the query target stack contains the provided target.
|
static boolean |
endsWith(GlimpseTargetStack query,
GlimpseTargetStack suffix)
Returns true if the query stack ends with the sequence of GlimpseTargets defined by the prefix stack.
|
static boolean |
intersects(GlimpseTargetStack query1,
GlimpseTargetStack query2) |
static GlimpseTargetStack |
newTargetStack(GlimpseTarget... targets)
Creates a new target stack which is the concatenation of the provided GlimpseTargets.
|
static GlimpseTargetStack |
newTargetStack(GlimpseTargetStack stack)
Creates a new GlimpseTargetStack which is an exact copy of the given stack.
|
static GlimpseTargetStack |
newUnmodifiableTargetStack(GlimpseTargetStack stack)
Creates a new GlimpseTargetStack which is an exact copy of the given stack
and is unmodifiable.
|
static GlimpseTargetStack |
popTo(GlimpseTargetStack stack,
GlimpseTarget target) |
static GlimpseTargetStack |
pushToBottom(GlimpseTargetStack stack,
int x,
int y) |
static boolean |
startsWith(GlimpseTargetStack query,
GlimpseTargetStack prefix)
Returns true if the query stack starts with the sequence of GlimpseTargets defined by the prefix stack.
|
static GlimpseMouseEvent |
translateCoordinates(GlimpseMouseEvent event,
GlimpseTarget target) |
public static GlimpseTargetStack newTargetStack(GlimpseTargetStack stack)
stack
- the stack to copypublic static GlimpseTargetStack newUnmodifiableTargetStack(GlimpseTargetStack stack)
stack
- the stack to copypublic static GlimpseTargetStack newTargetStack(GlimpseTarget... targets)
targets
- the GlimpseTargets to concatenatepublic static boolean endsWith(GlimpseTargetStack query, GlimpseTargetStack suffix)
query
- the GlimpseTargetStack to investigatesuffix
- a GlimpseTargetStack to search for at the end of the query stackpublic static boolean contains(GlimpseTargetStack query, GlimpseTarget target)
query
- the GlimpseTargetStack to investigatetarget
- the GlimpseTarget to look for in the query stackpublic static boolean intersects(GlimpseTargetStack query1, GlimpseTargetStack query2)
public static boolean startsWith(GlimpseTargetStack query, GlimpseTargetStack prefix)
query
- the GlimpseTargetStack to investigateprefix
- a GlimpseTargetStack to search for at the start of the query stackpublic static GlimpseTargetStack popTo(GlimpseTargetStack stack, GlimpseTarget target)
public static GlimpseTargetStack pushToBottom(GlimpseTargetStack stack, int x, int y)
public static GlimpseMouseEvent translateCoordinates(GlimpseMouseEvent event, GlimpseTarget target)
Copyright © 2016 Metron, Inc.. All rights reserved.