source: trunk/src/org/expeditee/actions/Debug.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.5 KB
Line 
1/**
2 * Debug.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.actions;
20
21import java.awt.Graphics;
22import java.awt.Robot;
23import java.util.List;
24import java.util.concurrent.TimeUnit;
25import java.util.stream.Collectors;
26
27import javax.swing.JFrame;
28import javax.swing.JPanel;
29
30import org.expeditee.core.Colour;
31import org.expeditee.gio.swing.SwingGraphicsManager;
32import org.expeditee.gio.swing.SwingInputManager;
33import org.expeditee.gui.DisplayController;
34import org.expeditee.gui.FrameCreator;
35import org.expeditee.gui.FrameIO;
36import org.expeditee.gui.MessageBay;
37import org.expeditee.items.Constraint;
38import org.expeditee.items.Item;
39
40import com.sun.glass.events.KeyEvent;
41
42/**
43 * This class is used for temporary debugging actions that will get removed from
44 * the final product.
45 *
46 * @author jdm18
47 *
48 */
49public class Debug {
50
51 /**
52 * Outputs the list of constraints all Items in the current Frame have.
53 */
54 public static void ShowConstraints() {
55 List<Item> items = DisplayController.getCurrentFrame().getSortedItems();
56
57 for (Item i : items)
58 if (i.isLineEnd()) {
59 System.out.println(i.getID());
60
61 for (Constraint c : i.getConstraints())
62 if (c.getOppositeEnd(i) != null)
63 System.out.println("\t"
64 + c.getOppositeEnd(i).getID());
65 else
66 System.out.println("\tNULL");
67
68 System.out.println("------------");
69 }
70
71 System.out.println("==================");
72 }
73
74 public static void PrintLine() {
75 System.out.println("Action");
76 }
77
78 @SuppressWarnings("serial")
79 public static void GraphicsTranslateTest() {
80 final JFrame f = new JFrame();
81 f.setContentPane(new JPanel() {
82 public void paintComponent(Graphics g) {
83 final int pos = 10;
84 final int size = 100;
85 int translate = 10;
86 for(int i = 0; i < 5; i++) {
87 g.translate(translate, translate);
88 g.drawRect(pos, pos, size, size);
89 g.translate(-translate, -translate);
90 }
91 }
92 });
93 f.setSize(400, 400);
94 f.setVisible(true);
95 }
96
97 public static void RobotTest() {
98 try {
99 final Robot screenWin = new Robot();//SwingInputManager.getInstance()._robot;
100 while(true) {
101 System.err.println("Sleeping 2 secs");
102 TimeUnit.SECONDS.sleep(2);
103 System.err.println("Robot move to (100,300)");
104 screenWin.mouseMove(100, 300);
105 }
106 } catch (Exception e) {
107 e.printStackTrace();
108 }
109 }
110
111 public static void TestFastInput() {
112 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_A, 'A'));
113 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_B, 'B'));
114 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_C, 'C'));
115 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_D, 'D'));
116 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_E, 'E'));
117 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_F, 'F'));
118 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_G, 'G'));
119 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_H, 'H'));
120 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_I, 'I'));
121 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_J, 'J'));
122 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_K, 'K'));
123 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_L, 'L'));
124 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_M, 'M'));
125 SwingInputManager.getInstance().keyTyped(new java.awt.event.KeyEvent(SwingGraphicsManager.getInstance().getJFrame(), KeyEvent.PRESS, System.currentTimeMillis(), 0, KeyEvent.VK_N, 'N'));
126 }
127
128 public static void HowManyMinWidths() {
129 MessageBay.displayMessage(DisplayController.getCurrentFrame().getSortedItems().stream().filter(t -> t.getMinWidth() != null).collect(Collectors.toList()).size() + "");
130 }
131
132 public static void FrameCreatorTest() {
133 FrameCreator creator = new FrameCreator("testFrameset", FrameIO.FRAME_PATH, "TestFrameset", FrameCreator.ExistingFramesetOptions.AppendSegregatedFrames, false, null);
134 creator.addText("Test1", Colour.CYAN, null, null, true);
135
136 creator = new FrameCreator("testFrameset", FrameIO.FRAME_PATH, "TestFrameset", FrameCreator.ExistingFramesetOptions.AppendSegregatedFrames, false, null);
137 creator.addText("Test2", Colour.CYAN, null, null, true);
138
139 creator = new FrameCreator("testFrameset", FrameIO.FRAME_PATH, "TestFrameset", FrameCreator.ExistingFramesetOptions.OverrideExistingFrames, false, null);
140 creator.addText("Test3", Colour.CYAN, null, null, true);
141 }
142}
Note: See TracBrowser for help on using the repository browser.