Changeset 1040 for trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/sandboxapp/CreateClickstreamImageFromTaskTreeDemoApp.java
- Timestamp:
- 01/16/13 17:51:51 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/sandboxapp/CreateClickstreamImageFromTaskTreeDemoApp.java
r1030 r1040 1 // Copyright 2012 Georg-August-Universität Göttingen, Germany 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 1 15 package de.ugoe.cs.autoquest.usability.sandboxapp; 2 16 … … 21 35 import de.ugoe.cs.autoquest.usability.testutil.GenerateTaskTreeUtil; 22 36 37 /** 38 * <p> 39 * TODO comment 40 * </p> 41 * 42 * @author Alexander Deicke 43 */ 23 44 public class CreateClickstreamImageFromTaskTreeDemoApp { 24 45 25 46 private static final String fileToParse = "javatrace.xml"; 26 47 27 48 private static final String clickstreamFilename = "clickstream.png"; 28 49 29 50 /** 30 51 * <p> 31 52 * TODO: comment 32 53 * </p> 33 * 54 * 34 55 * @param args 35 * @throws IOException 56 * @throws IOException 36 57 */ 37 58 public static void main(String[] args) throws IOException { 38 59 ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromFile(fileToParse); 39 60 FilterStatistic mouseInteractions = filterMouseInteractions(taskTree); 40 61 41 62 BufferedImage clickstreamImage = new BufferedImage(1024, 768, BufferedImage.TYPE_INT_ARGB); 42 63 Graphics2D drawArea = clickstreamImage.createGraphics(); 43 64 drawArea.setColor(Color.BLACK); 44 drawArea.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 45 65 drawArea.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 66 RenderingHints.VALUE_ANTIALIAS_ON); 67 46 68 drawClickstream(mouseInteractions, drawArea); 47 69 … … 52 74 int xb = -1; 53 75 int yb = -1; 54 55 for(ITaskTreeNode node : mouseInteractions.nodesMatchedFilter()) { 56 MouseButtonInteraction interaction = (MouseButtonInteraction) ((IEventTask) node).getEventType(); 76 77 for (ITaskTreeNode node : mouseInteractions.nodesMatchedFilter()) { 78 MouseButtonInteraction interaction = 79 (MouseButtonInteraction) ((IEventTask) node).getEventType(); 57 80 int x = interaction.getX(); 58 81 int y = interaction.getY(); 59 g2.fillOval(x,y,1,1); 60 if(xb != -1 && y != -1) g2.drawLine(x, y, xb, yb); 82 g2.fillOval(x, y, 1, 1); 83 if (xb != -1 && y != -1) 84 g2.drawLine(x, y, xb, yb); 61 85 xb = x; 62 86 yb = y; 63 87 } 64 88 } 65 89 66 90 private static FilterStatistic filterMouseInteractions(ITaskTree taskTree) { 67 91 return new TaskTreeFilter(new IterativeDFSFilterStrategy())
Note: See TracChangeset
for help on using the changeset viewer.