fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / toolkit / test / accessibility / GeometryEventHandler.java
blob1c2fea0f8b36d5322927a4951a7ccb505f312407
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 import com.sun.star.accessibility.AccessibleEventObject;
20 import java.io.PrintStream;
21 import java.util.LinkedList;
23 class GeometryEventHandler
24 extends EventHandler
26 public GeometryEventHandler (AccessibleEventObject aEvent, AccessibilityTreeModel aTreeModel)
28 super (aEvent, aTreeModel);
31 public void PrintOldAndNew (PrintStream out)
33 out.println (" children not relevant");
36 public void Process ()
38 AccTreeNode aNode = maTreeModel.updateNode (mxEventSource,
39 AccessibleComponentHandler.class,
40 AccessibleExtendedComponentHandler.class);
42 // Update the graphical representation of aNode in the Canvas.
43 Canvas aCanvas = maTreeModel.getCanvas();
44 if (aCanvas != null)
46 // Iterate over all nodes in the sub-tree rooted in aNode.
47 LinkedList<Object> aShapeQueue = new LinkedList<Object>();
48 aShapeQueue.addLast (aNode);
49 while (aShapeQueue.size() > 0)
51 // Remove the first node from the queue and update its
52 // graphical representation.
53 AccTreeNode aShapeNode = (AccTreeNode) aShapeQueue.getFirst();
54 aShapeQueue.removeFirst();
55 aCanvas.updateNodeGeometry (aShapeNode);
57 // Add the node's children to the queue.
58 int nChildCount = maTreeModel.getChildCount (aShapeNode);
59 for (int i=0; i<nChildCount; i++)
61 Object aTreeNode = maTreeModel.getChildNoCreate (aShapeNode, i);
62 if (aTreeNode instanceof AccTreeNode)
63 aShapeQueue.addLast (aTreeNode);
66 aCanvas.repaint ();