Source code: com/webobjects/woextensions/WOEventRow.java
1 /*
2 * WOEventRow.java
3 * © Copyright 2001 Apple Computer, Inc. All rights reserved.
4 * This a modified version.
5 * Original license: http://www.opensource.apple.com/apsl/
6 */
7
8 package com.webobjects.woextensions;
9
10 import com.webobjects.appserver.*;
11 import com.webobjects.foundation.*;
12 import com.webobjects.eocontrol.*;
13
14 public class WOEventRow extends WOComponent {
15 public EOEvent object;
16 public EOEvent event;
17 public WOEventDisplayPage controller;
18 public int displayMode;
19
20 public WOEventRow(WOContext aContext) {
21 super(aContext);
22 }
23
24 public String loopCount()
25 {
26 if (object == event)
27 return "1x";
28 else
29 return ((EOAggregateEvent)object).events().count()+"x";
30 }
31
32 public String eventDuration()
33 {
34 return controller.durationOfEvent(object)+" ms";
35 }
36
37 public String comment()
38 {
39 return object.comment();
40 }
41
42 public String title()
43 {
44 return object.title();
45 }
46
47 //--------------------------------------------------
48
49 public String hyperlinkTitle()
50 {
51 return title();
52 }
53
54 public String descriptionTitle()
55 {
56 return comment();
57 }
58
59 public double percentOfMaxTime()
60 {
61 return (double)controller.durationOfEvent(object) / (double)controller.topmostDurationValue();
62 }
63
64 }