Index: trunk/src/scriptbuilder/gui/panels/IncidentTimelinePanel.java
===================================================================
--- trunk/src/scriptbuilder/gui/panels/IncidentTimelinePanel.java	(revision 145)
+++ trunk/src/scriptbuilder/gui/panels/IncidentTimelinePanel.java	(revision 150)
@@ -18,4 +18,5 @@
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
+import javax.swing.SwingUtilities;
 import javax.swing.event.MouseInputAdapter;
 import scriptbuilder.gui.IncidentEditorFrame;
@@ -63,5 +64,5 @@
      */
     private boolean hasPopupAccess;
-
+    
     int cursorTime, lastSlice, x, y;
 
@@ -126,16 +127,61 @@
         {
             JPopupMenu menu = new JPopupMenu();
-            JMenuItem eventsMenuItem = new JMenuItem("Events");
-            JMenuItem propsMenuItem = new JMenuItem("Properties");
-            eventsMenuItem.setActionCommand("Edit Events");
-            propsMenuItem.setActionCommand("Modify Incident Properties");
-
             PopupMenuItemListener menuItemListener = new PopupMenuItemListener();
-
-            eventsMenuItem.addActionListener(menuItemListener);
-            propsMenuItem.addActionListener(menuItemListener);
-
-            menu.add(eventsMenuItem);
-            menu.add(propsMenuItem);
+            if(getTopLevelAncestor() instanceof ScriptBuilderFrame)
+            {
+                JMenuItem eventsMenuItem = new JMenuItem("Events");
+                JMenuItem propsMenuItem = new JMenuItem("Properties");
+                eventsMenuItem.setActionCommand("Edit Events");
+                propsMenuItem.setActionCommand("Modify Incident Properties");
+
+                
+
+                eventsMenuItem.addActionListener(menuItemListener);
+                propsMenuItem.addActionListener(menuItemListener);
+
+                menu.add(eventsMenuItem);
+                menu.add(propsMenuItem);
+            }
+            
+            
+            
+            return menu;
+        }
+        private JPopupMenu createPopup(int x, int y)
+        {
+            JPopupMenu menu = new JPopupMenu();
+            PopupMenuItemListener menuItemListener = new PopupMenuItemListener();
+            if(getTopLevelAncestor() instanceof IncidentEditorFrame)
+            {
+                JMenuItem addTimeMenuItem = new JMenuItem("Add time here");
+                JMenuItem removeTimeMenuItem = new JMenuItem("Remove time here");
+                cursorTime =x;
+                
+      
+                //logic that follows is used to "snap" the cursor location to the lines displayed on the timeline panel
+                if (x % ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK
+                        > ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK / 2)
+                {
+                    cursorTime += ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK
+                            - x
+                            % ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK;
+                }
+                else
+                {
+                    cursorTime -= x
+                            % ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK;
+                }
+
+                int newSlice = (cursorTime / ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK);
+
+                newSlice *= ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION;
+                
+                    addTimeMenuItem.setActionCommand("Add Time " + newSlice);
+                    removeTimeMenuItem.setActionCommand("Remove Time " + newSlice);
+                    removeTimeMenuItem.addActionListener(menuItemListener);
+                    addTimeMenuItem.addActionListener(menuItemListener);
+                    menu.add(addTimeMenuItem);
+                    menu.add(removeTimeMenuItem);
+            }
             return menu;
         }
@@ -163,4 +209,53 @@
                     }
                 }
