blob: 92917e1b97404446e475ba3a572c436dbd6cef7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
import com.sun.star.uno.UnoRuntime;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.accessibility.XAccessibleImage;
class AccessibleImageHandler extends NodeHandler
{
public NodeHandler createHandler (XAccessibleContext xContext)
{
XAccessibleImage xImage =
(XAccessibleImage) UnoRuntime.queryInterface (
XAccessibleImage.class, xContext);
if (xImage != null)
return new AccessibleImageHandler (xImage);
else
return null;
}
public AccessibleImageHandler ()
{
}
public AccessibleImageHandler (XAccessibleImage xImage)
{
if (xImage != null)
maChildList.setSize (1);
}
protected static XAccessibleImage getImage (AccTreeNode aNode)
{
return (XAccessibleImage) UnoRuntime.queryInterface (
XAccessibleImage.class, aNode.getContext());
}
public AccessibleTreeNode createChild (AccessibleTreeNode aParent, int nIndex)
{
if (aParent instanceof AccTreeNode)
{
XAccessibleImage xImage = getImage ((AccTreeNode)aParent);
if (xImage != null)
return new StringNode (
"Image: " +
xImage.getAccessibleImageDescription() + " (" +
xImage.getAccessibleImageWidth() + "x" +
xImage.getAccessibleImageHeight() + ")",
aParent);
}
return null;
}
}
|