source: trunk/src/org/expeditee/io/flowlayout/XRawItem.java@ 1102

Last change on this file since 1102 was 1102, checked in by davidb, 6 years ago

Reworking of the code-base to separate logic from graphics. This version of Expeditee now supports a JFX graphics as an alternative to SWING

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1/**
2 * XRawItem.java
3 * Copyright (C) 2010 New Zealand Digital Library, http://expeditee.org
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19package org.expeditee.io.flowlayout;
20
21import org.expeditee.items.Item;
22import org.expeditee.items.Text;
23
24public class XRawItem extends XItem
25{
26 protected Item item;
27 protected XGroupItem xgroup;
28
29 public XRawItem(Item item, final XGroupItem belongsTo)
30 {
31 this.item = item;
32 this.xgroup = belongsTo;
33
34 if (item instanceof Text) {
35 // Expecting it to be a text item
36 // For it's bounding rectangle, go with the tighter 'PixelBounds' version
37
38 Text text_item = (Text)item;
39 bounding_rect = text_item.getPixelBoundsUnion();
40 }
41 else {
42 // Just in case it isn't a text item
43 bounding_rect = item.getBoundingBox();
44 }
45
46 }
47
48 public Item getItem()
49 {
50 return item;
51 }
52
53 public XGroupItem getGroup() {
54 return xgroup;
55 }
56
57 public String toString() {
58 return "XRawItem For " + item.toString();
59 }
60
61}
Note: See TracBrowser for help on using the repository browser.