| Modifier and Type | Class and Description |
|---|---|
static class |
DockUtilities.DockVisitor
A visitor used to visit the nodes of a dock-tree.
|
| Constructor and Description |
|---|
DockUtilities() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
acceptable(DockStation parent,
Dockable child)
|
static boolean |
acceptable(DockStation parent,
Dockable old,
Dockable next)
|
static DockableProperty |
append(DockableProperty root,
DockableProperty property)
Creates a copy of
root and sets property
as the successor of the very last element in the property chain beginning
at root. |
static void |
checkLayoutLocked()
Searches for a class or interface that is marked with
LayoutLocked in the current
callstack and prints a warning if found. |
static void |
disableCheckLayoutLocked()
Ensures that
checkLayoutLocked() never prints out any warnings. |
static Icon |
disabledIcon(JComponent parent,
Icon icon)
Gets a "disabled" icon according to the current look and feel.
|
static void |
ensureTreeValidity(DockStation newParent,
Dockable newChild)
Ensures that
newChild has no parent, and that there will
be no cycle when newChild is added to newParent |
static void |
ensureTreeValidity(PerspectiveStation newParent,
PerspectiveDockable newChild)
Ensures that
newChild has either no parent or newParent as parent, and that there will
be no cycle when newChild is added to newParent |
static Dockable |
getDirectChild(DockStation parent,
Dockable subchild)
Searches the one
Dockable that is either subchild or a parent
of subchild and whose parent is parent. |
static DockableProperty |
getLastProperty(DockableProperty property)
Gets the last successor in the property chain beginning at
property. |
static DockableProperty |
getPropertyChain(Dockable dockable)
|
static DockableProperty |
getPropertyChain(DockStation ground,
Dockable dockable)
|
static DockableProperty |
getPropertyChain(PerspectiveStation ground,
PerspectiveDockable dockable)
|
static DockStation |
getRoot(DockElement element)
Searches the station which is an ancestor of
element
and has no parent. |
static Component |
getShowingComponent(Dockable dockable)
Searches a
Component which is showing
and has something to do with dockable.This method first checks Dockable and DockTitles, then it checks
all DockElementRepresentatives. |
static Image |
iconImage(Icon icon)
Transforms
icon into an image. |
static boolean |
isAncestor(DockElement ancestor,
DockElement child)
Tells whether
child is identical with ancestor
or a child of ancestor. |
static boolean |
isAncestor(PerspectiveElement ancestor,
PerspectiveElement child)
Tells whether
child is identical with ancestor
or a child of ancestor. |
static List<Dockable> |
listDockables(DockElement root,
boolean includeRoot)
Lists all
Dockables in the tree under root. |
static Map<String,Icon> |
loadIcons(String list,
String path,
ClassLoader loader)
Loads a map of icons.
|
static Map<String,Icon> |
loadIcons(String list,
String path,
Set<String> ignore,
ClassLoader loader)
Loads a map of icons.
|
static Path[] |
mergePlaceholders(Path[] base,
Dockable dockable,
PlaceholderStrategy strategy)
Merges the array
base with the placeholder that is associated with dockable, but
only if that placeholder is not yet in base. |
static void |
visit(Dockable dockable,
DockUtilities.DockVisitor visitor)
Visits
dockable and all its children. |
static void |
visit(DockElement element,
DockUtilities.DockVisitor visitor)
Visits
element and all its children. |
static void |
visit(DockStation station,
DockUtilities.DockVisitor visitor)
Visits
station and all its children. |
public static void visit(Dockable dockable, DockUtilities.DockVisitor visitor)
dockable and all its children.dockable - the first element to visitvisitor - a delegatepublic static void visit(DockStation station, DockUtilities.DockVisitor visitor)
station and all its children.station - the first element to visitvisitor - a delegatepublic static void visit(DockElement element, DockUtilities.DockVisitor visitor)
element and all its children.element - the first element to visitvisitor - a delegatepublic static List<Dockable> listDockables(DockElement root, boolean includeRoot)
Dockables in the tree under root.root - the root of a tree of elementsincludeRoot - whether root should be in the resulting
list as wellDockables, might be empty but not nullpublic static boolean isAncestor(DockElement ancestor, DockElement child)
child is identical with ancestor
or a child of ancestor.ancestor - an elementchild - another elementtrue if ancestor is a parent of or
identical with child.public static boolean isAncestor(PerspectiveElement ancestor, PerspectiveElement child)
child is identical with ancestor
or a child of ancestor.ancestor - an elementchild - another elementtrue if ancestor is a parent of or
identical with child.public static DockStation getRoot(DockElement element)
element
and has no parent.element - the element whose oldest parent is searchednull if element has no parentpublic static Dockable getDirectChild(DockStation parent, Dockable subchild)
Dockable that is either subchild or a parent
of subchild and whose parent is parent.parent - the parent of the resultsubchild - a direct or indirect child of parentnull if subchild is no child of parentpublic static DockableProperty append(DockableProperty root, DockableProperty property)
root and sets property
as the successor of the very last element in the property chain beginning
at root.root - the root of the chain, can be nullproperty - the new last element of the chainpublic static DockableProperty getLastProperty(DockableProperty property)
property.property - the start of the chainpublic static DockableProperty getPropertyChain(Dockable dockable)
dockable - a Dockable whose location is searchednull if dockable
has no parentpublic static DockableProperty getPropertyChain(DockStation ground, Dockable dockable)
ground - the base of the propertydockable - an indirect child of groundground to dockable.IllegalArgumentException - if ground is not an
ancestor of dockablepublic static DockableProperty getPropertyChain(PerspectiveStation ground, PerspectiveDockable dockable)
ground - the base of the propertydockable - an indirect child of groundground to dockable.IllegalArgumentException - if ground is not an
ancestor of dockablepublic static Component getShowingComponent(Dockable dockable)
Component which is showing
and has something to do with dockable.Dockable and DockTitles, then it checks
all DockElementRepresentatives.dockable - a Dockable for which a Component has to be foundnullpublic static void ensureTreeValidity(DockStation newParent, Dockable newChild)
newChild has no parent, and that there will
be no cycle when newChild is added to newParentnewParent - the element that becomes parent of newChildnewChild - the element that becomes child of newParentNullPointerException - if either newParent or newChild is nullIllegalArgumentException - if there would be a cycle introducedIllegalStateException - if the old parent of newChild does not
allow to remove its childpublic static void ensureTreeValidity(PerspectiveStation newParent, PerspectiveDockable newChild)
newChild has either no parent or newParent as parent, and that there will
be no cycle when newChild is added to newParentnewParent - the element that becomes parent of newChildnewChild - the element that becomes child of newParentNullPointerException - if either newParent or newChild is nullIllegalArgumentException - if there would be a cycle introducedIllegalStateException - if the old parent of newChild does not
allow to remove its childpublic static Icon disabledIcon(JComponent parent, Icon icon)
parent - the component on which the icon will be painted, can be nullicon - an icon or nullicon or nullpublic static Image iconImage(Icon icon)
icon into an image.icon - some iconnullpublic static Map<String,Icon> loadIcons(String list, String path, ClassLoader loader)
list - a path to a property-file containing key-path-pairs.path - the base path to the icons, will be added before any
path of the property file, can be nullloader - used to transform paths into urls.Icons, the map can be empty if no icons were foundProperties.load(InputStream)public static Map<String,Icon> loadIcons(String list, String path, Set<String> ignore, ClassLoader loader)
list - a path to a property-file containing key-path-pairs.path - the base path to the icons, will be added before any
path of the property file, can be nullignore - keys that are already present in ignore are not loaded, can be nullloader - used to transform paths into urls.Icons, the map can be empty if no icons were foundProperties.load(InputStream)public static Path[] mergePlaceholders(Path[] base, Dockable dockable, PlaceholderStrategy strategy)
base with the placeholder that is associated with dockable, but
only if that placeholder is not yet in base.base - some basic array, can be nulldockable - the dockable whose placeholder is to be stored, can be nullstrategy - a strategy to find the placeholder of dockable, can be nullbase, base itself, or null if
base was null and no additional placeholder was foundpublic static boolean acceptable(DockStation parent, Dockable child)
parent - the new parentchild - the new childtrue if the parent and the child accept each otherpublic static boolean acceptable(DockStation parent, Dockable old, Dockable next)
parent - the parent of oldold - the existing childnext - the new childtrue if the parent and the child accept each otherpublic static void disableCheckLayoutLocked()
checkLayoutLocked() never prints out any warnings.public static void checkLayoutLocked()
LayoutLocked in the current
callstack and prints a warning if found.Copyright © 2017 Docking Frames. All rights reserved.