Index: trunk/src/scriptbuilder/gui/drawers/RangeSliderDemo.java
===================================================================
--- trunk/src/scriptbuilder/gui/drawers/RangeSliderDemo.java	(revision 25)
+++ trunk/src/scriptbuilder/gui/drawers/RangeSliderDemo.java	(revision 26)
@@ -1,2 +1,3 @@
+package scriptbuilder.gui.drawers;
 
 import java.awt.BorderLayout;
@@ -14,4 +15,5 @@
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
+
 /*
 The MIT License
@@ -36,10 +38,11 @@
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-*/
+ */
 
 /**
  * Demo application panel to display a range slider.
  */
-public class RangeSliderDemo extends JPanel {
+public class RangeSliderDemo extends JPanel
+{
 
     private JLabel rangeSliderLabel1 = new JLabel();
@@ -49,20 +52,23 @@
     private RangeSlider rangeSlider = new RangeSlider();
 
-    public RangeSliderDemo() {
+    public RangeSliderDemo()
+    {
         setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
         setLayout(new GridBagLayout());
-        
+
         rangeSliderLabel1.setText("Lower value:");
         rangeSliderLabel2.setText("Upper value:");
         rangeSliderValue1.setHorizontalAlignment(JLabel.LEFT);
         rangeSliderValue2.setHorizontalAlignment(JLabel.LEFT);
-        
+
         rangeSlider.setPreferredSize(new Dimension(240, rangeSlider.getPreferredSize().height));
         rangeSlider.setMinimum(0);
         rangeSlider.setMaximum(10);
-        
+
         // Add listener to update display.
-        rangeSlider.addChangeListener(new ChangeListener() {
-            public void stateChanged(ChangeEvent e) {
+        rangeSlider.addChangeListener(new ChangeListener()
+        {
+            public void stateChanged(ChangeEvent e)
+            {
                 RangeSlider slider = (RangeSlider) e.getSource();
                 rangeSliderValue1.setText(String.valueOf(slider.getValue()));
@@ -72,24 +78,25 @@
 
         add(rangeSliderLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
-            GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 3, 3), 0, 0));
+                GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 3, 3), 0, 0));
         add(rangeSliderValue1, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
-            GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 3, 0), 0, 0));
+                GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 3, 0), 0, 0));
         add(rangeSliderLabel2, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
-            GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 3, 3), 0, 0));
+                GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 3, 3), 0, 0));
         add(rangeSliderValue2, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0,
-            GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 6, 0), 0, 0));
-        add(rangeSlider      , new GridBagConstraints(0, 2, 2, 1, 0.0, 0.0,
-            GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
+                GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 6, 0), 0, 0));
+        add(rangeSlider, new GridBagConstraints(0, 2, 2, 1, 0.0, 0.0,
+                GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
     }
-    
-    public void display() {
+
+    public void display()
+    {
         // Initialize values.
         rangeSlider.setValue(3);
         rangeSlider.setUpperValue(7);
-        
+
         // Initialize value display.
         rangeSliderValue1.setText(String.valueOf(rangeSlider.getValue()));
         rangeSliderValue2.setText(String.valueOf(rangeSlider.getUpperValue()));
-        
+
         // Create window frame.
         JFrame frame = new JFrame();
@@ -97,28 +104,35 @@
         frame.setResizable(false);
         frame.setTitle("Range Slider Demo");
-        
+
         // Set window content and validate.
         frame.getContentPane().setLayout(new BorderLayout());
         frame.getContentPane().add(this, BorderLayout.CENTER);
         frame.pack();
-        
+
         // Set window location and display.
         frame.setLocationRelativeTo(null);
         frame.setVisible(true);
     }
-    
+
     /**
      * Main application method.
+     *
      * @param args String[]
      */
-    public static void main(String[] args) {
-        try {
+    public static void main(String[] args)
+    {
+        try
+        {
             UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-        } catch (Exception ex) {
+        }
+        catch (Exception ex)
+        {
             ex.printStackTrace();
         }
 
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
+        SwingUtilities.invokeLater(new Runnable()
+        {
+            public void run()
+            {
                 new RangeSliderDemo().display();
             }
Index: trunk/src/scriptbuilder/gui/drawers/RangeSliderUI.java
===================================================================
--- trunk/src/scriptbuilder/gui/drawers/RangeSliderUI.java	(revision 25)
+++ trunk/src/scriptbuilder/gui/drawers/RangeSliderUI.java	(revision 26)
@@ -1,2 +1,4 @@
+package scriptbuilder.gui.drawers;
+
 import java.awt.Color;
 import java.awt.Dimension;
@@ -6,8 +8,12 @@
 import java.awt.RenderingHints;
 import java.awt.Shape;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.awt.event.MouseEvent;
 import java.awt.geom.Ellipse2D;
 
 import javax.swing.JComponent;
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
 import javax.swing.JSlider;
 import javax.swing.SwingUtilities;
@@ -15,4 +21,5 @@
 import javax.swing.event.ChangeListener;
 import javax.swing.plaf.basic.BasicSliderUI;
+
 /*
 The MIT License
@@ -37,38 +44,51 @@
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-*/
-
+ */
 /**
- * UI delegate for the RangeSlider component.  RangeSliderUI paints two thumbs,
+ * UI delegate for the RangeSlider component. RangeSliderUI paints two thumbs,
  * one for the lower value and one for the upper value.
  */
-class RangeSliderUI extends BasicSliderUI {
-
-    /** Color of selected range. */
+class RangeSliderUI extends BasicSliderUI
+{
+
+    /**
+     * Color of selected range.
+     */
     private Color rangeColor = Color.GREEN;
-    
-    /** Location and size of thumb for upper value. */
+
+    /**
+     * Location and size of thumb for upper value.
+     */
     private Rectangle upperThumbRect;
-    /** Indicator that determines whether upper thumb is selected. */
+    /**
+     * Indicator that determines whether upper thumb is selected.
+     */
     private boolean upperThumbSelected;
-    
-    /** Indicator that determines whether lower thumb is being dragged. */
+
+    /**
+     * Indicator that determines whether lower thumb is being dragged.
+     */
     private transient boolean lowerDragging;
-    /** Indicator that determines whether upper thumb is being dragged. */
+    /**
+     * Indicator that determines whether upper thumb is being dragged.
+     */
     private transient boolean upperDragging;
-    
+
     /**
      * Constructs a RangeSliderUI for the specified slider component.
+     *
      * @param b RangeSlider
      */
-    public RangeSliderUI(RangeSlider b) {
+    public RangeSliderUI(RangeSlider b)
+    {
         super(b);
     }
-    
-    /**
-     * Installs this UI delegate on the specified component. 
-     */
-    @Override
-    public void installUI(JComponent c) {
+
+    /**
+     * Installs this UI delegate on the specified component.
+     */
+    @Override
+    public void installUI(JComponent c)
+    {
         upperThumbRect = new Rectangle();
         super.installUI(c);
@@ -79,5 +99,6 @@
      */
     @Override
-    protected TrackListener createTrackListener(JSlider slider) {
+    protected TrackListener createTrackListener(JSlider slider)
+    {
         return new RangeTrackListener();
     }
@@ -87,64 +108,77 @@
      */
     @Override
-    protected ChangeListener createChangeListener(JSlider slider) {
+    protected ChangeListener createChangeListener(JSlider slider)
+    {
         return new ChangeHandler();
     }
-    
-    /**
-     * Updates the dimensions for both thumbs. 
-     */
-    @Override
-    protected void calculateThumbSize() {
+
+    /**
+     * Updates the dimensions for both thumbs.
+     */
+    @Override
+    protected void calculateThumbSize()
+    {
         // Call superclass method for lower thumb size.
         super.calculateThumbSize();
-        
+
         // Set upper thumb size.
         upperThumbRect.setSize(thumbRect.width, thumbRect.height);
     }
-    
+
     /**
      * Updates the locations for both thumbs.
      */
     @Override
-    protected void calculateThumbLocation() {
+    protected void calculateThumbLocation()
+    {
         // Call superclass method for lower thumb location.
         super.calculateThumbLocation();
-        
+
         // Adjust upper value to snap to ticks if necessary.
-        if (slider.getSnapToTicks()) {
+        if (slider.getSnapToTicks())
+        {
             int upperValue = slider.getValue() + slider.getExtent();
-            int snappedValue = upperValue; 
+            int snappedValue = upperValue;
             int majorTickSpacing = slider.getMajorTickSpacing();
             int minorTickSpacing = slider.getMinorTickSpacing();
             int tickSpacing = 0;
-            
-            if (minorTickSpacing > 0) {
+
+            if (minorTickSpacing > 0)
+            {
                 tickSpacing = minorTickSpacing;
-            } else if (majorTickSpacing > 0) {
+            }
+            else if (majorTickSpacing > 0)
+            {
                 tickSpacing = majorTickSpacing;
             }
 
-            if (tickSpacing != 0) {
+            if (tickSpacing != 0)
+            {
                 // If it's not on a tick, change the value
-                if ((upperValue - slider.getMinimum()) % tickSpacing != 0) {
-                    float temp = (float)(upperValue - slider.getMinimum()) / (float)tickSpacing;
+                if ((upperValue - slider.getMinimum()) % tickSpacing != 0)
+                {
+                    float temp = (float) (upperValue - slider.getMinimum()) / (float) tickSpacing;
                     int whichTick = Math.round(temp);
                     snappedValue = slider.getMinimum() + (whichTick * tickSpacing);
                 }
 
-                if (snappedValue != upperValue) { 
+                if (snappedValue != upperValue)
+                {
                     slider.setExtent(snappedValue - slider.getValue());
                 }
             }
         }
-        
-        // Calculate upper thumb location.  The thumb is centered over its 
+
+        // Calculate upper thumb location.  The thumb is centered over its
         // value on the track.
-        if (slider.getOrientation() == JSlider.HORIZONTAL) {
+        if (slider.getOrientation() == JSlider.HORIZONTAL)
+        {
             int upperPosition = xPositionForValue(slider.getValue() + slider.getExtent());
             upperThumbRect.x = upperPosition - (upperThumbRect.width / 2);
             upperThumbRect.y = trackRect.y;
-            
-        } else {
+
+        }
+        else
+        {
             int upperPosition = yPositionForValue(slider.getValue() + slider.getExtent());
             upperThumbRect.x = trackRect.x;
@@ -152,58 +186,69 @@
         }
     }
-    
+
     /**
      * Returns the size of a thumb.
      */
     @Override
-    protected Dimension getThumbSize() {
+    protected Dimension getThumbSize()
+    {
         return new Dimension(12, 12);
     }
 
     /**
-     * Paints the slider.  The selected thumb is always painted on top of the
+     * Paints the slider. The selected thumb is always painted on top of the
      * other thumb.
      */
     @Override
-    public void paint(Graphics g, JComponent c) {
+    public void paint(Graphics g, JComponent c)
+    {
         super.paint(g, c);
-        
+
         Rectangle clipRect = g.getClipBounds();
-        if (upperThumbSelected) {
+        if (upperThumbSelected)
+        {
             // Paint lower thumb first, then upper thumb.
-            if (clipRect.intersects(thumbRect)) {
+            if (clipRect.intersects(thumbRect))
+            {
                 paintLowerThumb(g);
             }
-            if (clipRect.intersects(upperThumbRect)) {
+            if (clipRect.intersects(upperThumbRect))
+            {
                 paintUpperThumb(g);
             }
-            
-        } else {
+
+        }
+        else
+        {
             // Paint upper thumb first, then lower thumb.
-            if (clipRect.intersects(upperThumbRect)) {
+            if (clipRect.intersects(upperThumbRect))
+            {
                 paintUpperThumb(g);
             }
-            if (clipRect.intersects(thumbRect)) {
+            if (clipRect.intersects(thumbRect))
+            {
                 paintLowerThumb(g);
             }
         }
     }
-    
+
     /**
      * Paints the track.
      */
     @Override
-    public void paintTrack(Graphics g) {
+    public void paintTrack(Graphics g)
+    {
         // Draw track.
         super.paintTrack(g);
-        
+
         Rectangle trackBounds = trackRect;
-        
-        if (slider.getOrientation() == JSlider.HORIZONTAL) {
+
+        if (slider.getOrientation() == JSlider.HORIZONTAL)
+        {
             // Determine position of selected range by moving from the middle
             // of one thumb to the other.
             int lowerX = thumbRect.x + (thumbRect.width / 2);
             int upperX = upperThumbRect.x + (upperThumbRect.width / 2);
-            
+
             // Determine track position.
             int cy = (trackBounds.height / 2) - 2;
@@ -212,8 +257,9 @@
             Color oldColor = g.getColor();
             g.translate(trackBounds.x, trackBounds.y + cy);
-            
+
             // Draw selected range.
             g.setColor(rangeColor);
-            for (int y = 0; y <= 3; y++) {
+            for (int y = 0; y <= 3; y++)
+            {
                 g.drawLine(lowerX - trackBounds.x, y, upperX - trackBounds.x, y);
             }
@@ -222,11 +268,13 @@
             g.translate(-trackBounds.x, -(trackBounds.y + cy));
             g.setColor(oldColor);
-            
-        } else {
+
+        }
+        else
+        {
             // Determine position of selected range by moving from the middle
             // of one thumb to the other.
             int lowerY = thumbRect.x + (thumbRect.width / 2);
             int upperY = upperThumbRect.x + (upperThumbRect.width / 2);
-            
+
             // Determine track position.
             int cx = (trackBounds.width / 2) - 2;
@@ -238,8 +286,9 @@
             // Draw selected range.
             g.setColor(rangeColor);
-            for (int x = 0; x <= 3; x++) {
+            for (int x = 0; x <= 3; x++)
+            {
                 g.drawLine(x, lowerY - trackBounds.y, x, upperY - trackBounds.y);
             }
-            
+
             // Restore position and color.
             g.translate(-(trackBounds.x + cx), -trackBounds.y);
@@ -247,11 +296,12 @@
         }
     }
-    
-    /**
-     * Overrides superclass method to do nothing.  Thumb painting is handled
+
+    /**
+     * Overrides superclass method to do nothing. Thumb painting is handled
      * within the <code>paint()</code> method.
      */
     @Override
-    public void paintThumb(Graphics g) {
+    public void paintThumb(Graphics g)
+    {
         // Do nothing.
     }
@@ -260,9 +310,10 @@
      * Paints the thumb for the lower value using the specified graphics object.
      */
-    private void paintLowerThumb(Graphics g) {
+    private void paintLowerThumb(Graphics g)
+    {
         Rectangle knobBounds = thumbRect;
         int w = knobBounds.width;
-        int h = knobBounds.height;      
-        
+        int h = knobBounds.height;
+
         // Create graphics copy.
         Graphics2D g2d = (Graphics2D) g.create();
@@ -273,5 +324,5 @@
         // Draw thumb.
         g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
-            RenderingHints.VALUE_ANTIALIAS_ON);
+                RenderingHints.VALUE_ANTIALIAS_ON);
         g2d.translate(knobBounds.x, knobBounds.y);
 
@@ -281,17 +332,18 @@
         g2d.setColor(Color.BLUE);
         g2d.draw(thumbShape);
-        
+
         // Dispose graphics.
         g2d.dispose();
     }
-    
+
     /**
      * Paints the thumb for the upper value using the specified graphics object.
      */
-    private void paintUpperThumb(Graphics g) {
+    private void paintUpperThumb(Graphics g)
+    {
         Rectangle knobBounds = upperThumbRect;
         int w = knobBounds.width;
-        int h = knobBounds.height;      
-        
+        int h = knobBounds.height;
+
         // Create graphics copy.
         Graphics2D g2d = (Graphics2D) g.create();
@@ -302,5 +354,5 @@
         // Draw thumb.
         g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
-            RenderingHints.VALUE_ANTIALIAS_ON);
+                RenderingHints.VALUE_ANTIALIAS_ON);
         g2d.translate(knobBounds.x, knobBounds.y);
 
@@ -318,17 +370,19 @@
      * Returns a Shape representing a thumb.
      */
-    private Shape createThumbShape(int width, int height) {
+    private Shape createThumbShape(int width, int height)
+    {
         // Use circular shape.
         Ellipse2D shape = new Ellipse2D.Double(0, 0, width, height);
         return shape;
     }
-    
-    /** 
-     * Sets the location of the upper thumb, and repaints the slider.  This is
-     * called when the upper thumb is dragged to repaint the slider.  The
+
+    /**
+     * Sets the location of the upper thumb, and repaints the slider. This is
+     * called when the upper thumb is dragged to repaint the slider. The
      * <code>setThumbLocation()</code> method performs the same task for the
      * lower thumb.
      */
-    private void setUpperThumbLocation(int x, int y) {
+    private void setUpperThumbLocation(int x, int y)
+    {
         Rectangle upperUnionRect = new Rectangle();
         upperUnionRect.setBounds(upperThumbRect);
@@ -339,21 +393,27 @@
         slider.repaint(upperUnionRect.x, upperUnionRect.y, upperUnionRect.width, upperUnionRect.height);
     }
-    
+
     /**
      * Moves the selected thumb in the specified direction by a block increment.
      * This method is called when the user presses the Page Up or Down keys.
      */
-    public void scrollByBlock(int direction) {
-        synchronized (slider) {
+    public void scrollByBlock(int direction)
+    {
+        synchronized (slider)
+        {
             int blockIncrement = (slider.getMaximum() - slider.getMinimum()) / 10;
-            if (blockIncrement <= 0 && slider.getMaximum() > slider.getMinimum()) {
+            if (blockIncrement <= 0 && slider.getMaximum() > slider.getMinimum())
+            {
                 blockIncrement = 1;
             }
             int delta = blockIncrement * ((direction > 0) ? POSITIVE_SCROLL : NEGATIVE_SCROLL);
-            
-            if (upperThumbSelected) {
+
+            if (upperThumbSelected)
+            {
                 int oldValue = ((RangeSlider) slider).getUpperValue();
                 ((RangeSlider) slider).setUpperValue(oldValue + delta);
-            } else {
+            }
+            else
+            {
                 int oldValue = slider.getValue();
                 slider.setValue(oldValue + delta);
@@ -361,31 +421,40 @@
         }
     }
-    
+
     /**
      * Moves the selected thumb in the specified direction by a unit increment.
      * This method is called when the user presses one of the arrow keys.
      */
-    public void scrollByUnit(int direction) {
-        synchronized (slider) {
+    public void scrollByUnit(int direction)
+    {
+        synchronized (slider)
+        {
             int delta = 1 * ((direction > 0) ? POSITIVE_SCROLL : NEGATIVE_SCROLL);
-            
-            if (upperThumbSelected) {
+
+            if (upperThumbSelected)
+            {
                 int oldValue = ((RangeSlider) slider).getUpperValue();
                 ((RangeSlider) slider).setUpperValue(oldValue + delta);
-            } else {
+            }
+            else
+            {
                 int oldValue = slider.getValue();
                 slider.setValue(oldValue + delta);
             }
-        }       
-    }
-    
-    /**
-     * Listener to handle model change events.  This calculates the thumb 
+        }
+    }
+
+    /**
+     * Listener to handle model change events. This calculates the thumb
      * locations and repaints the slider if the value change is not caused by
      * dragging a thumb.
      */
-    public class ChangeHandler implements ChangeListener {
-        public void stateChanged(ChangeEvent arg0) {
-            if (!lowerDragging && !upperDragging) {
+    public class ChangeHandler implements ChangeListener
+    {
+
+        public void stateChanged(ChangeEvent arg0)
+        {
+            if (!lowerDragging && !upperDragging)
+            {
                 calculateThumbLocation();
                 slider.repaint();
@@ -393,13 +462,50 @@
         }
     }
-    
+
+    /*
+    *   Popup menu for incident actions
+     */
+    private JPopupMenu createPopup()
+    {
+        JPopupMenu menu = new JPopupMenu();
+        JMenuItem eventsMenuItem = new JMenuItem("Events");
+        JMenuItem propsMenuItem = new JMenuItem("Properties");
+        JMenuItem deleteMenuItem = new JMenuItem("Delete");
+        eventsMenuItem.setActionCommand("Edit Events");
+        propsMenuItem.setActionCommand("Modify Incident Properties");
+        deleteMenuItem.setActionCommand("Delete Incident");
+
+        PopupMenuItemListener menuItemListener = new PopupMenuItemListener();
+
+        eventsMenuItem.addActionListener(menuItemListener);
+        propsMenuItem.addActionListener(menuItemListener);
+        deleteMenuItem.addActionListener(menuItemListener);
+
+        menu.add(eventsMenuItem);
+        menu.add(propsMenuItem);
+        menu.add(deleteMenuItem);
+        return menu;
+    }
+
+    class PopupMenuItemListener implements ActionListener
+    {
+
+        public void actionPerformed(ActionEvent e)
+        {
+            System.out.println(e.getActionCommand() + " will be handled here.");
+        }
+    }
+
     /**
      * Listener to handle mouse movements in the slider track.
      */
-    public class RangeTrackListener extends TrackListener {
-        
+    public class RangeTrackListener extends TrackListener
+    {
+
         @Override
-        public void mousePressed(MouseEvent e) {
-            if (!slider.isEnabled()) {
+        public void mousePressed(MouseEvent e)
+        {
+            if (!slider.isEnabled())
+            {
                 return;
             }
@@ -408,23 +514,38 @@
             currentMouseY = e.getY();
 
-            if (slider.isRequestFocusEnabled()) {
+            if (slider.isRequestFocusEnabled())
+            {
                 slider.requestFocus();
             }
-            
-            // Determine which thumb is pressed.  If the upper thumb is 
+            // Does user want a popup menu?
+            if (e.isPopupTrigger())
+            {
+                JPopupMenu popup = createPopup();
+                popup.show(e.getComponent(), currentMouseX, currentMouseY);
+            }
+            // Determine which thumb is pressed.  If the upper thumb is
             // selected (last one dragged), then check its position first;
             // otherwise check the position of the lower thumb first.
             boolean lowerPressed = false;
             boolean upperPressed = false;
-            if (upperThumbSelected || slider.getMinimum() == slider.getValue()) {
-                if (upperThumbRect.contains(currentMouseX, currentMouseY)) {
+            if (upperThumbSelected || slider.getMinimum() == slider.getValue())
+            {
+                if (upperThumbRect.contains(currentMouseX, currentMouseY))
+                {
                     upperPressed = true;
-                } else if (thumbRect.contains(currentMouseX, currentMouseY)) {
+                }
+                else if (thumbRect.contains(currentMouseX, currentMouseY))
+                {
                     lowerPressed = true;
                 }
-            } else {
-                if (thumbRect.contains(currentMouseX, currentMouseY)) {
+            }
+            else
+            {
+                if (thumbRect.contains(currentMouseX, currentMouseY))
+                {
                     lowerPressed = true;
-                } else if (upperThumbRect.contains(currentMouseX, currentMouseY)) {
+                }
+                else if (upperThumbRect.contains(currentMouseX, currentMouseY))
+                {
                     upperPressed = true;
                 }
@@ -432,12 +553,14 @@
 
             // Handle lower thumb pressed.
-            if (lowerPressed) {
-                switch (slider.getOrientation()) {
-                case JSlider.VERTICAL:
-                    offset = currentMouseY - thumbRect.y;
-                    break;
-                case JSlider.HORIZONTAL:
-                    offset = currentMouseX - thumbRect.x;
-                    break;
+            if (lowerPressed)
+            {
+                switch (slider.getOrientation())
+                {
+                    case JSlider.VERTICAL:
+                        offset = currentMouseY - thumbRect.y;
+                        break;
+                    case JSlider.HORIZONTAL:
+                        offset = currentMouseX - thumbRect.x;
+                        break;
                 }
                 upperThumbSelected = false;
@@ -446,14 +569,16 @@
             }
             lowerDragging = false;
-            
+
             // Handle upper thumb pressed.
-            if (upperPressed) {
-                switch (slider.getOrientation()) {
-                case JSlider.VERTICAL:
-                    offset = currentMouseY - upperThumbRect.y;
-                    break;
-                case JSlider.HORIZONTAL:
-                    offset = currentMouseX - upperThumbRect.x;
-                    break;
+            if (upperPressed)
+            {
+                switch (slider.getOrientation())
+                {
+                    case JSlider.VERTICAL:
+                        offset = currentMouseY - upperThumbRect.y;
+                        break;
+                    case JSlider.HORIZONTAL:
+                        offset = currentMouseX - upperThumbRect.x;
+                        break;
                 }
                 upperThumbSelected = true;
@@ -463,7 +588,8 @@
             upperDragging = false;
         }
-        
+
         @Override
-        public void mouseReleased(MouseEvent e) {
+        public void mouseReleased(MouseEvent e)
+        {
             lowerDragging = false;
             upperDragging = false;
@@ -471,8 +597,10 @@
             super.mouseReleased(e);
         }
-        
+
         @Override
-        public void mouseDragged(MouseEvent e) {
-            if (!slider.isEnabled()) {
+        public void mouseDragged(MouseEvent e)
+        {
+            if (!slider.isEnabled())
+            {
                 return;
             }
@@ -481,134 +609,154 @@
             currentMouseY = e.getY();
 
-            if (lowerDragging) {
+            if (lowerDragging)
+            {
                 slider.setValueIsAdjusting(true);
                 moveLowerThumb();
-                
-            } else if (upperDragging) {
+
+            }
+            else if (upperDragging)
+            {
                 slider.setValueIsAdjusting(true);
                 moveUpperThumb();
             }
         }
-        
+
         @Override
-        public boolean shouldScroll(int direction) {
+        public boolean shouldScroll(int direction)
+        {
             return false;
         }
 
         /**
-         * Moves the location of the lower thumb, and sets its corresponding 
+         * Moves the location of the lower thumb, and sets its corresponding
          * value in the slider.
          */
-        private void moveLowerThumb() {
+        private void moveLowerThumb()
+        {
             int thumbMiddle = 0;
-            
-            switch (slider.getOrientation()) {
-            case JSlider.VERTICAL:      
-                int halfThumbHeight = thumbRect.height / 2;
-                int thumbTop = currentMouseY - offset;
-                int trackTop = trackRect.y;
-                int trackBottom = trackRect.y + (trackRect.height - 1);
-                int vMax = yPositionForValue(slider.getValue() + slider.getExtent());
-
-                // Apply bounds to thumb position.
-                if (drawInverted()) {
-                    trackBottom = vMax;
-                } else {
-                    trackTop = vMax;
-                }
-                thumbTop = Math.max(thumbTop, trackTop - halfThumbHeight);
-                thumbTop = Math.min(thumbTop, trackBottom - halfThumbHeight);
-
-                setThumbLocation(thumbRect.x, thumbTop);
-
-                // Update slider value.
-                thumbMiddle = thumbTop + halfThumbHeight;
-                slider.setValue(valueForYPosition(thumbMiddle));
-                break;
-                
-            case JSlider.HORIZONTAL:
-                int halfThumbWidth = thumbRect.width / 2;
-                int thumbLeft = currentMouseX - offset;
-                int trackLeft = trackRect.x;
-                int trackRight = trackRect.x + (trackRect.width - 1);
-                int hMax = xPositionForValue(slider.getValue() + slider.getExtent());
-
-                // Apply bounds to thumb position.
-                if (drawInverted()) {
-                    trackLeft = hMax;
-                } else {
-                    trackRight = hMax;
-                }
-                thumbLeft = Math.max(thumbLeft, trackLeft - halfThumbWidth);
-                thumbLeft = Math.min(thumbLeft, trackRight - halfThumbWidth);
-
-                setThumbLocation(thumbLeft, thumbRect.y);
-
-                // Update slider value.
-                thumbMiddle = thumbLeft + halfThumbWidth;
-                slider.setValue(valueForXPosition(thumbMiddle));
-                break;
-                
-            default:
-                return;
+
+            switch (slider.getOrientation())
+            {
+                case JSlider.VERTICAL:
+                    int halfThumbHeight = thumbRect.height / 2;
+                    int thumbTop = currentMouseY - offset;
+                    int trackTop = trackRect.y;
+                    int trackBottom = trackRect.y + (trackRect.height - 1);
+                    int vMax = yPositionForValue(slider.getValue() + slider.getExtent());
+
+                    // Apply bounds to thumb position.
+                    if (drawInverted())
+                    {
+                        trackBottom = vMax;
+                    }
+                    else
+                    {
+                        trackTop = vMax;
+                    }
+                    thumbTop = Math.max(thumbTop, trackTop - halfThumbHeight);
+                    thumbTop = Math.min(thumbTop, trackBottom - halfThumbHeight);
+
+                    setThumbLocation(thumbRect.x, thumbTop);
+
+                    // Update slider value.
+                    thumbMiddle = thumbTop + halfThumbHeight;
+                    slider.setValue(valueForYPosition(thumbMiddle));
+                    break;
+
+                case JSlider.HORIZONTAL:
+                    int halfThumbWidth = thumbRect.width / 2;
+                    int thumbLeft = currentMouseX - offset;
+                    int trackLeft = trackRect.x;
+                    int trackRight = trackRect.x + (trackRect.width - 1);
+                    int hMax = xPositionForValue(slider.getValue() + slider.getExtent());
+
+                    // Apply bounds to thumb position.
+                    if (drawInverted())
+                    {
+                        trackLeft = hMax;
+                    }
+                    else
+                    {
+                        trackRight = hMax;
+                    }
+                    thumbLeft = Math.max(thumbLeft, trackLeft - halfThumbWidth);
+                    thumbLeft = Math.min(thumbLeft, trackRight - halfThumbWidth);
+
+                    setThumbLocation(thumbLeft, thumbRect.y);
+
+                    // Update slider value.
+                    thumbMiddle = thumbLeft + halfThumbWidth;
+                    slider.setValue(valueForXPosition(thumbMiddle));
+                    break;
+
+                default:
+                    return;
             }
         }
 
         /**
-         * Moves the location of the upper thumb, and sets its corresponding 
+         * Moves the location of the upper thumb, and sets its corresponding
          * value in the slider.
          */
-        private void moveUpperThumb() {
+        private void moveUpperThumb()
+        {
             int thumbMiddle = 0;
-            
-            switch (slider.getOrientation()) {
-            case JSlider.VERTICAL:      
-                int halfThumbHeight = thumbRect.height / 2;
-                int thumbTop = currentMouseY - offset;
-                int trackTop = trackRect.y;
-                int trackBottom = trackRect.y + (trackRect.height - 1);
-                int vMin = yPositionForValue(slider.getValue());
-
-                // Apply bounds to thumb position.
-                if (drawInverted()) {
-                    trackTop = vMin;
-                } else {
-                    trackBottom = vMin;
-                }
-                thumbTop = Math.max(thumbTop, trackTop - halfThumbHeight);
-                thumbTop = Math.min(thumbTop, trackBottom - halfThumbHeight);
-
-                setUpperThumbLocation(thumbRect.x, thumbTop);
-
-                // Update slider extent.
-                thumbMiddle = thumbTop + halfThumbHeight;
-                slider.setExtent(valueForYPosition(thumbMiddle) - slider.getValue());
-                break;
-                
-            case JSlider.HORIZONTAL:
-                int halfThumbWidth = thumbRect.width / 2;
-                int thumbLeft = currentMouseX - offset;
-                int trackLeft = trackRect.x;
-                int trackRight = trackRect.x + (trackRect.width - 1);
-                int hMin = xPositionForValue(slider.getValue());
-
-                // Apply bounds to thumb position.
-                if (drawInverted()) {
-                    trackRight = hMin;
-                } else {
-                    trackLeft = hMin;
-                }
-                thumbLeft = Math.max(thumbLeft, trackLeft - halfThumbWidth);
-                thumbLeft = Math.min(thumbLeft, trackRight - halfThumbWidth);
-
-                setUpperThumbLocation(thumbLeft, thumbRect.y);
-                
-                // Update slider extent.
-                thumbMiddle = thumbLeft + halfThumbWidth;
-                slider.setExtent(valueForXPosition(thumbMiddle) - slider.getValue());
-                break;
-                
-            default:
-                return;
+
+            switch (slider.getOrientation())
+            {
+                case JSlider.VERTICAL:
+                    int halfThumbHeight = thumbRect.height / 2;
+                    int thumbTop = currentMouseY - offset;
+                    int trackTop = trackRect.y;
+                    int trackBottom = trackRect.y + (trackRect.height - 1);
+                    int vMin = yPositionForValue(slider.getValue());
+
+                    // Apply bounds to thumb position.
+                    if (drawInverted())
+                    {
+                        trackTop = vMin;
+                    }
+                    else
+                    {
+                        trackBottom = vMin;
+                    }
+                    thumbTop = Math.max(thumbTop, trackTop - halfThumbHeight);
+                    thumbTop = Math.min(thumbTop, trackBottom - halfThumbHeight);
+
+                    setUpperThumbLocation(thumbRect.x, thumbTop);
+
+                    // Update slider extent.
+                    thumbMiddle = thumbTop + halfThumbHeight;
+                    slider.setExtent(valueForYPosition(thumbMiddle) - slider.getValue());
+                    break;
+
+                case JSlider.HORIZONTAL:
+                    int halfThumbWidth = thumbRect.width / 2;
+                    int thumbLeft = currentMouseX - offset;
+                    int trackLeft = trackRect.x;
+                    int trackRight = trackRect.x + (trackRect.width - 1);
+                    int hMin = xPositionForValue(slider.getValue());
+
+                    // Apply bounds to thumb position.
+                    if (drawInverted())
+                    {
+                        trackRight = hMin;
+                    }
+                    else
+                    {
+                        trackLeft = hMin;
+                    }
+                    thumbLeft = Math.max(thumbLeft, trackLeft - halfThumbWidth);
+                    thumbLeft = Math.min(thumbLeft, trackRight - halfThumbWidth);
+
+                    setUpperThumbLocation(thumbLeft, thumbRect.y);
+
+                    // Update slider extent.
+                    thumbMiddle = thumbLeft + halfThumbWidth;
+                    slider.setExtent(valueForXPosition(thumbMiddle) - slider.getValue());
+                    break;
+
+                default:
+                    return;
             }
         }
Index: trunk/src/scriptbuilder/gui/drawers/RangeSlider.java
===================================================================
--- trunk/src/scriptbuilder/gui/drawers/RangeSlider.java	(revision 25)
+++ trunk/src/scriptbuilder/gui/drawers/RangeSlider.java	(revision 26)
@@ -1,4 +1,6 @@
+package scriptbuilder.gui.drawers;
 
 import javax.swing.JSlider;
+
 /*
 The MIT License
@@ -23,5 +25,5 @@
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-*/
+ */
 
 /**
@@ -29,24 +31,28 @@
  * The thumb controls are used to select the lower and upper value of a range
  * with predetermined minimum and maximum values.
- * 
- * <p>Note that RangeSlider makes use of the default BoundedRangeModel, which 
- * supports an inner range defined by a value and an extent.  The upper value
+ *
+ * <p>
+ * Note that RangeSlider makes use of the default BoundedRangeModel, which
+ * supports an inner range defined by a value and an extent. The upper value
  * returned by RangeSlider is simply the lower value plus the extent.</p>
  */
-public class RangeSlider extends JSlider {
+public class RangeSlider extends JSlider
+{
 
     /**
-     * Constructs a RangeSlider with default minimum and maximum values of 0
-     * and 100.
+     * Constructs a RangeSlider with default minimum and maximum values of 0 and
+     * 100.
      */
-    public RangeSlider() {
+    public RangeSlider()
+    {
         initSlider();
     }
 
     /**
-     * Constructs a RangeSlider with the specified default minimum and maximum 
+     * Constructs a RangeSlider with the specified default minimum and maximum
      * values.
      */
-    public RangeSlider(int min, int max) {
+    public RangeSlider(int min, int max)
+    {
         super(min, max);
         initSlider();
@@ -56,5 +62,6 @@
      * Initializes the slider by setting default properties.
      */
-    private void initSlider() {
+    private void initSlider()
+    {
         setOrientation(HORIZONTAL);
     }
@@ -65,5 +72,6 @@
      */
     @Override
-    public void updateUI() {
+    public void updateUI()
+    {
         setUI(new RangeSliderUI(this));
         // Update UI for slider labels.  This must be called after updating the
@@ -76,5 +84,6 @@
      */
     @Override
-    public int getValue() {
+    public int getValue()
+    {
         return super.getValue();
     }
@@ -84,7 +93,9 @@
      */
     @Override
-    public void setValue(int value) {
+    public void setValue(int value)
+    {
         int oldValue = getValue();
-        if (oldValue == value) {
+        if (oldValue == value)
+        {
             return;
         }
@@ -96,6 +107,6 @@
 
         // Set new value and extent, and fire a single change event.
-        getModel().setRangeProperties(newValue, newExtent, getMinimum(), 
-            getMaximum(), getValueIsAdjusting());
+        getModel().setRangeProperties(newValue, newExtent, getMinimum(),
+                getMaximum(), getValueIsAdjusting());
     }
 
@@ -103,5 +114,6 @@
      * Returns the upper value in the range.
      */
-    public int getUpperValue() {
+    public int getUpperValue()
+    {
         return getValue() + getExtent();
     }
@@ -110,9 +122,10 @@
      * Sets the upper value in the range.
      */
-    public void setUpperValue(int value) {
+    public void setUpperValue(int value)
+    {
         // Compute new extent.
         int lowerValue = getValue();
         int newExtent = Math.min(Math.max(0, value - lowerValue), getMaximum() - lowerValue);
-        
+
         // Set extent to set upper value.
         setExtent(newExtent);
