Index: trunk/src/old/TimelinePanel.java
===================================================================
--- trunk/src/old/TimelinePanel.java	(revision 1)
+++ 	(revision )
@@ -1,263 +1,0 @@
-package old;
-
-//package scriptbuilder.gui.timeline;
-//
-//import java.awt.Color;
-//import java.awt.Font;
-//import java.awt.Graphics;
-//import java.awt.Graphics2D;
-//import java.awt.Polygon;
-//import java.util.ArrayList;
-//import java.util.List;
-//import javax.swing.JPanel;
-//import scriptbuilder.gui.ScriptBuilderFrame;
-//import scriptbuilder.structures.TimelineSlice;
-//import scriptbuilder.structures.ScriptIncident;
-//import scriptbuilder.structures.ScriptEvent;
-//
-///**
-// *
-// * @author Greg Eddington
-// */
-//public class TimelinePanel extends JPanel
-//{
-//    private static Polygon cursor;
-//
-//    private int curX = -300, curY = -300;
-//    private String cursorTimeString;
-//    private float zoom = 1.0f;
-//    private List<ScriptIncident> incidents;
-//    private boolean cursorActive = true;
-//    public int incident = 0;
-//    private ScriptBuilderFrame sbf;
-//
-//    public float getZoom()
-//    {
-//        return zoom;
-//    }
-//
-//    public int getCursorY()
-//    {
-//        return curY;
-//    }
-//
-//    public int getCursorX()
-//    {
-//        return curX;
-//    }
-//
-//    public List<ScriptIncident> getIncidents()
-//    {
-//        return incidents;
-//    }
-//
-//    public void setIncident(int incident)
-//    {
-//        this.incident = incident;
-//    }
-//
-//    public void setCursorActive(boolean active)
-//    {
-//        cursorActive = active;
-//    }
-//
-//    public void setCursorLocation(int x, int y)
-//    {
-//        curX = x;
-//        curY = y;
-//    }
-//
-//    public void setTimeString(String time)
-//    {
-//        cursorTimeString = time;
-//    }
-//
-//    public void setZoom(float zoom)
-//    {
-//        this.zoom = zoom;
-//    }
-//
-//    public void addIcon(int y, TimelineSlice icon)
-//    {
-//        incidents.get(incident).slices.add(icon);
-//    }
-//
-//    public void addEvent(ScriptEvent event)
-//    {
-//        int x = curX-5, y = curY-10;
-//        ScriptIncident inc = incidents.get(incident);
-//        boolean foundIcon = false;
-//
-//        for(int i = 0; i < inc.slices.size(); i++)
-//        {
-//            if (inc.slices.get(i).x == x)
-//            {
-//                inc.slices.get(i).events.add(event);
-//                foundIcon = true;
-//                break;
-//            }
-//        }
-//
-//        if (!foundIcon)
-//        {
-//            TimelineSlice newIcon = new TimelineSlice(x, y, 10, 10);
-//            newIcon.events.add(event);
-//            inc.slices.add(newIcon);
-//        }
-//    }
-//
-//    public void setScriptBuilderFrame(ScriptBuilderFrame sbf)
-//    {
-//        this.sbf = sbf;
-//    }
-//
-//    public TimelinePanel()
-//    {
-//        super();
-//
-//        // Create the object lists
-//        incidents = new ArrayList<ScriptIncident>();
-//
-//        // Create the cursor
-//        cursor = new Polygon();
-//        cursor.addPoint(0, 0);
-//        cursor.addPoint(-(TimelinePanel.TIMELINE_30_SECOND_STEP/2),
-//                TimelinePanel.TIMELINE_30_SECOND_STEP);
-//        cursor.addPoint(TimelinePanel.TIMELINE_30_SECOND_STEP/2,
-//                TimelinePanel.TIMELINE_30_SECOND_STEP);
-//
-//        // Create the media incident
-//        incidents.add(new ScriptIncident(Color.BLACK, 100, "Media",
-//                "The media incident.", 10800));
-//
-//        // Initialize the time string
-//        cursorTimeString = "";
-//    }
-//
-//    @Override
-//    public void paint(Graphics g)
-//    {
-//        Graphics2D g2d = (Graphics2D)g;
-//
-//        super.paint(g);
-//
-//        // Scale the panel
-//        g2d.scale(zoom, zoom);
-//
-//        // Draw the timelines
-//        drawTimelineGrid(g2d);
-//        drawIncidentLines(g2d);
-//
-//        // Draw the event icons
-//        drawTimelineIcons(g2d);
-//
-//        // Redraw the cursor
-//        drawCursor(g2d);
-//
-//
-//
-//        // Update the incident information
-//        if (incident >= 0 && incident < incidents.size() && sbf != null
-//                && incidents != null)
-//            sbf.updateIncident(incidents.get(incident), curX-5);
-//    }
-//
-//    private void drawIncidentLines(Graphics2D g2d)
-//    {
-//        // Draw the incident lines
-//        g2d.setFont(INCIDENT_FONT);
-//        for (int i = 0; i < incidents.size(); i++)
-//        {
-//            // Set the colour for this timeline
-//            g2d.setColor(incidents.get(i).color);
-//
-//            // Draw the timeline's name
-//            g2d.drawString(Integer.toString(incidents.get(i).number),
-//                    INCIDENT_NAME_LEFT_PADDING,
-//                    i * INCIDENT_NAME_VERTICAL_STEP + INCIDENT_NAME_TOP_PADDING);
-//
-//            // Draw the timeline's line
-//            g2d.fillRect(TIMELINE_LEFT_PADDING,
-//                    i * TIMELINE_VERTICAL_STEP + TIMELINE_TOP_PADDING,
-//                    TIMELINE_30_SECOND_STEP * incidents.get(i).length / 30,
-//                    TIMELINE_WIDTH);
-//        }
-//    }
-//
-//    private void drawTimelineGrid(Graphics2D g2d)
-//    {
-//        int maxTime = 360;
-//        int maxHeight = 1000;
-//
-//        g2d.setFont(GRID_FONT);
-//
-//        // Thirty second ticks
-//        g2d.setColor(THIRTY_SECOND_TICK_COLOR);
-//        for (int i = 0; i < maxTime; i++)
-//        {
-//            for (int j = 0; j < maxHeight; j += 2)
-//                g2d.drawLine(i * TIMELINE_30_SECOND_STEP + TIMELINE_LEFT_PADDING,
-//                        (j * THIRTY_SECOND_TICK_STEP) + THIRTY_SECOND_TICK_TOP_PADDING,
-//                        i * TIMELINE_30_SECOND_STEP + TIMELINE_LEFT_PADDING,
-//                        (j * THIRTY_SECOND_TICK_STEP) + THIRTY_SECOND_TICK_TOP_PADDING +
-//                        THIRTY_SECOND_TICK_STEP);
-//        }
-//
-//        // Fifteen minute ticks
-//        g2d.setColor(FIFTEEN_MINUTE_TICK_COLOR);
-//        for (int i = 0; i <= maxTime / 30; i++)
-//        {
-//            int minutes = i * 15;
-//
-//            // Draw the time
-//            g2d.drawString
-//            (
-//                (minutes / 60) + ":" + ((minutes % 60) == 0 ? "00" : (minutes % 60)) + ":00",
-//                i * TIMELINE_15_MINUTE_STEP + TIMELINE_LEFT_PADDING - TIME_LABEL_OFFSET,
-//                FIFTEEN_MINUTE_LABEL_TOP_PADDING
-//            );
-//
-//            // Draw the line
-//            g2d.drawLine(i * TIMELINE_15_MINUTE_STEP + TIMELINE_LEFT_PADDING,
-//                    FIFTEEN_MINUTE_TICK_TOP_PADDING,
-//                    i * TIMELINE_15_MINUTE_STEP + TIMELINE_LEFT_PADDING,
-//                    FIFTEEN_MINUTE_TICK_TOP_PADDING + THIRTY_SECOND_TICK_STEP);
-//            for (int j = 0; j < maxHeight; j += 2)
-//                g2d.drawLine(i * TIMELINE_15_MINUTE_STEP + TIMELINE_LEFT_PADDING,
-//                        (j * THIRTY_SECOND_TICK_STEP) + THIRTY_SECOND_TICK_TOP_PADDING,
-//                        i * TIMELINE_15_MINUTE_STEP + TIMELINE_LEFT_PADDING,
-//                        (j * THIRTY_SECOND_TICK_STEP + THIRTY_SECOND_TICK_STEP)
-//                        + THIRTY_SECOND_TICK_TOP_PADDING);
-//        }
-//    }
-//
-//    private void drawTimelineIcons(Graphics2D g2d)
-//    {
-//        for (ScriptIncident incident : incidents)
-//        {
-//            g2d.setColor(incident.color);
-//            for (TimelineSlice icon : incident.slices)
-//            {
-//                g2d.fill(icon.getShape());
-//            }
-//        }
-//    }
-//
-//    private void drawCursor(Graphics2D g2d)
-//    {
-//        // Draw the cursor
-//        g2d.setColor(CURSOR_COLOR);
-//        cursor.translate(curX - cursor.xpoints[0], curY - cursor.ypoints[0]);
-//        g2d.fill(cursor);
-//
-//        // Draw a timestamp
-//        g2d.setColor(CURSOR_TIME_BORDER_COLOR);
-//        g2d.fillRect(curX-30, curY + 15, 60, 20);
-//        g2d.setColor(cursorActive ? CURSOR_TIME_ACTIVE_BG_COLOR :
-//            CURSOR_TIME_INACTIVE_BG_COLOR);
-//        g2d.fillRect(curX-28, curY + 17, 56, 16);
-//        g2d.setColor(CURSOR_TIME_FONT_COLOR);
-//        g2d.setFont(CURSOR_TIME_FONT);
-//        g2d.drawString(cursorTimeString, curX-20, curY+30);
-//    }
-//}
Index: trunk/src/old/MouseWatcherPainter.java
===================================================================
--- trunk/src/old/MouseWatcherPainter.java	(revision 1)
+++ 	(revision )
@@ -1,166 +1,0 @@
-package old;
-
-///*
-// * To change this template, choose Tools | Templates
-// * and open the template in the editor.
-// */
-//
-//package scriptbuilder.gui.timeline;
-//
-//import java.awt.event.MouseEvent;
-//import javax.swing.JPanel;
-//import javax.swing.event.MouseInputAdapter;
-//import scriptbuilder.structures.TimelineSlice;
-//import scriptbuilder.structures.ScriptIncident;
-//import scriptbuilder.structures.ScriptEvent;
-//
-///**
-// *
-// * @author Greg
-// */
-//public class MouseWatcherPainter extends JPanel
-//{
-//    private boolean active = true;
-//    private int mx, my;
-//    private float zoom;
-//    private TimelinePanel tp;
-//
-//    public void setActive(boolean active)
-//    {
-//        this.active = active;
-//    }
-//
-//    public void setTimelinePanel(TimelinePanel panel)
-//    {
-//        tp = panel;
-//    }
-//
-//    public void setZoom(float zoom)
-//    {
-//        this.zoom = zoom;
-//    }
-//
-//    private class TimelineMouseListener extends MouseInputAdapter
-//    {
-//        @Override
-//        public void mouseMoved(MouseEvent e)
-//        {
-//            // Record the new mouse coordinates
-//            int x = e.getX();
-//            int y = e.getY();
-//
-//            setToolTipText("");
-//            for (ScriptIncident i : tp.getIncidents())
-//            {
-//                for (TimelineSlice c : i.slices)
-//                {
-//                    if (c.getShape().contains(x / zoom, y / zoom))
-//                    {
-//                        String toolTip = "<html>" + i.name + "@" +
-//                                getCursorTimeString(x, zoom);
-//                        for (ScriptEvent v : c.events)
-//                        {
-//                             toolTip += "<br>" + v.getToolTip();
-//                        }
-//                        toolTip += "</html>";
-//                        setToolTipText(toolTip);
-//                    }
-//                }
-//            }
-//
-//            int snappedY = snapY(my, zoom);
-//            if (    active                                                &&
-//                    x / zoom > TimelinePanel.TIMELINE_LEFT_PADDING        &&
-//                    y / zoom > TimelinePanel.TIMELINE_TOP_PADDING -
-//                               TimelinePanel.TIMELINE_VERTICAL_STEP/2     &&
-//                    y / zoom <= (TimelinePanel.TIMELINE_TOP_PADDING +
-//                                (tp.getIncidents().size()-1) *
-//                                TimelinePanel.TIMELINE_VERTICAL_STEP) +
-//                                TimelinePanel.TIMELINE_VERTICAL_STEP/2    &&
-//                    x / zoom <= tp.getIncidents().get(snappedY /
-//                                TimelinePanel.TIMELINE_VERTICAL_STEP).length /
-//                                30 * TimelinePanel.TIMELINE_30_SECOND_STEP
-//                                + TimelinePanel.TIMELINE_LEFT_PADDING
-//               )
-//            {
-//                mx = x;
-//                my = y;
-//                tp.setCursorLocation(snapX(mx, zoom), snappedY);
-//                tp.setTimeString(getCursorTimeString(mx, zoom));
-//                tp.setIncident(snappedY /
-//                        TimelinePanel.TIMELINE_VERTICAL_STEP);
-//            }
-//
-//            tp.repaint();
-//        }
-//
-//        @Override
-//        public void mouseClicked(MouseEvent e)
-//        {
-//            mouseMoved(e);
-//
-//            if (e.getButton() == MouseEvent.BUTTON1)
-//            {
-//                active = !active;
-//
-//                tp.setCursorActive(active);
-//            }
-//            else if (e.getButton() == MouseEvent.BUTTON3)
-//            {
-//                int snappedY = snapY(my, zoom);
-//
-//                tp.addIcon(snappedY, new TimelineSlice(snapX(mx, zoom) - 5, snappedY - 10,
-//                        TimelinePanel.TIMELINE_30_SECOND_STEP,
-//                        TimelinePanel.TIMELINE_30_SECOND_STEP));
-//
-//                tp.repaint();
-//            }
-//
-//            mouseMoved(e);
-//        }
-//    }
-//
-//    public static String getCursorTimeString(int x, float zoom)
-//    {
-//        int seconds = (((int)((float)x / zoom) -
-//            TimelinePanel.TIMELINE_LEFT_PADDING)
-//            + (TimelinePanel.TIMELINE_30_SECOND_STEP / 2)) /
-//            TimelinePanel.TIMELINE_30_SECOND_STEP * 30;
-//        int hours = seconds / 3600;
-//        int minutes = seconds / 60 % 60;
-//        seconds = seconds % 60;
-//
-//        return hours + ":" + (minutes < 10 ? "0" + minutes : minutes) + ":" +
-//             ((seconds == 0) ? "00" : seconds);
-//    }
-//
-//    public MouseWatcherPainter()
-//    {
-//        super();
-//
-//        // Add the mouse listener
-//        TimelineMouseListener mouseListener = new TimelineMouseListener();
-//        addMouseMotionListener(mouseListener);
-//        addMouseListener(mouseListener);
-//
-//        zoom = 1.0f;
-//    }
-//
-//    public static int snapX(int mx, float zoom)
-//    {
-//        return ( ( (int)((float)mx / zoom) -
-//            TimelinePanel.TIMELINE_30_SECOND_STEP / 2 )
-//            / TimelinePanel.TIMELINE_30_SECOND_STEP
-//            * TimelinePanel.TIMELINE_30_SECOND_STEP) +
-//            TimelinePanel.TIMELINE_30_SECOND_STEP;
-//    }
-//
-//    public static int snapY(int my, float zoom)
-//    {
-//        return ((int)((float)my / zoom) -
-//                TimelinePanel.TIMELINE_TOP_PADDING/2) /
-//                TimelinePanel.TIMELINE_VERTICAL_STEP *
-//                TimelinePanel.TIMELINE_VERTICAL_STEP +
-//                TimelinePanel.TIMELINE_TOP_PADDING;
-//    }
-//}
