source: trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/guimodel/GUIModel.java @ 1116

Last change on this file since 1116 was 1116, checked in by pharms, 11 years ago
  • made GUI model serializable
File size: 28.2 KB
Line 
1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
15package de.ugoe.cs.autoquest.eventcore.guimodel;
16
17import java.io.OutputStream;
18import java.io.PrintStream;
19import java.io.Serializable;
20import java.io.UnsupportedEncodingException;
21import java.util.ArrayList;
22import java.util.LinkedList;
23import java.util.List;
24import java.util.Stack;
25import java.util.logging.Level;
26
27import de.ugoe.cs.util.console.Console;
28
29/**
30 * <p>
31 * A GUI model is a tree of {@link IGUIElements} and represents a complete GUI of a software. It is
32 * platform independent. It may have several root nodes, as some GUIs are made up of several Frames
33 * being independent from each other. The GUI model is filled using the
34 * {@link #integratePath(List, IGUIElementFactory)} method.
35 * </p>
36 *
37 * @version 1.0
38 * @author Patrick Harms, Steffen Herbold
39 */
40public class GUIModel implements Serializable {
41
42    /**  */
43    private static final long serialVersionUID = 1L;
44
45    /**
46     * <p>
47     * The root node of the tree not provided externally.
48     * </p>
49     */
50    private TreeNode root = new TreeNode();
51
52    /**
53     * <p>
54     * A list with all nodes currently known
55     * </p>
56     */
57    private List<TreeNode> allNodes = new ArrayList<TreeNode>();
58
59    /**
60     * <p>
61     * Integrates a path of GUI elements into the GUI model. The GUI model itself is a tree and
62     * therefore a set of different paths through the tree that start with a root node and end with
63     * a leaf node. Such a path can be added to the tree. The method checks, if any of the GUI
64     * elements denoted by the path already exists. If so, it reuses it. It may therefore also
65     * return an existing GUI element being the leaf node of the provided path. If a GUI element of
66     * the path does not exist yet, it creates a new one using the provided GUI element factory.
67     * </p>
68     * <p>
69     * If a GUI element specification describes an existing GUI element or not is determined through
70     * comparing the GUI element specifications of the existing GUI elements with the ones provided
71     * in the path. The comparison is done using the
72     * {@link IGUIElementSpec#getSimilarity(IGUIElementSpec)} method. The comparison is only done on
73     * the correct levels. I.e. the currently known root elements of the tree are only compared to
74     * the first element in the path. If the correct one is found or created, its children are
75     * compared only to the second specification in the path, and so on.
76     * </p>
77     * <p>
78     * The returned GUI elements are singletons. I.e. it is tried to return always the identical
79     * object for the same denoted element. However, while creating the GUI model, the similarity of
80     * GUI elements may change. Therefore, the method might determine, that two formerly different
81     * nodes are now similar. (This may happen, e.g. if GUI elements do not have initial names which
82     * are set afterwards. Therefore, first they are handled differently and later they can be
83     * identified as being the same.) In such a case, there are already several GUI element objects
84     * instantiated for the same GUI element. The singleton paradigm gets broken. Therefore, such
85     * GUI element objects are registered with each other, so that their equal method can determine
86     * equality again correctly, although the objects are no singletons anymore.
87     * </p>
88     *
89     * @param guiElementPath
90     *            the path to integrate into the model
91     * @param guiElementFactory
92     *            the GUI element factory to be used for instantiating GUI element objects
93     *
94     * @return The GUI element object representing the GUI element denoted by the provided path
95     *
96     * @throws GUIModelException
97     *             thrown in cases such as the GUI element object could not be instantiated
98     * @throws IllegalArgumentException
99     *             if the provided path is invalid.
100     */
101    public IGUIElement integratePath(List<? extends IGUIElementSpec> guiElementPath,
102                                     IGUIElementFactory guiElementFactory)
103        throws GUIModelException, IllegalArgumentException
104    {
105        if ((guiElementPath == null) || (guiElementPath.size() <= 0)) {
106            throw new IllegalArgumentException("GUI element path must contain at least one element");
107        }
108
109        List<IGUIElementSpec> remainingPath = new LinkedList<IGUIElementSpec>();
110
111        for (IGUIElementSpec spec : guiElementPath) {
112            remainingPath.add(spec);
113        }
114
115        return integratePath(root, remainingPath, guiElementFactory);
116    }
117
118    /**
119     * <p>
120     * Returns all children of the provided GUI element or null, if it does not have any or the node
121     * is unknown.
122     * </p>
123     *
124     * @param guiElement
125     *            the GUI element of which the children shall be returned
126     *
127     * @return As described
128     */
129    public List<IGUIElement> getChildren(IGUIElement guiElement) {
130        List<IGUIElement> result = null;
131        for (TreeNode node : allNodes) {
132            if (node.guiElement.equals(guiElement)) {
133                if (result == null) {
134                    result = new ArrayList<IGUIElement>();
135
136                    if (node.children != null) {
137                        for (TreeNode child : node.children) {
138                            result.add(child.guiElement);
139                        }
140                    }
141                }
142                else {
143                    Console
144                        .traceln(Level.SEVERE,
145                                 "Multiple nodes in the internal GUI model match the same GUI element. "
146                                     + "This should not be the case and the GUI model is probably invalid.");
147                }
148            }
149        }
150
151        return result;
152    }
153
154    /**
155     * <p>
156     * Returns the parent GUI element of the provided GUI element or null, if it does not have a
157     * parent (i.e. if it is a root node) or if the node is unknown.
158     * </p>
159     *
160     * @param guiElement
161     *            the GUI element of which the parent shall be returned
162     *
163     * @return As described
164     */
165    public IGUIElement getParent(IGUIElement guiElement) {
166        IGUIElement parent = null;
167
168        for (TreeNode node : allNodes) {
169            if (node.children != null) {
170                for (TreeNode child : node.children) {
171                    if (child.guiElement.equals(guiElement)) {
172                        if (parent != null) {
173                            parent = node.guiElement;
174                        }
175                        else {
176                            Console
177                            .traceln(Level.SEVERE,
178                                     "Multiple nodes in the internal GUI model match the same GUI element. "
179                                             + "This should not be the case and the GUI model is probably invalid.");
180                        }
181                    }
182                }
183            }
184        }
185
186        return parent;
187    }
188
189    /**
190     * <p>
191     * Returns all root GUI elements of the model or an empty list, if the model is empty
192     * </p>
193     *
194     * @return As described
195     */
196    public List<IGUIElement> getRootElements() {
197        List<IGUIElement> roots = new ArrayList<IGUIElement>();
198
199        if (root.children != null) {
200            for (TreeNode rootChild : root.children) {
201                roots.add(rootChild.guiElement);
202            }
203        }
204
205        return roots;
206    }
207   
208    /**
209     * returns a traverser for the GUI model to have efficient access to the tree of GUI elements
210     * without having direct access.
211     *
212     * @return a traverser
213     */
214    public Traverser getTraverser() {
215        return new Traverser();
216    }
217
218    /**
219     * returns a traverser for the GUI model starting at the given GUI element. Returns null, if
220     * the GUI element is not part of the model.
221     *
222     * @return a traverser
223     */
224    public Traverser getTraverser(IGUIElement startingAt) {
225        TreeNode node = findNode(startingAt);
226       
227        if (node != null) {
228            Traverser traverser = new Traverser();
229            traverser.navigateTo(node);
230            return traverser;
231        }
232        else {
233            return null;
234        }
235    }
236
237    /**
238     * <p>
239     * dumps the GUI model to the provided stream. Each node is represented through its toString()
240     * method. If a node has children, those are dumped indented and surrounded by braces.
241     * </p>
242     *
243     * @param out
244     *            The stream to dump the textual representation of the model to
245     * @param encoding
246     *            The encoding to be used while dumping
247     */
248    public void dump(OutputStream out, String encoding) {
249        PrintStream stream;
250
251        if (out instanceof PrintStream) {
252            stream = (PrintStream) out;
253        }
254        else {
255            String enc = encoding == null ? "UTF-8" : encoding;
256            try {
257                stream = new PrintStream(out, true, enc);
258            }
259            catch (UnsupportedEncodingException e) {
260                throw new IllegalArgumentException("encodind " + enc + " not supported");
261            }
262        }
263
264        for (TreeNode node : root.children) {
265            dumpGUIElement(stream, node, "");
266        }
267    }
268
269    /**
270     * <p>
271     * By calling this method, the GUIModel is traversed and similar nodes are merged.
272     * </p>
273     *
274     */
275    public void condenseModel() {
276        mergeSubTree(root);
277    }
278   
279    /**
280     * <p>
281     * Merges the tree nodes of two GUI elements. The GUI elements need to have the same parent.
282     * </p>
283     *
284     * @param guiElement1
285     *            the first merge GUI element
286     * @param guiElement2
287     *            the second merge GUI element
288     * @throws IllegalArgumentException
289     *             thrown if the two GUI elements do not have the same parent
290     */
291    public void mergeGUIElements(IGUIElement guiElement1, IGUIElement guiElement2)
292        throws IllegalArgumentException
293    {
294        // check if both nodes have the same parent
295        IGUIElement parentElement = guiElement1.getParent();
296        if (parentElement != null && !parentElement.equals(guiElement2.getParent())) {
297            throw new IllegalArgumentException("can only merge nodes with the same parent");
298        }
299
300        // get the TreeNode of the parent of the GUI elements
301        TreeNode parent = findNode(parentElement);
302
303        // get the TreeNodes for both GUI elements
304        TreeNode node1 = findNode(guiElement1);
305        TreeNode node2 = findNode(guiElement2);
306
307        if (node1 == null || node2 == null) {
308            throw new IllegalArgumentException(
309                                               "Error while merging nodes: one element is not part of the GUI model!");
310        }
311
312        TreeNode replacement = mergeTreeNodes(node1, node2);
313
314        if (parent != null) {
315            // remove node1 and node2 from the parent's children and add the replacement instead
316            // assumes that there are no duplicates of node1 and node2
317            if (parent.children != null) {
318                parent.children.set(parent.children.indexOf(node1), replacement);
319                parent.children.remove(node2);
320            }
321        }
322
323    }
324
325    /**
326     * <p>
327     * internally integrates a path as the children of the provided parent node. This method is
328     * recursive and calls itself, for the child of the parent node, that matches the first element
329     * in the remaining path.
330     * </p>
331     *
332     * @param parentNode
333     *            the parent node to add children for
334     * @param guiElementPath
335     *            the path of children to be created starting with the parent node
336     * @param guiElementFactory
337     *            the GUI element factory to be used for instantiating GUI element objects
338     *
339     * @return The GUI element object representing the GUI element denoted by the provided path
340     *
341     * @throws GUIModelException
342     *             thrown in cases such as the GUI element object could not be instantiated
343     */
344    private IGUIElement integratePath(TreeNode parentNode,
345                                      List<? extends IGUIElementSpec> remainingPath,
346                                      IGUIElementFactory guiElementFactory)
347        throws GUIModelException
348    {
349        IGUIElementSpec specToIntegrateElementFor = remainingPath.remove(0);
350
351        TreeNode child = findEqualChild(parentNode, specToIntegrateElementFor);
352        if (child == null) {
353            IGUIElement newElement =
354                guiElementFactory.instantiateGUIElement(specToIntegrateElementFor,
355                                                        parentNode.guiElement);
356
357            child = parentNode.addChild(newElement);
358        }
359
360        if (remainingPath.size() > 0) {
361            return integratePath(child, remainingPath, guiElementFactory);
362        }
363        else {
364            return child.guiElement;
365        }
366    }
367
368    /**
369     * <p>
370     * Searches the children of a tree node to see if the {@link IGUIElementSpec} of equals the
371     * specification of the {@link TreeNode#guiElement} of the child. If a match is found, the child
372     * is returned.
373     * </p>
374     *
375     * @param parentNode
376     *            parent node whose children are searched
377     * @param specToMatch
378     *            specification that is searched for
379     * @return matching child node or null if no child matches
380     */
381    private TreeNode findEqualChild(TreeNode parentNode, IGUIElementSpec specToMatch) {
382        if (parentNode.children != null) {
383            for (TreeNode child : parentNode.children) {
384                if (specToMatch.equals(child.guiElement.getSpecification())) {
385                    return child;
386                }
387            }
388        }
389        return null;
390    }
391
392    /**
393     * <p>
394     * Merges all similar nodes in the sub-tree of the GUI model defined by the subTreeRoot.
395     * </p>
396     * <p>
397     * The merging order is a bottom-up. This means, that we first call mergeSubTree recursively for
398     * the grand children of the subTreeRoot, before we merge subTreeRoot.
399     * </p>
400     * <p>
401     * The merging strategy is top-down. This means, that every time we merge two child nodes, we
402     * call mergeSubTree recursively for all children of the merged nodes in order to check if we
403     * can merge the children, too.
404     * </p>
405     *
406     * @param subTreeRoot
407     *            root node of the sub-tree that is merged
408     */
409    private void mergeSubTree(TreeNode subTreeRoot) {
410        if (subTreeRoot.children == null || subTreeRoot.children.isEmpty()) {
411            return;
412        }
413
414        // lets first merge the grand children of the parentNode
415        for (TreeNode child : subTreeRoot.children) {
416            mergeSubTree(child);
417        }
418
419        boolean performedMerge;
420
421        do {
422            performedMerge = false;
423            for (int i = 0; !performedMerge && i < subTreeRoot.children.size(); i++) {
424                IGUIElementSpec elemSpec1 =
425                    subTreeRoot.children.get(i).guiElement.getSpecification();
426                for (int j = i + 1; !performedMerge && j < subTreeRoot.children.size(); j++) {
427                    IGUIElementSpec elemSpec2 =
428                        subTreeRoot.children.get(j).guiElement.getSpecification();
429                    if (elemSpec1.getSimilarity(elemSpec2)) {
430                        TreeNode replacement =
431                            mergeTreeNodes(subTreeRoot.children.get(i), subTreeRoot.children.get(j));
432
433                        subTreeRoot.children.set(i, replacement);
434                        subTreeRoot.children.remove(j);
435                        performedMerge = true;
436                        i--;
437                        break;
438                    }
439                }
440            }
441        }
442        while (performedMerge);
443    }
444
445    /**
446     * <p>
447     * merges two nodes with each other. Merging means registering the GUI element objects with each
448     * other for equality checks. Further it add all children of both nodes to a new replacing node.
449     * Afterwards, all similar nodes of the replacement node are merged as well.
450     * </p>
451     *
452     * @param treeNode1
453     *            the first of the two nodes to be merged
454     * @param treeNode2
455     *            the second of the two nodes to be merged
456     * @return a tree node being the merge of the two provided nodes.
457     */
458    private TreeNode mergeTreeNodes(TreeNode treeNode1, TreeNode treeNode2) {
459        // the following two lines are needed to preserve the references to the existing GUI
460        // elements. If two elements are the same, one should be deleted to make the elements
461        // singletons again. However, there may exist references to both objects. To preserve
462        // these, we simply register the equal GUI elements with each other so that an equals
463        // check can return true.
464        treeNode1.guiElement.addEqualGUIElement(treeNode2.guiElement);
465        treeNode2.guiElement.addEqualGUIElement(treeNode1.guiElement);
466       
467        // and now a replacement node that is the merge of treeNode1 and treeNode2 is created
468        TreeNode replacement = new TreeNode();
469        replacement.guiElement = treeNode1.guiElement;
470        if (treeNode1.children != null) {
471            for (TreeNode child : treeNode1.children) {
472                replacement.addChildNode(child);
473            }
474        }
475        if (treeNode2.children != null) {
476            for (TreeNode child : treeNode2.children) {
477                replacement.addChildNode(child);
478            }
479        }
480
481        mergeSubTree(replacement);
482
483        replacement.guiElement.updateSpecification(treeNode2.guiElement.getSpecification());
484
485        // finally, update the known nodes list
486        // if you don't do this getChildren will return wrong things and very bad things happen!
487        allNodes.remove(treeNode1);
488        allNodes.remove(treeNode2);
489        allNodes.add(replacement);
490
491        return replacement;
492    }
493
494    /**
495     * <p>
496     * dumps a GUI element to the stream. A dump contains the toString() representation of the GUI
497     * element as well as a indented list of its children surrounded by braces. Therefore, not the
498     * GUI element itself but its tree node is provided to have an efficient access to its children
499     * </p>
500     *
501     * @param out
502     *            {@link PrintStream} where the guiElement is dumped to
503     * @param node
504     *            the guiElement's tree node of which the string representation is dumped
505     * @param indent
506     *            indent string of the dumping
507     */
508    private void dumpGUIElement(PrintStream out, TreeNode node, String indent) {
509        out.print(indent);
510        out.print(node.guiElement);
511
512        if ((node.children != null) && (node.children.size() > 0)) {
513            out.println(" {");
514
515            for (TreeNode child : node.children) {
516                dumpGUIElement(out, child, indent + "  ");
517            }
518
519            out.print(indent);
520            out.print("}");
521        }
522
523        out.println();
524    }
525   
526    /**
527     * <p>
528     * Retrieves the TreeNode associated with a GUI element. Returns null if no such TreeNode is
529     * found.
530     * </p>
531     *
532     * @param element
533     *            the GUI element
534     * @return associated TreeNode; null if no such node exists
535     */
536    private TreeNode findNode(IGUIElement element) {
537        if (element == null) {
538            return null;
539        }
540
541        TreeNode result = null;
542        for (TreeNode node : allNodes) {
543            if (node.guiElement.equals(element)) {
544                if (result == null) {
545                    result = node;
546                }
547                else {
548                    Console
549                        .traceln(Level.SEVERE,
550                                 "Multiple nodes in the internal GUI model match the same GUI element. "
551                                     + "This should not be the case and the GUI model is probably invalid.");
552                }
553            }
554        }
555        return result;
556    }
557
558    /**
559     * <p>
560     * Used externally for tree traversal without providing direct access to the tree nodes
561     * </p>
562     *
563     * @version 1.0
564     * @author Patrick Harms, Steffen Herbold
565     */
566    public class Traverser {
567       
568        /**
569         * <p>
570         * the stack of nodes on which the traverser currently works
571         * </p>
572         */
573        private Stack<StackEntry> nodeStack = new Stack<StackEntry>();
574       
575        /**
576         * <p>
577         * initializes the traverser by adding the root node of the GUI model to the stack
578         * </p>
579         */
580        private Traverser() {
581            nodeStack.push(new StackEntry(root, 0));
582        }
583       
584        /**
585         * <p>
586         * returns the first child of the current GUI element. On the first call of this method on
587         * the traverser the first of the root GUI elements of the GUI model is returned. If the
588         * current GUI element does not have children, the method returns null. If the GUI model
589         * is empty, then a call to this method will return null. The returned GUI element is the
590         * next one the traverser points to.
591         * </p>
592         *
593         * @return as described.
594         */
595        public IGUIElement firstChild() {
596            return pushChild(0);
597        }
598       
599        /**
600         * <p>
601         * returns true, if the current GUI element has a first child, i.e. if the next call to the
602         * method {@link #firstChild()} would return a GUI element or null.
603         * </p>
604         *
605         * @return as described
606         */
607        public boolean hasFirstChild() {
608            return
609                (nodeStack.peek().treeNode.children != null) &&
610                (nodeStack.peek().treeNode.children.size() > 0);
611        }
612       
613        /**
614         * <p>
615         * returns the next sibling of the current GUI element. If there is no further sibling,
616         * null is returned. If the current GUI element is one of the root nodes, the next root
617         * node of the GUI model is returned. The returned GUI element is the next one the
618         * traverser points to.
619         * </p>
620         *
621         * @return as described
622         */
623        public IGUIElement nextSibling() {
624            int lastIndex = nodeStack.pop().index;
625           
626            IGUIElement retval = pushChild(lastIndex + 1);
627            if (retval == null) {
628                pushChild(lastIndex);
629            }
630           
631            return retval;
632        }
633       
634        /**
635         * <p>
636         * returns true, if the current GUI element has a further sibling, i.e. if a call to the
637         * method {@link #nextSibling()} will return a GUI element;
638         * </p>
639         *
640         * @return as described
641         */
642        public boolean hasNextSibling() {
643            boolean result = false;
644            if (nodeStack.size() > 1) {
645                StackEntry entry = nodeStack.pop();
646                result = nodeStack.peek().treeNode.children.size() > (entry.index + 1);
647                pushChild(entry.index);
648            }
649           
650            return result;
651        }
652       
653        /**
654         * <p>
655         * returns the parent GUI element of the current GUI element. If the current GUI element
656         * is a root node, null is returned. If there is no current GUI element yet as the method
657         * {@link #firstChild()} was not called yet, null is returned.
658         * </p>
659         *
660         * @return as described
661         */
662        public IGUIElement parent() {
663            IGUIElement retval = null;
664           
665            if (nodeStack.size() > 1) {
666                nodeStack.pop();
667                retval = nodeStack.peek().treeNode.guiElement;
668            }
669           
670            return retval;
671        }
672       
673        /**
674         * <p>
675         * internal method used for changing the state of the traverser. I.e. to switch to a
676         * specific child GUI element of the current one.
677         * </p>
678         */
679        private IGUIElement pushChild(int index) {
680            IGUIElement retVal = null;
681           
682            if ((nodeStack.peek().treeNode.children != null) &&
683                (nodeStack.peek().treeNode.children.size() > index))
684            {
685                nodeStack.push
686                    (new StackEntry(nodeStack.peek().treeNode.children.get(index), index));
687                retVal = nodeStack.peek().treeNode.guiElement;
688            }
689           
690            return retVal;
691        }
692       
693        /**
694         * <p>
695         * navigates the traverser to the given node in the GUI model
696         * </p>
697         */
698        private boolean navigateTo(TreeNode node) {
699            if (hasFirstChild()) {
700                IGUIElement childElement = firstChild();
701           
702                while (childElement != null) {
703                    if (childElement.equals(node.guiElement)) {
704                        return true;
705                    }
706                    else if (navigateTo(node)) {
707                        return true;
708                    }
709                    else {
710                        childElement = nextSibling();
711                    }
712                }
713           
714                parent();
715            }
716           
717            return false;
718        }
719
720        /**
721         * <p>
722         * internal class needed to fill the stack with nodes of the GUI models and their
723         * respective index in the children of the parent node.
724         * </p>
725         */
726        private class StackEntry {
727           
728            /** */
729            private TreeNode treeNode;
730           
731            /** */
732            private int index;
733           
734            /**
735             * <p>
736             * creates a new stack entry.
737             * </p>
738             */
739            private StackEntry(TreeNode treeNode, int index) {
740                this.treeNode = treeNode;
741                this.index = index;
742            }
743        }
744    }
745
746    /**
747     * <p>
748     * Used internally for building up the tree of GUI elements.
749     * </p>
750     *
751     * @version 1.0
752     * @author Patrick Harms, Steffen Herbold
753     */
754    private class TreeNode implements Serializable {
755
756        /**  */
757        private static final long serialVersionUID = 1L;
758
759        /**
760         * <p>
761         * GUI element associated with the TreeNode.
762         * </p>
763         */
764        private IGUIElement guiElement;
765
766        /**
767         * <p>
768         * Children of the TreeNode.
769         * </p>
770         */
771        private List<TreeNode> children;
772
773        /**
774         * <p>
775         * Adds a child to the current node while keeping all lists of nodes up to date
776         * </p>
777         *
778         * @param guiElement
779         *            GUI element that will be associated with the new child
780         * @return the added child
781         */
782        private TreeNode addChild(IGUIElement guiElement) {
783            if (children == null) {
784                children = new ArrayList<TreeNode>();
785            }
786
787            TreeNode child = new TreeNode();
788            child.guiElement = guiElement;
789            children.add(child);
790
791            allNodes.add(child);
792
793            return child;
794        }
795
796        /**
797         *
798         * <p>
799         * Adds a TreeNode as child to the current node. This way, the whole sub-tree is added.
800         * </p>
801         *
802         * @param node
803         *            child node that is added
804         * @return node that has been added
805         */
806        private TreeNode addChildNode(TreeNode node) {
807            if (children == null) {
808                children = new ArrayList<TreeNode>();
809            }
810            children.add(node);
811            return node;
812        }
813
814        /*
815         * (non-Javadoc)
816         *
817         * @see java.lang.Object#toString()
818         */
819        @Override
820        public String toString() {
821            return guiElement.toString();
822        }
823    }
824}
Note: See TracBrowser for help on using the repository browser.