Index: trunk/src/scriptbuilder/gui/panels/TimelineTickPanel.java
===================================================================
--- trunk/src/scriptbuilder/gui/panels/TimelineTickPanel.java	(revision 31)
+++ trunk/src/scriptbuilder/gui/panels/TimelineTickPanel.java	(revision 54)
@@ -7,4 +7,5 @@
 import javax.swing.JPanel;
 import javax.swing.event.MouseInputAdapter;
+import scriptbuilder.gui.IncidentEditorFrame;
 import scriptbuilder.gui.ScriptBuilderFrame;
 import scriptbuilder.gui.ScriptBuilderGuiConstants;
@@ -130,4 +131,40 @@
 
     /**
+     * Update the panel's dimensions based on number of events, zoom level, and
+     * which events are collapsed.
+     *
+     * @param script The main script model
+     */
+    public void update(ScriptIncident incident)
+    {
+        longestLength = ScriptBuilderGuiConstants.TICK_TIMELINE_SMALLEST_LENGTH;
+
+        // Get the stats on the incidents
+        int height = ScriptBuilderGuiConstants.TICK_TOP_MARGIN * 4;
+
+        if (incident != null)
+        {
+            height += incident.collapsed
+                    ? ScriptBuilderGuiConstants.TIMELINE_OPENED_HEIGHT
+                    : ScriptBuilderGuiConstants.TIMELINE_OPENED_HEIGHT;
+            if ((incident.length + incident.offset) > longestLength)
+            {
+                longestLength = incident.length + incident.offset;
+            }
+
+        }
+
+        Dimension newSize = new Dimension(longestLength
+                / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION
+                * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK
+                + ScriptBuilderGuiConstants.TICK_TIMELINE_LEFT_MARGIN + 50,
+                height);
+        this.setPreferredSize(newSize);
+        this.setSize(newSize);
+
+        this.invalidate();
+    }
+
+    /**
      * Refresh the panel. Redraw the ticks based on zoom level, panel
      * dimensions, and offset. If the user is trying to add an event, draw that
@@ -182,10 +219,23 @@
         paintChildren(g);
 
-        if (focused
-                && ((ScriptBuilderFrame) this.getTopLevelAncestor()).currentEventType != null)
-        {
-            EventIconDrawer.DrawEventIcon(g2d,
-                    ((ScriptBuilderFrame) this.getTopLevelAncestor()).currentEventType,
-                    x, y);
+        if (this.getTopLevelAncestor() instanceof ScriptBuilderFrame)
+        {
+            if (focused
+                    && ((ScriptBuilderFrame) this.getTopLevelAncestor()).currentEventType != null)
+            {
+                EventIconDrawer.DrawEventIcon(g2d,
+                        ((ScriptBuilderFrame) this.getTopLevelAncestor()).currentEventType,
+                        x, y);
+            }
+        }
+        if (this.getTopLevelAncestor() instanceof IncidentEditorFrame)
+        {
+            if (focused
+                    && ((IncidentEditorFrame) this.getTopLevelAncestor()).currentEventType != null)
+            {
+                EventIconDrawer.DrawEventIcon(g2d,
+                        ((IncidentEditorFrame) this.getTopLevelAncestor()).currentEventType,
+                        x, y);
+            }
         }
     }
