source: trunk/src/org/expeditee/agents/DisplayTree.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: 3.6 KB
Line 
1/**
2 * DisplayTree.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.agents;
20
21import org.expeditee.gui.DisplayController;
22import org.expeditee.gui.Frame;
23import org.expeditee.gui.MessageBay;
24import org.expeditee.items.Item;
25import org.expeditee.items.ItemUtils;
26import org.expeditee.items.Text;
27
28/**
29 * Displays the Tree of Frames starting from the given frame. The delay between
30 * frames can be adjusted, either per-frame with the
31 *
32 * @DisplayFramePause tag, or mid-stream with the
33 * @DisplayTreePause tag, both tags should be followed with the desired delay in
34 * ms. The default delay between Frames is 50ms.
35 * @author jdm18
36 *
37 */
38public class DisplayTree extends TreeProcessor {
39
40 public static final int GARBAGE_COLLECTION_THRESHOLD = 100000;
41
42 private Runtime _runtime = Runtime.getRuntime();
43
44 public DisplayTree(String delay) {
45 super(delay);
46 }
47
48 public DisplayTree() {
49 super();
50 }
51
52 @Override
53 public boolean initialise(Frame start, Item launcher) {
54
55 // push current frame on to back-stack
56 DisplayController.addToBack(start);
57
58 return super.initialise(start, launcher);
59 }
60
61 @Override
62 protected void finalise(Frame start) {
63 // return the user to the Frame they started on
64 if (!_stop) {
65 DisplayController.Back();
66 }
67 super.finalise(start);
68 }
69
70 @Override
71 protected void processFrame(Frame toProcess) {
72 long freeMemory = _runtime.freeMemory();
73 if (freeMemory < GARBAGE_COLLECTION_THRESHOLD) {
74 _runtime.gc();
75 MessageBay.displayMessage("Force Garbage Collection!");
76 }
77
78 // FrameUtils.ResponseTimer.restart();
79
80 // ignore loops
81 if (toProcess != DisplayController.getCurrentFrame())
82 DisplayController.setCurrentFrame(toProcess, false);
83 // parse the frame for any pause settings
84 delay(toProcess);
85
86 _frameCount++;
87 }
88
89 /**
90 * Parses through the given Frame to find any
91 *
92 * @DisplayTreePause or
93 * @DisplayFramePause tags, and updates the delay or pause as necessary
94 * @param toSearch
95 */
96 private void delay(Frame toSearch) {
97 // check for change in globaly delay time
98 Item delay = ItemUtils.FindTag(toSearch.getSortedItems(),
99 "@DisplayTreePause:");
100
101 if (delay != null) {
102 try {
103 // attempt to read in the delay value
104 _delay = Long.parseLong(ItemUtils.StripTag(((Text) delay)
105 .getFirstLine(), "@DisplayTreePause"));
106 message("DisplayTree delay changed to: " + _delay + "ms");
107 } catch (NumberFormatException nfe) {
108 message("Incorrect paramter for DisplayTreePause");
109 }
110
111 }
112
113 // check for change in delay for this frame only
114 delay = ItemUtils.FindTag(toSearch.getSortedItems(), "@DisplayFramePause:");
115 if (delay != null) {
116 try {
117 // attempt to read in the delay value
118 long pause = Long.parseLong(ItemUtils.StripTag(((Text) delay)
119 .getFirstLine(), "@DisplayFramePause"));
120 pause(pause);
121 } catch (NumberFormatException nfe) {
122 message("Incorrect paramter for DisplayFramePause");
123 }
124 } else
125 pause(_delay);
126 }
127}
Note: See TracBrowser for help on using the repository browser.