|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.util.DockUtilities
public class DockUtilities
A list of methods which can be used for different purposes. Methods
related to the DockTheme
can be found in DockUI
.
Nested Class Summary | |
---|---|
static class |
DockUtilities.DockVisitor
A visitor used to visit the nodes of a dock-tree. |
Constructor Summary | |
---|---|
DockUtilities()
|
Method Summary | |
---|---|
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 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 |
exchangeTitle(DockableDisplayer displayer,
DockTitleVersion version)
Removes the current title of displayer and sets a new
title. |
static DockableProperty |
getLastProperty(DockableProperty property)
Gets the last successor in the property chain beginning at property . |
static DockableProperty |
getPropertyChain(Dockable dockable)
Gets a DockableProperty which describes the path from the
root to dockable . |
static DockableProperty |
getPropertyChain(DockStation ground,
Dockable dockable)
Creates a DockableProperty describing the path from
ground to 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 . |
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 List<Dockable> |
listDockables(DockElement root,
boolean includeRoot)
Lists all Dockable s in the tree under root . |
static Map<String,Icon> |
loadIcons(String list,
String path,
ClassLoader loader)
Loads a map of icons. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DockUtilities()
Method Detail |
---|
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)
Dockable
s in the tree under root
.
root
- the root of a tree of elementsincludeRoot
- whether root
should be in the resulting
list as well
Dockable
s, might be empty but not null
public static boolean isAncestor(DockElement ancestor, DockElement child)
child
is identical with ancestor
or a child of ancestor
.
ancestor
- an elementchild
- another element
true
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 searched
null
if element has no 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 null
property
- the new last element of the chain
public static DockableProperty getLastProperty(DockableProperty property)
property
.
property
- the start of the chain
public static DockableProperty getPropertyChain(Dockable dockable)
DockableProperty
which describes the path from the
root
to dockable
.
dockable
- a Dockable whose location is searched
null
if dockable
has no parentpublic static DockableProperty getPropertyChain(DockStation ground, Dockable dockable)
DockableProperty
describing the path from
ground
to dockable
.
ground
- the base of the propertydockable
- an indirect child of ground
ground
to dockable
.
IllegalArgumentException
- if ground
is not an
ancestor of dockable
public static Component getShowingComponent(Dockable dockable)
Component
which is showing
and has something to do with dockable
.
dockable
- a Dockable for which a Component has to be found
null
public static void ensureTreeValidity(DockStation newParent, Dockable newChild)
newChild
has no parent, and that there will
be no cycle when newChild
is added to newParent
newParent
- the element that becomes parent of newChild
newChild
- the element that becomes child of newParent
NullPointerException
- if either newParent
or newChild
is null
IllegalArgumentException
- if there would be a cycle introduced
IllegalStateException
- 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 null
icon
- an icon or null
icon
or null
public static Image iconImage(Icon icon)
icon
into an image.
icon
- some icon
null
public 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 null
loader
- used to transform paths into urls.
Icon
s, the map can be empty if no icons were foundProperties.load(InputStream)
public static void exchangeTitle(DockableDisplayer displayer, DockTitleVersion version)
displayer
and sets a new
title. The Dockable
of displayer
is used to create
the new title.
displayer
- some displayerversion
- the kind of title that should be created, can be null
to indicate that no title should be created.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |