2 import com
.sun
.star
.uno
.UnoRuntime
;
3 import com
.sun
.star
.accessibility
.XAccessibleContext
;
4 import com
.sun
.star
.accessibility
.XAccessibleImage
;
7 class AccessibleImageHandler
extends NodeHandler
9 public NodeHandler
createHandler (XAccessibleContext xContext
)
11 XAccessibleImage xImage
=
12 (XAccessibleImage
) UnoRuntime
.queryInterface (
13 XAccessibleImage
.class, xContext
);
15 return new AccessibleImageHandler (xImage
);
20 public AccessibleImageHandler ()
24 public AccessibleImageHandler (XAccessibleImage xImage
)
27 maChildList
.setSize (1);
30 protected static XAccessibleImage
getImage (AccTreeNode aNode
)
32 return (XAccessibleImage
) UnoRuntime
.queryInterface (
33 XAccessibleImage
.class, aNode
.getContext());
36 public AccessibleTreeNode
createChild (AccessibleTreeNode aParent
, int nIndex
)
38 if (aParent
instanceof AccTreeNode
)
40 XAccessibleImage xImage
= getImage ((AccTreeNode
)aParent
);
42 return new StringNode (
44 xImage
.getAccessibleImageDescription() + " (" +
45 xImage
.getAccessibleImageWidth() + "x" +
46 xImage
.getAccessibleImageHeight() + ")",