source: trunk/src/org/expeditee/items/XRayable.java@ 1415

Last change on this file since 1415 was 1415, checked in by bln4, 5 years ago

Renamed Frame.getItems() to Frame.getSortedItems() to better represent its functionality.

-> org.apollo.ApolloGestureActions
-> org.apollo.ApolloSystem
-> org.expeditee.actions.Actions
-> org.expeditee.actions.Debug
-> org.expeditee.actions.ExploratorySearchActions
-> org.expeditee.actions.JfxBrowserActions
-> org.expeditee.actions.Misc
-> org.expeditee.actions.Navigation
-> org.expeditee.actions.ScriptBase
-> org.expeditee.actions.Simple
-> org.expeditee.agents.ComputeTree
-> org.expeditee.agents.CopyTree
-> org.expeditee.agents.DisplayComet
-> org.expeditee.agents.DisplayTree
-> org.expeditee.agents.DisplayTreeLeaves
-> org.expeditee.agents.GraphFramesetLinks
-> org.expeditee.agents.TreeProcessor
-> org.expeditee.gio.gesture.StandardGestureActions
-> org.expeditee.gui.DisplayController
-> org.expeditee.gui.FrameCreator
-> org.expeditee.gui.FrameIO
-> org.expeditee.io.DefaultTreeWriter
-> org.expeditee.io.JavaWriter
-> org.expeditee.io.PDF2Writer
-> org.expeditee.io.TXTWriter
-> org.expeditee.io.WebParser
-> org.expeditee.io.flowlayout.XGroupItem
-> org.expeditee.items.Dot
-> org.expeditee.items.Item
-> org.expeditee.items.ItemUtils
-> org.expeditee.network.FrameShare
-> org.expeditee.stats.TreeStats


Created ItemsList class to wrap ArrayList<Item>. Frames now use this new class to store its body list (used for display) as well as its primaryBody and surrogateBody.

-> org.expeditee.agents.Format
-> org.expeditee.agents.HFormat
-> org.expeditee.gio.gesture.StandardGestureActions
-> org.expeditee.gui.Frame
-> org.expeditee.gui.FrameUtils


Refactorted Frame.setResort(bool) to Frame.invalidateSorted() to better function how it is intended to with a more accurate name.

-> org.expeditee.agents.Sort


When writing out .exp files and getting attributes to respond to LEFT + RIGHT click, boolean items are by default true. This has always been the case. An ammendment to this is that defaults can now be established.
Also added 'EnterClick' functionality. If cursored over a item with this property and you press enter, it acts as if you have clicked on it instead.

-> org.expeditee.assets.resources-public.framesets.authentication.1.exp to 6.exp
-> org.expeditee.gio.gesture.StandardGestureActions
-> org.expeditee.gio.input.KBMInputEvent
-> org.expeditee.gio.javafx.JavaFXConversions
-> org.expeditee.gio.swing.SwingConversions
-> org.expeditee.gui.AttributeUtils
-> org.expeditee.io.Conversion
-> org.expeditee.io.DefaultFrameWriter
-> org.expeditee.items.Item


Fixed a bug caused by calling Math.abs on Integer.MIN_VALUE returning unexpected result. Due to zero being a thing, you cannot represent Math.abs(Integer.MIN_VALUE) in a Integer object. The solution is to use Integer.MIN_VALUE + 1 instead of Integer.MIN_VALUE.

-> org.expeditee.core.bounds.CombinationBounds
-> org.expeditee.io.flowlayout.DimensionExtent


Recoded the contains function in EllipticalBounds so that intersection tests containing circles work correctly.

-> org.expeditee.core.bounds.EllipticalBounds


Added toString() to PolygonBounds to allow for useful printing during debugging.

-> org.expeditee.core.bounds.PolygonBounds

Implemented Surrogate Mode!

-> org.expeditee.encryption.io.EncryptedExpReader
-> org.expeditee.encryption.io.EncryptedExpWriter
-> org.expeditee.encryption.items.surrogates.EncryptionDetail
-> org.expeditee.encryption.items.surrogates.Label
-> org.expeditee.gui.FrameUtils
-> org.expeditee.gui.ItemsList
-> org.expeditee.items.Item
-> org.expeditee.items.Text