+                if(topFrame instanceof IncidentEditorFrame)
+                {
+                    if(e.getActionCommand().substring(0,8).equals("Add Time"))
+                    {
+                        int offset = Integer.parseInt(e.getActionCommand().substring(9,e.getActionCommand().length()));
+                        String addTimeInput = JOptionPane.showInputDialog("Add time(rounded to lowest 20s): ");
+                        int addTime = 0;
+                        
+                        try
+                        {
+                            addTime = Integer.parseInt(addTimeInput);
+                        }catch(NumberFormatException exception){
+                            addTime = 0;
+                            System.err.print("an invalid number was inputted");
+                        }
+                        
+                        
+                        addTime = addTime-(addTime%20);
+                        
+                        if(offset<=incident.offset+incident.length)
+                        {
+                            incident.moveAllFollowingEvents(offset, addTime);
+                        }
+                    }
+                    if(e.getActionCommand().substring(0,11).equals("Remove Time"))
+                    {
+                        //does addTime but with a negative time
+                        int offset = Integer.parseInt(e.getActionCommand().substring(11,e.getActionCommand().length()).trim());
+                        String addTimeInput = JOptionPane.showInputDialog("Remove time(rounded to lowest 20s): ");
+                        int addTime = 0;
+                        
+                        try
+                        {
+                            addTime = Integer.parseInt(addTimeInput);
+                        }catch(NumberFormatException exception){
+                            addTime = 0;
+                            System.err.print("an invalid number was inputted");
+                        }
+                        
+                        
+                        addTime = -(addTime-(addTime%20));
+                        
+                        if(offset<=incident.offset+incident.length)
+                        {
+                            incident.moveAllFollowingEvents(offset, addTime);
+                        }
+                    }
+                    //add my own handling of click menu here 
+                }
                 topFrame.repaint();
             }
@@ -181,6 +276,16 @@
             if (e.isPopupTrigger() && hasPopupAccess)
             {
-                JPopupMenu popup = createPopup();
-                popup.show(e.getComponent(), currentMouseX, currentMouseY);
+                if(getTopLevelAncestor() instanceof IncidentEditorFrame)
+                {
+                    JPopupMenu popup = createPopup(currentMouseX,currentMouseY);
+                    popup.show(e.getComponent(), currentMouseX, currentMouseY);
+                }else
+                {
+                    JPopupMenu popup = createPopup();
+                    popup.show(e.getComponent(), currentMouseX, currentMouseY);
+                }
+                
+                
+                
             }
         }
@@ -297,4 +402,22 @@
                 }
             }
+//            //code below may be useless
+//            if(SwingUtilities.isRightMouseButton(clickEvent))
+//            {
+//                if (getTopLevelAncestor() instanceof IncidentEditorFrame && false)
+//                {
+//                    incidentEditFrameCurrent = (IncidentEditorFrame) getTopLevelAncestor();
+//                    if(incidentEditFrameCurrent.currentEventType == null)
+//                    {
+//                        JPopupMenu timeAddMenu = new JPopupMenu();
+//                        JMenuItem addTimeButton = new JMenuItem("Add time here");
+//                        //addTimeButton.addActionListener(al);
+//                        timeAddMenu.add(addTimeButton);
+//                        timeAddMenu.show(clickEvent.getComponent(),clickEvent.getX(),clickEvent.getY());
+//                        
+//                    }
+//                    
+//                }
+//            }
 
             if (editor != null)
@@ -516,4 +639,5 @@
             if (this.getTopLevelAncestor() instanceof ScriptBuilderFrame)
             {
+                 
                 if (((ScriptBuilderFrame) this.getTopLevelAncestor()).currentEventType != null)
                 {
@@ -530,4 +654,18 @@
                             ((IncidentEditorFrame) this.getTopLevelAncestor()).currentEventType,
                             x + 5, y + 10);
+                    
+                }else
+                {
+                    //when we aren't selecting one of the incident adding buttons, this.
+                    
+                    //this.selectMode = ((IncidentEditorFrame)this.getTopLevelAncestor()).selectMode;
+                    
+                    if(((IncidentEditorFrame)this.getTopLevelAncestor()).selectMode)
+                    {
+                        //cursorTime dictates where we are in the x direction
+                        //there seems to be no way to tell where we are in the y direction
+                        //implement something?
+                        
+                    }
                 }
             }
