1 /*****************************************************/
\r
2 /* This java file is a part of the */
\r
4 /* - Plouf's Java IRC Client - */
\r
6 /* Copyright (C) 2002 - 2004 Philippe Detournay */
\r
8 /* All contacts : theplouf@yahoo.com */
\r
10 /* PJIRC is free software; you can redistribute */
\r
11 /* it and/or modify it under the terms of the GNU */
\r
12 /* General Public License as published by the */
\r
13 /* Free Software Foundation; version 2 or later of */
\r
16 /* PJIRC is distributed in the hope that it will */
\r
17 /* be useful, but WITHOUT ANY WARRANTY; without */
\r
18 /* even the implied warranty of MERCHANTABILITY or */
\r
19 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
\r
20 /* General Public License for more details. */
\r
22 /* You should have received a copy of the GNU */
\r
23 /* General Public License along with PJIRC; if */
\r
24 /* not, write to the Free Software Foundation, */
\r
25 /* Inc., 59 Temple Place, Suite 330, Boston, */
\r
26 /* MA 02111-1307 USA */
\r
28 /*****************************************************/
\r
33 * A recognized item.
\r
35 public class DrawResultItem {
\r
37 * The item rectangle on display, relative to its parent.
\r
39 public StyledRectangle rectangle;
\r
41 * The item content. This content is the trimmed version of the stripped
\r
42 * content. Characters like parenthesis and braces are also trimmed. For
\r
43 * instance, "(text)" gives "text" in the itemized version. Item is used for
\r
48 * The original word content.
\r
50 public String originalword;
\r
52 * The original word content, but stripped from all special codes.
\r
54 public String originalstrippedword;
\r
56 * The parent DrawResult.
\r
58 public DrawResult parent;
\r
61 public boolean equals(Object o) {
\r
62 if (!(o instanceof DrawResultItem))
\r
64 DrawResultItem i = (DrawResultItem) o;
\r
65 return i.rectangle.equals(rectangle) && i.originalword.equals(originalword)
\r
66 && i.parent.rectangle.equals(parent.rectangle);
\r
70 public int hashCode() {
\r
71 return rectangle.hashCode() + originalword.hashCode();
\r
75 public String toString() {
\r
76 return item + " at " + rectangle + " with parent at " + parent.rectangle;
\r