Changeset 61 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/gui/IncidentEditorFrame.java


Ignore:
Timestamp:
08/19/2017 04:42:55 AM (9 years ago)
Author:
bmcguffin
Message:

Made a few cosmetic changes to the code. Added a statement in the update method of IncidentEditorFrame? which tries to set the maximum scale of the zoom slider at an appropriate level.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/gui/IncidentEditorFrame.java

    r55 r61  
    99import java.awt.Adjustable; 
    1010import java.awt.Color; 
    11 import java.awt.Cursor; 
    1211import java.awt.event.AdjustmentEvent; 
    1312import java.awt.event.AdjustmentListener; 
    1413import java.awt.event.KeyEvent; 
    1514import java.awt.event.KeyListener; 
    16 import java.io.File; 
    1715import java.io.IOException; 
    1816import java.util.ArrayList; 
     
    2523import javax.swing.DefaultListModel; 
    2624import javax.swing.JButton; 
    27 import javax.swing.JFileChooser; 
    28 import javax.swing.JOptionPane; 
    29 import javax.swing.UIManager; 
    30 import javax.swing.UnsupportedLookAndFeelException; 
    3125import scriptbuilder.structures.ScriptEvent; 
    3226import scriptbuilder.structures.ScriptEvent.ScriptEventType; 
     
    3428import scriptbuilder.structures.ScriptIncident.IncidentFocusedEvent; 
    3529import scriptbuilder.structures.ScriptIncident.SliceChangedEvent; 
    36 import scriptbuilder.structures.SimulationScript; 
    3730import scriptbuilder.structures.TimeSlice; 
    3831import scriptbuilder.structures.events.I_ScriptEvent; 
     
    355348            //gotoIncident.setSelectedItem(i); 
    356349        } 
     350        zoomSlider.setMinimum(((timelineTickPanel.getVisibleRect().width - 20) 
     351                * ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION) 
     352                / Math.max(theIncident.length, 1)); 
     353        zoomSlider.setMaximum(zoomSlider.getMinimum() + 20); 
    357354    } 
    358355 
Note: See TracChangeset for help on using the changeset viewer.