Changeset 128 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/gui/IncidentPaletteFrame.java


Ignore:
Timestamp:
10/19/2017 03:49:00 PM (9 years ago)
Author:
bmcguffin
Message:

Created stubs for un-implemented features. These features now present a message box which tells the user that the feature hasn't been implemented.

File:
1 edited

Legend:

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

    r127 r128  
    77 
    88import java.awt.GridLayout; 
     9import java.awt.event.KeyEvent; 
     10import java.awt.event.KeyListener; 
    911import java.io.File; 
    1012import java.io.FileFilter; 
     
    3133public class IncidentPaletteFrame extends javax.swing.JFrame 
    3234{ 
    33      
     35 
    3436    private String incDir; 
    3537 
    3638    private SimulationScript script; 
    3739 
    38     private ScriptBuilderFrame parent; 
     40    private final ScriptBuilderFrame parent; 
    3941 
    4042    private SimulationScript dummyScript; 
     
    6971        initComponents(); 
    7072 
    71         String propfilename = "/scriptbuilder/gui/application.properties"; 
     73        txtSearchFilter.addKeyListener(new KeyListener() 
     74        { 
     75 
     76            @Override 
     77            public void keyTyped(KeyEvent e) 
     78            { 
     79            } 
     80 
     81            @Override 
     82            public void keyPressed(KeyEvent e) 
     83            { 
     84                if (e.getKeyCode() == KeyEvent.VK_ENTER) 
     85                { 
     86                    /*This feature has not yet been implemented. Show a message and just return.*/ 
     87                    if (true) 
     88                    { 
     89                        JOptionPane.showMessageDialog(txtSearchFilter.getTopLevelAncestor(), "This feature has not yet been implemented.\n", 
     90                                "Feature not implemented", JOptionPane.INFORMATION_MESSAGE); 
     91                    } 
     92                } 
     93            } 
     94 
     95            @Override 
     96            public void keyReleased(KeyEvent e) 
     97            { 
     98            } 
     99        }); 
     100 
     101        String fs = System.getProperty("file.separator"); 
     102 
     103        String propfilename = fs + "scriptbuilder" + fs + "gui" + fs + "application.properties"; 
    72104        String propKey = "Incidents.directory"; 
    73105        incDir = ""; 
     
    108140        if (!folder.exists()) 
    109141        { 
    110             JOptionPane.showMessageDialog(this,  
     142            JOptionPane.showMessageDialog(this, 
    111143                    "Unable to locate folder of existing incidents.\n" 
    112                   + "Folder \""+incDir+"\" should have been included in the\n" 
    113                   + "ScriptBuilder.zip file you downloaded.\n" 
    114                   + "TO FIX: Close the ScriptBuilder program and run it from\n" 
    115                   + "the same directory where you opened the .zip file.\n\n" 
    116                   + "(If the problem persists, contact the developers.)", "Missing Folder: \""+incDir+"\"", JOptionPane.ERROR_MESSAGE); 
     144                    + "Folder \"" + incDir + "\" should have been included in the\n" 
     145                    + "ScriptBuilder.zip file you downloaded.\n" 
     146                    + "TO FIX: Close the ScriptBuilder program and run it from\n" 
     147                    + "the same directory where you opened the .zip file.\n\n" 
     148                    + "(If the problem persists, contact the developers.)", "Missing Folder: \"" + incDir + "\"", JOptionPane.ERROR_MESSAGE); 
    117149            return newList; 
    118150        } 
    119          
     151 
    120152        incidentFiles = folder.listFiles(); 
    121153 
Note: See TracChangeset for help on using the changeset viewer.