???? Use Integer.MAX_VALUE cast to a float instead of Float.MAX_VALUE. This fixed some bug which I cannot remember.

-> org.expeditee.gio.TextLayoutManager
-> org.expeditee.gio.swing.SwingTextLayoutManager


Improved solution for dealing with the F10 key taking focus away from Expeditee due to it being a assessibility key.

-> org.expeditee.gio.swing.SwingInputManager


Renamed variable visibleItems in FrameGraphics.paintFrame to itemsToPaintCanditates to better represent functional intent.

-> org.expeditee.gui.FrameGraphics


Improved checking for if personal resources exist before recreating them

-> org.expeditee.gui.FrameIO


Repeated messages to message bay now have a visual feedback instead of just a beep. This visual feedback is in the form of a count of the amount of times it has repeated.

-> org.expeditee.gui.MessageBay


Updated comment on the Vector class to explain what vectors are.

-> org.expeditee.gui.Vector


Added constants to represent all of the property keys in DefaultFrameReader and DefaultFrameWriter.

-> org.expeditee.io.DefaultFrameReader
-> org.expeditee.io.DefaultFrameWriter


Updated the KeyList setting to be more heirarcial with how users will store their Secrets.

-> org.expeditee.settings.identity.secrets.KeyList

File size: 6.4 KB
Line 
1/**
2 * XRayable.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.items;
20
21import java.util.Collection;
22import java.util.LinkedList;
23import java.util.List;
24
25import org.expeditee.core.Colour;
26import org.expeditee.core.Point;
27import org.expeditee.gui.DisplayController;
28
29public abstract class XRayable extends Item {
30
31
32 protected Text _source = null;
33
34 public XRayable(Text source){
35 super();
36 _source = source;
37 source.setHidden(true);
38 source.addEnclosure(this);
39 }
40
41 public Collection<Item> getItemsToSave() {
42 Collection<Item> toSave = new LinkedList<Item>();
43 toSave.add(_source);
44 return toSave;
45 }
46
47 @Override
48 public Collection<Item> getConnected() {
49 Collection<Item> conn = super.getConnected();
50 conn.add(_source);
51 return conn;
52 }
53
54 @Override
55 public void addAllConnected(Collection<Item> connected) {
56 super.addAllConnected(connected);
57 if (!connected.contains(_source)) {
58 connected.add(_source);
59 }
60 }
61
62 /*
63 * (non-Javadoc)
64 *
65 * @see org.expeditee.items.Item#merge(org.expeditee.items.Item, int, int)
66 */
67 @Override
68 public Item merge(Item merger, int mouseX, int mouseY) {
69 return merger;
70 }
71
72 /**
73 * Returns the Text Item that was used to create this Picture object. This
74 * is required when saving the Frame.
75 *
76 * @return The Text Item used to create this Picture.
77 */
78 public Text getSource() {
79 return _source;
80 }
81
82 @Override
83 public int getID() {
84 return _source.getID();
85 }
86
87 @Override
88 public void setID(int newID) {
89 _source.setID(newID);
90 }
91
92 @Override
93 public int getY() {
94 return _source.getY();
95 }
96
97 @Override
98 public int getX() {
99 return _source.getX();
100 }
101
102 @Override
103 public Colour getColor() {
104 return _source.getColor();
105 }
106
107 @Override
108 public void setColor(Colour c) {
109 _source.setColor(c);
110 invalidateCommonTrait(ItemAppearence.ForegroundColorChanged);
111 }
112
113 @Override
114 public void setBackgroundColor(Colour c) {
115 _source.setBackgroundColor(c);
116 }
117
118 @Override
119 public void setFillColor(Colour c) {
120 _source.setFillColor(c);
121 }
122
123 @Override
124 public void setBorderColor(Colour c) {
125 _source.setBorderColor(c);
126 invalidateCommonTrait(ItemAppearence.BorderColorChanged);
127 }
128
129 @Override
130 public void setGradientColor(Colour c) {
131 _source.setGradientColor(c);
132 }
133
134 @Override
135 public void setTooltips(List<String> tooltips) {
136 _source.setTooltips(tooltips);
137 }
138
139 @Override
140 public void setTooltip(String tooltip) {
141 _source.setTooltip(tooltip);
142 }
143
144 @Override
145 public List<String> getTooltip() {
146 return _source.getTooltip();
147 }
148
149 @Override
150 public float getThickness() {
151 return _source.getThickness();
152 }
153
154 @Override
155 public Integer getAnchorLeft() {
156 return _source.getAnchorLeft();
157 }
158
159 @Override
160 public Integer getAnchorRight() {
161 return _source.getAnchorRight();
162 }
163
164 @Override
165 public Integer getAnchorTop() {
166 return _source.getAnchorTop();
167 }
168
169 @Override
170 public Integer getAnchorBottom() {
171 return _source.getAnchorBottom();
172 }
173
174
175 @Override
176 public Colour getBorderColor() {
177 return _source.getBorderColor();
178 }
179
180 @Override
181 public void setThickness(float thick, boolean setConnected) {
182 this.invalidateCommonTrait(ItemAppearence.Thickness);
183 _source.setThickness(thick, setConnected);
184 this.invalidateCommonTrait(ItemAppearence.Thickness);
185 }
186
187 @Override
188 public Colour getBackgroundColor() {
189 return _source.getBackgroundColor();
190 }
191
192 @Override
193 public Colour getFillColor() {
194 return _source.getFillColor();
195 }
196
197 @Override
198 public Colour getGradientColor() {
199 return _source.getGradientColor();
200 }
201
202 @Override
203 public String getFillPattern() {
204 return _source.getFillPattern();
205 }
206
207 @Override
208 public boolean hasLink() {
209 return getLink() != null;
210 }
211
212 @Override
213 public String getLink() {
214 if (_source == null)
215 return null;
216 else
217 return _source.getLink();
218 }
219
220 @Override
221 public void setLink(String frameName) {
222 if (_source == null) {
223 return;
224 }
225 if(frameName == null)
226 invalidateAll();
227 _source.setLink(frameName);
228 invalidateBounds();
229 //TODO: only invalidate the link bit
230 invalidateAll();
231 }
232
233 @Override
234 public void setActions(List<String> action) {
235 if (_source == null){
236 return;
237 }
238 if(action == null || action.size() == 0)
239 invalidateAll();
240 _source.setActions(action);
241 invalidateBounds();
242 invalidateAll();
243 }
244
245 @Override
246 public List<String> getAction() {
247 if (_source == null)
248 return null;
249 else
250 return _source.getAction();
251 }
252
253 @Override
254 public void translate(Point origin, double ratio){
255 //_source.translate(origin, ratio);
256 invalidateBounds();
257 }
258
259 @Override
260 public void setPosition(float x, float y) {
261 //_source.setPosition(x, y);
262
263 }
264
265 @Override
266 public boolean isAnchored() {
267 return _source.isAnchored();
268 }
269
270 @Override
271 public boolean isAnchoredX() {
272 return _source.isAnchoredX();
273 }
274
275 @Override
276 public boolean isAnchoredY() {
277 return _source.isAnchoredY();
278 }
279
280 @Override
281 public void setAnchorTop(Integer anchor) {
282 _source.setAnchorTop(anchor);
283 if (anchor != null)
284 _source.setY(anchor);
285 }
286
287 @Override
288 public void setAnchorBottom(Integer anchor) {
289 _source.setAnchorBottom(anchor);
290 if (anchor != null)
291 _source.setY(DisplayController.getFramePaintAreaHeight() - getHeight() - anchor);
292 }
293
294
295 @Override
296 public void setAnchorLeft(Integer anchor) {
297 _source.setAnchorLeft(anchor);
298 }
299
300 @Override
301 public void setAnchorRight(Integer anchor) {
302 _source.setAnchorRight(anchor);
303 _source.setX(DisplayController.getFramePaintAreaWidth() - anchor - this.getWidth());
304 }
305
306 public boolean refresh(){
307 return true;
308 }
309
310 @Override
311 public void setXY(float x, float y){
312 _source.setXY(x, y);
313 }
314
315 @Override
316 public boolean hasPermission(UserAppliedPermission p) {
317 return _source.hasPermission(p);
318 }
319
320 @Override
321 public void setPermission(PermissionTriple permissionPair) {
322 _source.setPermission(permissionPair);
323 }
324}
Note: See TracBrowser for help on using the repository browser.