Mercurial > hg > ccmieditor
comparison java/src/uk/ac/qmul/eecs/ccmi/diagrammodel/EdgeReferenceHolderMutableTreeNode.java @ 0:9418ab7b7f3f
Initial import
author | Fiore Martin <fiore@eecs.qmul.ac.uk> |
---|---|
date | Fri, 16 Dec 2011 17:35:51 +0000 |
parents | |
children | 9e67171477bc |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:9418ab7b7f3f |
---|---|
1 /* | |
2 CCmI Editor - A Collaborative Cross-Modal Diagram Editing Tool | |
3 | |
4 Copyright (C) 2011 Queen Mary University of London (http://ccmi.eecs.qmul.ac.uk/) | |
5 | |
6 This program is free software: you can redistribute it and/or modify | |
7 it under the terms of the GNU General Public License as published by | |
8 the Free Software Foundation, either version 3 of the License, or | |
9 (at your option) any later version. | |
10 | |
11 This program is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
17 along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 */ | |
19 package uk.ac.qmul.eecs.ccmi.diagrammodel; | |
20 | |
21 /** | |
22 * This class is a special tree node which holds the EdgeReferenceMutableTreeNode | |
23 * in the tree layout, where It is normally placed as a Node's child. | |
24 * | |
25 * | |
26 */ | |
27 @SuppressWarnings("serial") | |
28 public class EdgeReferenceHolderMutableTreeNode extends DiagramModelTreeNode { | |
29 | |
30 public EdgeReferenceHolderMutableTreeNode(Object userObj){ | |
31 super(userObj); | |
32 } | |
33 | |
34 @Override | |
35 public String toString(){ | |
36 StringBuilder builder = new StringBuilder(super.toString()); | |
37 builder.append(" (").append(getChildCount()).append(")"); | |
38 return builder.toString(); | |
39 } | |
40 | |
41 /** | |
42 * Return a String representing this object for this tree node in a way more suitable | |
43 * for a text to speech synthesizer to read, than toString(). | |
44 * @return a String suitable for text to speech synthesis | |
45 */ | |
46 @Override | |
47 public String spokenText(){ | |
48 StringBuilder builder = new StringBuilder(getName()); | |
49 builder.append(", "); | |
50 builder.append(getChildCount() == 0 ? "empty" : getChildCount()); | |
51 if(!"".equals(notes)){ | |
52 builder.append(NOTES_SPEAK); | |
53 } | |
54 if(!bookmarkKeys.isEmpty()) | |
55 builder.append(BOOKMARK_SPEAK); | |
56 return builder.toString(); | |
57 } | |
58 } |