Back to index

wims  3.65+svn20090927
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Package Attributes | Static Package Attributes | Private Member Functions | Private Attributes | Static Private Attributes
SharpTools.SharpTools Class Reference

This is the graphical user interface class for the spreadsheet. More...

Inheritance diagram for SharpTools.SharpTools:
Inheritance graph
[legend]
Collaboration diagram for SharpTools.SharpTools:
Collaboration graph
[legend]

List of all members.

Classes

class  HeaderMouseAdapter

Public Member Functions

History getHistory ()
JTable getTable ()
SharpTableModel getTableModel ()
JToolBar getToolBar ()
 SharpTools (boolean is_this_the_applet, String lang)
 Creates new SharpTools.
void setColumnWidth (int colWidth)
void newTableModel (int rows, int cols)
 Creates new blank SharpTableModel object with specified number of rows and columns.
void noCellsSelected (String s)
 a function to display warning messages
void exit ()
 Exit the Application.
void checkSaveState ()
 Check menu items and toolbar buttons Set to appropriate status (disable/enable)
void checkPasswordState ()
 Check the set password toolbar button icon Change the icon based on whether password is set.
void checkUndoRedoState ()
 Check the undo/redo menu/button state Enable only when it's undoable/redoable.
void checkFindNextState ()
 Check the find next menu/button state Enable only when the user has searched once.
void checkShowHistogramState ()
 Check the show histogram menu Enable only when there is at least one histogram defined.
void setBaseColumnWidth (int width)
void valueChanged (ListSelectionEvent e)
void resetSelection ()
void ReStart ()
String ReadRawSpreadSheet ()
String ReadSpreadSheet (boolean matrix)
Properties loadProperties (String lang)

Static Public Member Functions

static Config getConfig ()
static void main (String args[])
 This is the main method that gets the ball rolling.
static ImageIcon getImageIcon (String name)

Public Attributes

SharpOptionPane sharpoptionpane
int firstColWidth

Static Public Attributes

static Properties translation = new Properties()
static int baseRow = 0
static int baseCol = 1

Protected Attributes

int maxNumPage = 1

Package Attributes

SharpTools spreadsheet
ImageIcon newIcon = new ImageIcon(getClass().getResource("/images/new.gif"))
ImageIcon openIcon = new ImageIcon(getClass().getResource("/images/open.gif"))
ImageIcon saveIcon = new ImageIcon(getClass().getResource("/images/save.gif"))
ImageIcon unlockedIcon = new ImageIcon(getClass().getResource("/images/unlocked.gif"))
ImageIcon lockedIcon = new ImageIcon(getClass().getResource("/images/locked.gif"))
ImageIcon printIcon = new ImageIcon(getClass().getResource("/images/print.gif"))
ImageIcon undoIcon = new ImageIcon(getClass().getResource("/images/undo.gif"))
ImageIcon redoIcon = new ImageIcon(getClass().getResource("/images/redo.gif"))
ImageIcon cutIcon = new ImageIcon(getClass().getResource("/images/cut.gif"))
ImageIcon copyIcon = new ImageIcon(getClass().getResource("/images/copy.gif"))
ImageIcon pasteIcon = new ImageIcon(getClass().getResource("/images/paste.gif"))
ImageIcon findIcon = new ImageIcon(getClass().getResource("/images/find.gif"))
ImageIcon insertRowIcon = new ImageIcon(getClass().getResource("/images/insertrow.gif"))
ImageIcon insertColumnIcon = new ImageIcon(getClass().getResource("/images/insertcolumn.gif"))
ImageIcon deleteRowIcon = new ImageIcon(getClass().getResource("/images/deleterow.gif"))
ImageIcon deleteColumnIcon = new ImageIcon(getClass().getResource("/images/deletecolumn.gif"))
ImageIcon sortIcon = new ImageIcon(getClass().getResource("/images/sort.gif"))
ImageIcon chartIcon = new ImageIcon(getClass().getResource("/images/chart.gif"))
ImageIcon helpIcon = new ImageIcon(getClass().getResource("/images/help.gif"))
ImageIcon exitIcon = new ImageIcon(getClass().getResource("/images/no.gif"))

Static Package Attributes

static boolean inapplet = false
static String language = "en"

Private Member Functions

void notYetImplemented ()
 The error message for clicks on functions we haven't done yet.
void openInitFile (String filename)
 Directly open a file with specified name - used only in main.

Private Attributes

Container container
JTable table
JScrollPane scrollPane
JToolBar toolBar
JMenuBar menuBar
JPanel barPanel
History history
Histogram histogram
SharpTableModel tableModel
ListSelectionModel rowSelectionModel
ListSelectionModel columnSelectionModel
URL url
FileOp fileOp
EditOp editOp
TableOp tableOp
JMenu fileMenu
JMenu openMenu
JMenu recentMenu
JMenu editMenu
JMenu tableMenu
JMenu chartMenu
JMenu helpMenu
JMenu insertMenu
JMenu deleteMenu
JMenu sortMenu
JMenuItem saveMenuItem
JCheckBoxMenuItem saveOnExitMenuItem
JMenuItem undoMenuItem
JMenuItem redoMenuItem
JMenuItem findNextMenuItem
JCheckBoxMenuItem showHistogramMenuItem
JCheckBoxMenuItem showFunctionsMenuItem
JButton exitButton
JButton saveButton
JButton passwordButton
JButton undoButton
JButton redoButton
JComponent funcList
CellRange cellrange

Static Private Attributes

static Config config

Detailed Description

This is the graphical user interface class for the spreadsheet.

The initial size of the window can be controlled by editing the sharptools.ini file. This class also contains button and menu initialization and editing methods.

Author:
Daniel Goldberg (initial UI)
Andrei Scudder, Daniel Medina (more work)
Hua Zhong (complete for v1.0)
Version:
Revision:
1.178

Definition at line 31 of file SharpTools.java.


Constructor & Destructor Documentation

SharpTools.SharpTools.SharpTools ( boolean  is_this_the_applet,
String  lang 
) [inline]

Creates new SharpTools.

Definition at line 126 of file SharpTools.java.

                                                              {       
        super("Sharp_Tools_Spreadsheet");
       //     setIconImage(Toolkit.getDefaultToolkit().getImage("tools.jpg")); 
       int x;
       int y;
       language=lang;
       System.out.println("in Sharptools.java the language="+language);
       
       if(is_this_the_applet){
           inapplet = true;
           x = MainApplet.X;                                                                                                                
            y = MainApplet.Y;
       }
       else
       {
           x = config.getInt("X");
           y = config.getInt("Y");
       }
       translation=loadProperties(language);
       Dimension scrdim = getToolkit().getScreenSize();

       // make sure the point is valid
       if (x>=0 && y>=0 &&
           x<(int)scrdim.getWidth() && y <(int)scrdim.getHeight())
           setLocation(x, y);
       
       setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
        // get content pane
       container = this.getContentPane();
       container.setLayout(new BorderLayout());

       // create the table
       table = new JTable();

       // create the Functions combobox in the table
       funcList = HelpOp.createFunctionListComponent(this, table);
       
       // set up fileMenu
        fileMenu = new JMenu("File", true);
       fileMenu.setMnemonic(KeyEvent.VK_F); //used constructor instead
       // add fileMenu actions
       JMenuItem menuItem = new JMenuItem(translation.getProperty("New"));
       menuItem.setMnemonic(KeyEvent.VK_N);
        menuItem.setAccelerator(KeyStroke.getKeyStroke(
                            KeyEvent.VK_N, ActionEvent.CTRL_MASK));
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  if(!inapplet){fileOp.newFile();}else{ReStart();}
              }
           });
       fileMenu.add(menuItem);
       if(!inapplet){
           // SJK Added
           openMenu = new JMenu (translation.getProperty("Open"));
           openMenu.setMnemonic (KeyEvent.VK_O);
           menuItem = new JMenuItem (translation.getProperty("File"));
           menuItem.setMnemonic (KeyEvent.VK_F);
           menuItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_O, ActionEvent.CTRL_MASK));
           menuItem.addActionListener (new ActionListener () {
              public void actionPerformed (ActionEvent evt) {
                  fileOp.openFile ();
              }
           } );
           openMenu.add (menuItem);
           menuItem = new JMenuItem (translation.getProperty("Database"));
           menuItem.setMnemonic (KeyEvent.VK_D);
           menuItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_D, ActionEvent.CTRL_MASK));
           menuItem.addActionListener (new ActionListener () {
              public void actionPerformed (ActionEvent evt) {
                  fileOp.openDb ();
              }
           } );
           openMenu.add (menuItem);
           fileMenu.add (openMenu);
           // use provate member for further reference
           saveMenuItem = new JMenuItem(translation.getProperty("Save"));
           saveMenuItem.setMnemonic(KeyEvent.VK_S);
           saveMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
           saveMenuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  fileOp.saveFile();
              }
           });
           fileMenu.add(saveMenuItem);
       
           menuItem = new JMenuItem(translation.getProperty("Save_As"));
           menuItem.setMnemonic(KeyEvent.VK_A);
           //        menuItem.setAccelerator(KeyStroke.getKeyStroke(
           //                      KeyEvent.VK_A, ActionEvent.CTRL_MASK));
           menuItem.addActionListener (new ActionListener () {
              public void actionPerformed (ActionEvent evt) {
                  fileOp.saveAsFile();
              }
           });
           fileMenu.add(menuItem);
           
           menuItem = new JMenuItem(translation.getProperty("Set_Password"));
           menuItem.setMnemonic(KeyEvent.VK_E);
           menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  fileOp.setPassword();
                  checkPasswordState();
              }
           });
           fileMenu.add(menuItem);
           fileMenu.addSeparator();
           menuItem = new JMenuItem(translation.getProperty("Print"));
           menuItem.setMnemonic(KeyEvent.VK_P); //used constructor instead
           menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK));
           menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  //notYetImplemented();         
                  Thread runner = new Thread() {
                         public void run() {
                            fileOp.printData();
                         }
                     };
                  runner.start(); 
              }
           });
           fileMenu.add(menuItem);
           fileMenu.addSeparator();

           recentMenu = new JMenu(translation.getProperty("Recent_Files"));
           recentMenu.setMnemonic(KeyEvent.VK_R); //used constructor instead
           recentMenu.addMenuListener(new MenuListener() {
              public void menuCanceled(MenuEvent e) {}
              public void menuDeselected(MenuEvent e) {}
              public void menuSelected(MenuEvent e) {
                  fileOp.createRecentFilesMenu(recentMenu);
              }
           });
       
           fileMenu.add(recentMenu);
       
           fileMenu.addSeparator();

           //set up Save Window on Exit
           saveOnExitMenuItem = new JCheckBoxMenuItem(translation.getProperty("Save_Window_on_Exit"));
           saveOnExitMenuItem.setMnemonic(KeyEvent.VK_W);
           saveOnExitMenuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  config.setBoolean("SAVEWINDOW", saveOnExitMenuItem.isSelected());
              }
           });
           // initialize
           saveOnExitMenuItem.setSelected(config.getBoolean("SAVEWINDOW"));
           fileMenu.add(saveOnExitMenuItem);
           fileMenu.addSeparator();
           menuItem = new JMenuItem(translation.getProperty("Exit"));
           menuItem.setMnemonic(KeyEvent.VK_X);
           menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, ActionEvent.CTRL_MASK));
           menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  //exitMenuActionPerformed(evt);
                  exit();
              }
           });
           fileMenu.add(menuItem);
       } // einde if(!inapplet){}
       
       //Set up Edit menu
       editMenu = new JMenu(translation.getProperty("Edit"), true);
       editMenu.setMnemonic(KeyEvent.VK_E);

        // Undo
        undoMenuItem = new JMenuItem(translation.getProperty("Undo"));
        undoMenuItem.setMnemonic(KeyEvent.VK_U);
        undoMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, ActionEvent.CTRL_MASK));
       undoMenuItem.addActionListener (new ActionListener () {
            public void actionPerformed (ActionEvent evt) {
              // save current selection
              history.undo(tableModel);
           }
       });
        editMenu.add(undoMenuItem);

       // Redo
       redoMenuItem = new JMenuItem(translation.getProperty("Redo"));
        redoMenuItem.setMnemonic(KeyEvent.VK_R);
        redoMenuItem.setAccelerator(KeyStroke.getKeyStroke(
                            KeyEvent.VK_Y, ActionEvent.CTRL_MASK));
       redoMenuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  history.redo(tableModel);
              }
           });
        editMenu.add(redoMenuItem);
       editMenu.addSeparator();

       // cut
       menuItem = new JMenuItem(translation.getProperty("Cut"));
       menuItem.setMnemonic(KeyEvent.VK_T); 
       menuItem.setAccelerator(KeyStroke.getKeyStroke(
                            KeyEvent.VK_X, ActionEvent.CTRL_MASK));
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  editOp.cut();
                }
            });
       editMenu.add(menuItem);

       // copy
       menuItem = new JMenuItem(translation.getProperty("Copy"));
        menuItem.setMnemonic(KeyEvent.VK_C); 
       menuItem.setAccelerator(KeyStroke.getKeyStroke(
                            KeyEvent.VK_C, ActionEvent.CTRL_MASK));
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  editOp.copy();
              }
           });
       editMenu.add(menuItem);

       // paste
       menuItem = new JMenuItem(translation.getProperty("Paste"));
       menuItem.setMnemonic(KeyEvent.VK_P); 
       menuItem.setAccelerator(KeyStroke.getKeyStroke
                            (KeyEvent.VK_V, ActionEvent.CTRL_MASK));
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  editOp.paste();
              }
           });
       editMenu.add(menuItem);
       editMenu.addSeparator();

       // Fill
       menuItem = new JMenuItem(translation.getProperty("Fill"));
       menuItem.setMnemonic(KeyEvent.VK_F);
        menuItem.setAccelerator(KeyStroke.getKeyStroke
                            (KeyEvent.VK_L, ActionEvent.CTRL_MASK));
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                editOp.fill();
              }
           }); 
       editMenu.add(menuItem);

       // Clear
       menuItem = new JMenuItem(translation.getProperty("Clear"));
       menuItem.setMnemonic(KeyEvent.VK_L);
       menuItem.setAccelerator(KeyStroke.getKeyStroke
                            (KeyEvent.VK_DELETE, 0, true));
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  editOp.clear();
              }
           });
       editMenu.add(menuItem);
       editMenu.addSeparator();

       // Find
       menuItem = new JMenuItem(translation.getProperty("Find"));
       menuItem.setMnemonic(KeyEvent.VK_F);
        menuItem.setAccelerator(KeyStroke.getKeyStroke
                            (KeyEvent.VK_F, ActionEvent.CTRL_MASK));
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  editOp.find(true);
              }
           });
       editMenu.add(menuItem);
       
       findNextMenuItem = new JMenuItem(translation.getProperty("Find_Next"));
       findNextMenuItem.setMnemonic(KeyEvent.VK_N);
        findNextMenuItem.setAccelerator(KeyStroke.getKeyStroke
                                (KeyEvent.VK_F3, 0));
       findNextMenuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  editOp.find(false);
              }
           });
       editMenu.add(findNextMenuItem);
       
       //set up tablemenu
       tableMenu = new JMenu(translation.getProperty("Table"), true);
       tableMenu.setMnemonic(KeyEvent.VK_T);
       //set up tableMenu actions
       insertMenu = new JMenu(translation.getProperty("Insert"));
       insertMenu.setMnemonic(KeyEvent.VK_I);
       
       menuItem = new JMenuItem(translation.getProperty("Row"));
       menuItem.setMnemonic(KeyEvent.VK_R);
        menuItem.setAccelerator(KeyStroke.getKeyStroke
                            (KeyEvent.VK_INSERT, ActionEvent.CTRL_MASK));
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  tableOp.insert(true);
              }
              });
       insertMenu.add(menuItem);
       
       menuItem = new JMenuItem(translation.getProperty("Column"));
       menuItem.setMnemonic(KeyEvent.VK_C);
       menuItem.setAccelerator(KeyStroke.getKeyStroke
                            (KeyEvent.VK_INSERT,
                             ActionEvent.CTRL_MASK|
                             ActionEvent.SHIFT_MASK));  
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  tableOp.insert(false);
              }
           });
       insertMenu.add(menuItem);
       tableMenu.add(insertMenu);

       //set up Delete actions
        deleteMenu = new JMenu(translation.getProperty("Delete"));
       deleteMenu.setMnemonic(KeyEvent.VK_D);
       menuItem = new JMenuItem(translation.getProperty("Row"));
       menuItem.setMnemonic(KeyEvent.VK_R);
       menuItem.setAccelerator(KeyStroke.getKeyStroke
                            (KeyEvent.VK_DELETE, ActionEvent.CTRL_MASK));
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  //notYetImplemented();
                    tableOp.remove(true);
              }
           });
       deleteMenu.add(menuItem);
       menuItem = new JMenuItem(translation.getProperty("Column"));
       menuItem.setMnemonic(KeyEvent.VK_C);
       menuItem.setAccelerator(KeyStroke.getKeyStroke
                            (KeyEvent.VK_DELETE,
                             ActionEvent.CTRL_MASK|
                             ActionEvent.SHIFT_MASK));
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  //notYetImplemented();
                    tableOp.remove(false);
              }
           });
       deleteMenu.add(menuItem);
       tableMenu.add(deleteMenu);
       
       tableMenu.addSeparator();
       //set up Sort actions
       sortMenu = new JMenu(translation.getProperty("Sort"));
       sortMenu.setMnemonic(KeyEvent.VK_S);
       menuItem = new JMenuItem(translation.getProperty("Row"));
       menuItem.setMnemonic(KeyEvent.VK_R);
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                    tableOp.sort(true);
              }
           });
       sortMenu.add(menuItem);
       menuItem = new JMenuItem(translation.getProperty("Column"));
       menuItem.setMnemonic(KeyEvent.VK_C);
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  tableOp.sort(false);
              }
           });
       sortMenu.add(menuItem);
       tableMenu.add(sortMenu);
       tableMenu.addSeparator();
       
       menuItem = new JMenuItem(translation.getProperty("Set_Column_Width"));
       menuItem.setMnemonic(KeyEvent.VK_W);
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  tableOp.setColumnWidth();
              }
           });
       tableMenu.add(menuItem);
       menuItem = new JMenuItem(translation.getProperty("Set_First_Column_Width"));
       menuItem.setMnemonic(KeyEvent.VK_W);
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  tableOp.setFirstColumnWidth();
              }
           });
       tableMenu.add(menuItem);
       
       //set up Histogram menu
       chartMenu = new JMenu(translation.getProperty("Chart"), true);
       chartMenu.setMnemonic(KeyEvent.VK_C);

       chartMenu.addMenuListener (new MenuListener () {
                public void menuSelected (MenuEvent e) {
                  checkShowHistogramState();
              }
              public void menuDeselected (MenuEvent e) { }
              public void menuCanceled (MenuEvent e) { }              
           });


       //set up Show Histogram actions
       showHistogramMenuItem = new JCheckBoxMenuItem(translation.getProperty("Show"));
       showHistogramMenuItem.setMnemonic(KeyEvent.VK_S);
        showHistogramMenuItem.setAccelerator(KeyStroke.getKeyStroke
                                    (KeyEvent.VK_F8, 0));
       showHistogramMenuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  histogram.toggle();
              }
           }); 
       chartMenu.add(showHistogramMenuItem);     

       //set up Add Histogram actions
       menuItem = new JMenuItem(translation.getProperty("Histogram"));
       menuItem.setMnemonic(KeyEvent.VK_H);
        menuItem.setAccelerator(KeyStroke.getKeyStroke
                            (KeyEvent.VK_H, ActionEvent.CTRL_MASK));
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  histogram.addHistogram();
              }
           }); 

       chartMenu.add(menuItem);
       tableMenu.add(chartMenu);


       //set up Help menu
       helpMenu = new JMenu(translation.getProperty("Help"), true);
       helpMenu.setMnemonic(KeyEvent.VK_H);

       //set up Help actions        
       menuItem = new JMenuItem(translation.getProperty("Help_Topics"));
       menuItem.setMnemonic(KeyEvent.VK_H);
       menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));

       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  // testcode
                  try {
                     URL url = new URL("http://localhost/sharptools/");
                     new HelpOp(url);
                  } catch(MalformedURLException e) {
                     e.printStackTrace();
                     return;
                  }
              }
           });
       helpMenu.add(menuItem);

       showFunctionsMenuItem = new JCheckBoxMenuItem(translation.getProperty("Show_Functions"));
       showFunctionsMenuItem.setMnemonic(KeyEvent.VK_S);
       if(inapplet){
           showFunctionsMenuItem.setSelected(MainApplet.TOOLBAR_FUNCTIONS);
       }
       else
       {
           showFunctionsMenuItem.setSelected(config.getBoolean("TOOLBAR_FUNCTIONS"));
       }
       showFunctionsMenuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  boolean showFunc = showFunctionsMenuItem.isSelected();
                  if(!inapplet){
                     config.setBoolean("TOOLBAR_FUNCTIONS", showFunc);
                  }
                  funcList.setVisible(showFunc);            
                  // repaint
              }
            });
       
       helpMenu.add(showFunctionsMenuItem);

       helpMenu.addSeparator();
       menuItem = new JMenuItem(translation.getProperty("About_SharpTools"));
       menuItem.setMnemonic(KeyEvent.VK_A); 
       menuItem.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  HelpOp.showAboutBox(SharpTools.this);
                  table.requestFocus();
              }
            });
       helpMenu.add(menuItem); 
       
        // set up menu bar and menus
        menuBar = new JMenuBar();

        menuBar.add(fileMenu);
        menuBar.add(editMenu);
        menuBar.add(tableMenu);
       menuBar.add(chartMenu);
        menuBar.add(helpMenu);
        
        // button initializations
        //JButton newButton = new JButton(newIcon);
        JButton newButton = new JButton(getImageIcon("images/new.gif"));
       JButton exitButton = new JButton(exitIcon);
       JButton openButton = new JButton(openIcon);
       JButton printButton = new JButton(printIcon);
       passwordButton = new JButton(unlockedIcon);
       saveButton = new JButton(saveIcon);
       if(inapplet){
           if(MainApplet.TOOLBAR_NEW){
              newButton = new JButton(newIcon);
              newButton.setToolTipText(translation.getProperty("New"));
              newButton.addActionListener (new ActionListener () {
                  public void actionPerformed (ActionEvent evt) {
                     MainApplet.AppletReply="";
                     ReStart();
                     table.requestFocus();
                  }
              });
              exitButton.setToolTipText(translation.getProperty("Close"));                                                                                            
              exitButton.addActionListener (new ActionListener () {                                                                          
                  public void actionPerformed (ActionEvent evt) {                                                                            
                     //System.out.println("clicked close");                                                                                   
                     setVisible( false );                                                                                                   
                     };                                                                                                                         
                  }                                                                                                                          
              ); 
           }
       }
       else
       {
       
           newButton.setToolTipText(translation.getProperty("New"));
           newButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  fileOp.newFile();
                  table.requestFocus();
              }
           });
           openButton.setToolTipText(translation.getProperty("Open"));
           openButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  fileOp.openFile();
                  table.requestFocus();
              }
           });
       
           // we save this button as private member for further reference
           saveButton.setToolTipText(translation.getProperty("Save"));
           saveButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  fileOp.saveFile();
                  table.requestFocus();
              }
           });
       
           // we save this button as private member for further reference    
           passwordButton.setToolTipText(translation.getProperty("Set_Password"));
           passwordButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  fileOp.setPassword();
                  table.requestFocus();
              }
           });

           printButton.setToolTipText(translation.getProperty("Print"));
           printButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  Thread runner = new Thread() {
                         public void run() {
                            fileOp.printData();
                         }
                     };
                  runner.start();
                  table.requestFocus();
              }
           });
       }
       undoButton = new JButton(undoIcon);
       undoButton.setToolTipText(translation.getProperty("Undo"));
       undoButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  history.undo(tableModel);
                  table.requestFocus();
              }
           });

       redoButton = new JButton(redoIcon);
       redoButton.setToolTipText(translation.getProperty("Redo"));
       redoButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  history.redo(tableModel);
                  table.requestFocus();
              }
           });
       
        JButton cutButton = new JButton(cutIcon);
       cutButton.setToolTipText(translation.getProperty("Cut"));
       cutButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  editOp.cut();
                  table.requestFocus();
              }
           });
        JButton copyButton = new JButton(copyIcon);
       copyButton.setToolTipText(translation.getProperty("Copy"));
       copyButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  editOp.copy();
                  table.requestFocus();
              }
           });
       
        JButton pasteButton = new JButton(pasteIcon);
       pasteButton.setToolTipText(translation.getProperty("Paste"));
        pasteButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  editOp.paste();
                  table.requestFocus();
              }
           });

        JButton findButton = new JButton(findIcon);
       findButton.setToolTipText(translation.getProperty("Find"));
        findButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  editOp.find(true);
                  table.requestFocus();
              }
           });

       JButton sortButton = new JButton(sortIcon);
       sortButton.setToolTipText(translation.getProperty("Sort_by_Column"));
        sortButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  tableOp.sort(false);
                  table.requestFocus();
              }
           });

       JButton insertRowButton = new JButton(insertRowIcon);
       insertRowButton.setToolTipText(translation.getProperty("Insert_Row"));
        insertRowButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  tableOp.insert(true);
                  table.requestFocus();
              }
           });

       JButton insertColumnButton = new JButton(insertColumnIcon);
       insertColumnButton.setToolTipText(translation.getProperty("Insert_Column"));
        insertColumnButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  tableOp.insert(false);
                  table.requestFocus();
              }
           });

       JButton deleteRowButton = new JButton(deleteRowIcon);
       deleteRowButton.setToolTipText(translation.getProperty("Delete_Row"));
        deleteRowButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  tableOp.remove(true);
                  table.requestFocus();
              }
           });

       JButton deleteColumnButton = new JButton(deleteColumnIcon);
       deleteColumnButton.setToolTipText(translation.getProperty("Delete_Column"));
        deleteColumnButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  tableOp.remove(false);
                  table.requestFocus();
              }
           });

        JButton chartButton = new JButton(chartIcon);
       chartButton.setToolTipText(translation.getProperty("Histogram"));
        chartButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                  histogram.addHistogram();
                  table.requestFocus();
              }
           });
       
       JButton helpButton = new JButton(helpIcon);
       helpButton.setToolTipText(translation.getProperty("Help"));
       helpButton.addActionListener (new ActionListener () {
                public void actionPerformed (ActionEvent evt) {
                     try {
                         if(!inapplet){
                            String basePath = System.getProperty("user.dir");
                         }
                         url = new URL("http://localhost/sharptools/");
                         new HelpOp(url);

                     } catch(MalformedURLException e) {
                         e.printStackTrace();
                         return;
                     }
                  table.requestFocus();
              }
           });

        /*
        * Set up toolbar
        *
        * Toolbar can be customized in the configuration file.
        */
        toolBar = new JToolBar();
       toolBar.setFloatable(false);
       int w;int h;
       if(!inapplet){
           if (config.getBoolean("TOOLBAR_NEW")){toolBar.add(newButton);}
           if (config.getBoolean("TOOLBAR_OPEN")){toolBar.add(openButton);}
           if (config.getBoolean("TOOLBAR_SAVE")){toolBar.add(saveButton);}
           toolBar.addSeparator();
           if (config.getBoolean("TOOLBAR_PASSWORD")){toolBar.add(passwordButton);}
           if (config.getBoolean("TOOLBAR_PRINT")){toolBar.add(printButton);}
           toolBar.addSeparator();
           if (config.getBoolean("TOOLBAR_UNDO")){toolBar.add(undoButton);}
           if (config.getBoolean("TOOLBAR_REDO")){toolBar.add(redoButton);}
           if (config.getBoolean("TOOLBAR_CUT")){toolBar.add(cutButton);}
           if (config.getBoolean("TOOLBAR_COPY")){toolBar.add(copyButton);}
           if (config.getBoolean("TOOLBAR_PASTE")){toolBar.add(pasteButton);}
           if (config.getBoolean("TOOLBAR_FIND")){toolBar.add(findButton);}
           toolBar.addSeparator();
           if (config.getBoolean("TOOLBAR_INSERTROW")){toolBar.add(insertRowButton);}
           if (config.getBoolean("TOOLBAR_INSERTCOLUMN")){toolBar.add(insertColumnButton);}
           if (config.getBoolean("TOOLBAR_DELETEROW")){toolBar.add(deleteRowButton);}
           if (config.getBoolean("TOOLBAR_DELETECOLUMN")){toolBar.add(deleteColumnButton);}
           if (config.getBoolean("TOOLBAR_SORTCOLUMN")){toolBar.add(sortButton);}
           toolBar.addSeparator();
           if (config.getBoolean("TOOLBAR_HISTOGRAM")) {toolBar.add(chartButton);toolBar.addSeparator();}
           if (config.getBoolean("TOOLBAR_HELP")){toolBar.add(helpButton);}
           toolBar.addSeparator();
           toolBar.add(funcList);
           funcList.setVisible(config.getBoolean("TOOLBAR_FUNCTIONS"));
           newTableModel(config.getInt("ROWS"), config.getInt("COLUMNS"));
           // set window pos and size
           w = config.getInt("WIDTH");
           h = config.getInt("HEIGHT");   
       }
       else // inapplet ; we can't configure the sharptools.ini file...so we depend on params.
       {
           if (MainApplet.TOOLBAR_NEW){toolBar.add(newButton);}
           if (MainApplet.TOOLBAR_OPEN){toolBar.add(openButton);}
           if (MainApplet.TOOLBAR_SAVE){toolBar.add(saveButton);}
           toolBar.addSeparator();
           toolBar.add(exitButton);
           if (MainApplet.TOOLBAR_PASSWORD){toolBar.add(passwordButton);}
           if (MainApplet.TOOLBAR_PRINT){toolBar.add(printButton);}
           toolBar.addSeparator();
           if (MainApplet.TOOLBAR_UNDO){toolBar.add(undoButton);}
           if (MainApplet.TOOLBAR_REDO){toolBar.add(redoButton);}
           if (MainApplet.TOOLBAR_CUT){toolBar.add(cutButton);}
           if (MainApplet.TOOLBAR_COPY){toolBar.add(copyButton);}
           if (MainApplet.TOOLBAR_PASTE){toolBar.add(pasteButton);}
           if (MainApplet.TOOLBAR_FIND){toolBar.add(findButton);}
           toolBar.addSeparator();
           if (MainApplet.TOOLBAR_INSERTROW){toolBar.add(insertRowButton);}
           if (MainApplet.TOOLBAR_INSERTCOLUMN){toolBar.add(insertColumnButton);}
           if (MainApplet.TOOLBAR_DELETEROW){toolBar.add(deleteRowButton);}
           if (MainApplet.TOOLBAR_DELETECOLUMN){toolBar.add(deleteColumnButton);}
           if (MainApplet.TOOLBAR_SORTCOLUMN){toolBar.add(sortButton);}
           toolBar.addSeparator();
           if (MainApplet.TOOLBAR_HISTOGRAM) {toolBar.add(chartButton);toolBar.addSeparator();}
           if (MainApplet.TOOLBAR_HELP){toolBar.add(helpButton);}
           toolBar.addSeparator();
           toolBar.add(funcList);
           funcList.setVisible(MainApplet.TOOLBAR_FUNCTIONS);
           newTableModel(MainApplet.ROWS, MainApplet.COLUMNS);
           // set window pos and size
           w = MainApplet.WIDTH;
           h = MainApplet.HEIGHT;  
       }
       if (w >= 0 && h >= 0)
           table.setPreferredScrollableViewportSize(new Dimension(w, h));

       // init fileOp objects
       if(!inapplet){fileOp = new FileOp(this);}

       // clobber resizing of all columns
       table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        
        // set table editor and renderer to custom ones
       table.setDefaultRenderer(Cell.class, new SharpCellRenderer());
        table.setDefaultEditor(Cell.class, new SharpCellEditor(
                                            new JTextField()));

       // set selection mode for contiguous  intervals
        table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
        table.setCellSelectionEnabled(true);

       // we don't allow reordering
        table.getTableHeader().setReorderingAllowed(false);
       table.getTableHeader().addMouseListener(new HeaderMouseAdapter());
       
       // create selection models
       rowSelectionModel = table.getSelectionModel();
        columnSelectionModel = table.getColumnModel().getSelectionModel();

       // add selection listeners to the selection models
       rowSelectionModel.addListSelectionListener(this);
       columnSelectionModel.addListSelectionListener(this);
       
       // set menu bar
       setJMenuBar(menuBar);
       container.add(toolBar, BorderLayout.NORTH);      
       
       scrollPane = new JScrollPane(table,
                                 JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                                 JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
       
        container.add(scrollPane, BorderLayout.CENTER);
        
        // add window exit listener
        addWindowListener (new WindowAdapter () {
              public void windowOpened (WindowEvent evt) {                
                  table.requestFocus();
              }
              
              public void windowClosing (WindowEvent evt) {
                  exit();
              }
           });

       // initial selection
       resetSelection();
       
       table.setRequestFocusEnabled(true);
       menuBar.setRequestFocusEnabled(false);
       toolBar.setRequestFocusEnabled(false);
       table.requestFocus();       
       
       pack();
       show();
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

Check the find next menu/button state Enable only when the user has searched once.

Definition at line 1110 of file SharpTools.java.

                                     {
       findNextMenuItem.setEnabled(editOp.hasFindValue());
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Check the set password toolbar button icon Change the icon based on whether password is set.

Definition at line 1084 of file SharpTools.java.

                                     {
       if(!inapplet){
           if (fileOp.hasPassword())
              passwordButton.setIcon(lockedIcon);
           else
              passwordButton.setIcon(unlockedIcon);
       }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Check menu items and toolbar buttons Set to appropriate status (disable/enable)

Check the save menu/button state Enable only when the file has been modified

Definition at line 1072 of file SharpTools.java.

                                 {
       boolean modified = tableModel.isModified();
       if(!inapplet){
           saveMenuItem.setEnabled(modified);
           saveButton.setEnabled(modified);
       }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Check the show histogram menu Enable only when there is at least one histogram defined.

Definition at line 1118 of file SharpTools.java.

                                          {      
       showHistogramMenuItem.setState(histogram.isVisible());
       showHistogramMenuItem.setEnabled(histogram.hasChart()); 
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Check the undo/redo menu/button state Enable only when it's undoable/redoable.

Definition at line 1097 of file SharpTools.java.

                                     {
       boolean enable = history.isUndoable();
       undoMenuItem.setEnabled(enable);
       undoButton.setEnabled(enable);
       enable = history.isRedoable();
       redoMenuItem.setEnabled(enable);
       redoButton.setEnabled(enable);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void SharpTools.SharpTools.exit ( ) [inline]

Exit the Application.

Definition at line 1030 of file SharpTools.java.

                       {
       if(!inapplet){
           if (fileOp.closeFile()) {
              // save window position and size
              if (config.getBoolean("SAVEWINDOW")) {
                  config.setInt("X", getX());
                  config.setInt("Y", getY());
                  Dimension dim = scrollPane.getViewport().getExtentSize();
                  config.setInt("WIDTH", (int)dim.getWidth());
                  config.setInt("HEIGHT", (int)dim.getHeight());
              }
              config.save();           
               System.exit(0);
           }
       }
       else
       {
           System.exit(0);
       }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

static Config SharpTools.SharpTools.getConfig ( ) [inline, static]

Definition at line 59 of file SharpTools.java.

{ return config; }    

Here is the caller graph for this function:

Definition at line 61 of file SharpTools.java.

{ return history; }
static ImageIcon SharpTools.SharpTools.getImageIcon ( String  name) [inline, static]

Definition at line 1185 of file SharpTools.java.

                                                      {
       //URL imgurl = SharpTools.class.getResource(name);
       //URL imgurl = getClass().getResource(name);
       //URL imgurl = ClassLoader.getResourceAsStream(name);
       URL imgurl = ClassLoader.getSystemResource(name);
       //URL imgurl = ClassLoader.getResource(name);
       if (imgurl == null) {
           System.out.println("image "+name+" not found");
           return null;
       }
       return new ImageIcon(imgurl);
    }

Here is the caller graph for this function:

JTable SharpTools.SharpTools.getTable ( ) [inline]

Definition at line 62 of file SharpTools.java.

{ return table; }

Here is the caller graph for this function:

Definition at line 63 of file SharpTools.java.

{ return tableModel; }

Here is the caller graph for this function:

JToolBar SharpTools.SharpTools.getToolBar ( ) [inline]

Definition at line 64 of file SharpTools.java.

{ return toolBar; }
Properties SharpTools.SharpTools.loadProperties ( String  lang) [inline]

Definition at line 1269 of file SharpTools.java.

                                                  {
       Properties P=new Properties();      
       // jm.evers : trying global properties file with translations        
       try{
           InputStream in = getClass().getResourceAsStream("/lang/SharpToolsProperties_"+lang+".properties");
           P.load(in);in.close();
           return P;
       }                
       catch (Exception e){ System.out.println("error reading lang/SharpToolsProperties_"+lang+".properties\n"+e);}    
        return null;             
    }                

Here is the caller graph for this function:

static void SharpTools.SharpTools.main ( String  args[]) [inline, static]

This is the main method that gets the ball rolling.

Definition at line 1148 of file SharpTools.java.

                                          {
       if(!inapplet){
           // read configuration file
           config = new Config("sharptools.ini");
           // set default value
           config.setInt("ROWS", 20);
           config.setInt("COLUMNS", 10);
           // config.set("AUTORESIZE", "TRUE");
           config.setInt("HISTOGRAMWIDTH", 600);
           config.setInt("HISTOGRAMHEIGHT", 400);
           // read file
           config.load();
       
           // only change it when DEBUG is uncommented in the config file
           if (config.get("DEBUG") != null)
              Debug.setDebug(config.getBoolean("DEBUG"));
       }
       else
       {    config = new Config("sharptools.ini");
           // set default value
           config.setInt("ROWS", 20);
           config.setInt("COLUMNS", 10);
           // config.set("AUTORESIZE", "TRUE");
           config.setInt("HISTOGRAMWIDTH", 600);
           config.setInt("HISTOGRAMHEIGHT", 400);
           // read file
           config.load();
       }
       // initialize the function handler table object
       Formula.registerFunctions();
       
        SharpTools spreadsheet = new SharpTools(inapplet,language);
        spreadsheet.show();
       if (args.length>0){spreadsheet.openInitFile(args[0]);}
    }

Here is the call graph for this function:

void SharpTools.SharpTools.newTableModel ( int  rows,
int  cols 
) [inline]

Creates new blank SharpTableModel object with specified number of rows and columns.

table is set to this table model to update screen.

Parameters:
rowsnumber of rows in new table model
colsnumber of columns in new table model

Definition at line 963 of file SharpTools.java.

                                                  {
       tableModel = new SharpTableModel(this, rows, cols);
       table.setModel(tableModel);

       setBaseColumnWidth(0);
       if(!inapplet){setColumnWidth(config.getInt("COLUMNWIDTH"));} else {setColumnWidth(MainApplet.COLUMNWIDTH);}
       // update history with new one
       history = new History(this);
       tableModel.setHistory(history);    

       // inform tableModel that it's unmodified now
       tableModel.setPasswordModified(false);
       tableModel.setModified(false);

       // init op objects
       // we shouldn't init fileOp!
       
       if (editOp == null)
           editOp = new EditOp(this);
       else
           /* if we already have an object, we don't construct
              a new EditOp to keep the clipboard and findValue
              still valid.  This makes us be able to exchange
              data across files */
           editOp.init(this);

       tableOp = new TableOp(this);
       if(!inapplet){
           histogram = new Histogram(this, "Histograms",config.getInt("HISTOGRAMWIDTH"),config.getInt("HISTOGRAMHEIGHT"));
       }
       else
       {
           histogram = new Histogram(this, "Histograms",MainApplet.HISTOGRAMWIDTH,MainApplet.HISTOGRAMHEIGHT);
       }
       tableModel.setModified(false);
       
       resetSelection();
       
       // menubar/toolbar initial status
       checkUndoRedoState();
       
       table.requestFocus();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void SharpTools.SharpTools.noCellsSelected ( String  s) [inline]

a function to display warning messages

Parameters:
sthe operation that caused this error

Definition at line 1012 of file SharpTools.java.

                                          {
        sharpoptionpane.showMessageDialog(this, s + ": No cells selected","Error", JOptionPane.ERROR_MESSAGE, null);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void SharpTools.SharpTools.notYetImplemented ( ) [inline, private]

The error message for clicks on functions we haven't done yet.

Definition at line 1019 of file SharpTools.java.

                                    {
       sharpoptionpane.showMessageDialog(this,
                                     "Sorry, this function \n"+
                                     "is not yet implemented!\n"+
                                     "sharp@cs.columbia.edu",
                                     "Sharp Tools Spreadsheet",
                                     JOptionPane.WARNING_MESSAGE,
                                     null);
    }

Here is the call graph for this function:

void SharpTools.SharpTools.openInitFile ( String  filename) [inline, private]

Directly open a file with specified name - used only in main.

Parameters:
filenamethe String of filename

Definition at line 1056 of file SharpTools.java.

                                               {
       if(!inapplet){
           fileOp.openTableModel(new File(filename));
       }
    }

Here is the call graph for this function:

Definition at line 1257 of file SharpTools.java.

                                      {
       // included raw functions like =SUM(1,2,3,4)
       String reply=tableModel.toString();
       return reply;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

String SharpTools.SharpTools.ReadSpreadSheet ( boolean  matrix) [inline]

Definition at line 1263 of file SharpTools.java.

                                                 {
       String reply=tableModel.toWIMS(matrix);
       return reply;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1246 of file SharpTools.java.

                                 {
       table.setRowSelectionInterval(baseRow, baseRow);
       table.setColumnSelectionInterval(baseCol, baseCol);
    }

Here is the caller graph for this function:

void SharpTools.SharpTools.ReStart ( ) [inline]

Definition at line 1251 of file SharpTools.java.

                         {
        setVisible(false);
        SharpTools spreadsheet = new SharpTools(inapplet,language);
        spreadsheet.show();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void SharpTools.SharpTools.setBaseColumnWidth ( int  width) [inline]

Definition at line 1123 of file SharpTools.java.

                                              {
       if(width == 0){
           // resize first column
           if (baseCol > 0) {
              TableColumn firstColumn = table.getColumnModel().getColumn(baseCol-1);
               int firstColWidth;
              if(!inapplet){firstColWidth = config.getInt("FIRSTCOLUMNWIDTH");}else{firstColWidth=MainApplet.FIRSTCOLUMNWIDTH;}
              if (firstColWidth>0) {
                  firstColumn.setMinWidth(firstColWidth);
                  firstColumn.setPreferredWidth(firstColWidth);
              }
           }
       }
       else
       {
           if(width>0){
              TableColumn firstColumn = table.getColumnModel().getColumn(baseCol-1);
              firstColumn.setMinWidth(width);
               firstColumn.setPreferredWidth(width);
           }
       
       }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void SharpTools.SharpTools.setColumnWidth ( int  colWidth) [inline]

Definition at line 945 of file SharpTools.java.

                                             {
       if (colWidth > 0){
           for (int i = baseCol; i < tableModel.getColumnCount(); i ++) {
              TableColumn column = table.getColumnModel().getColumn(i);
              column.setMinWidth(colWidth);
              column.setPreferredWidth(colWidth);

           }
       }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void SharpTools.SharpTools.valueChanged ( ListSelectionEvent  e) [inline]

Definition at line 1217 of file SharpTools.java.

                                                   {
       table.requestFocus();
           
       // Ignore extra messages
       if (e.getValueIsAdjusting()) return;
       
       // Get event source
       ListSelectionModel lsm = (ListSelectionModel)e.getSource();
       
       if (lsm.isSelectionEmpty() && table.getColumnCount() > baseCol &&
           table.getRowCount() > baseRow) {
           // always set selection
           table.setRowSelectionInterval(baseRow, baseRow);
           table.setColumnSelectionInterval(baseCol, baseCol);
       }/* else {
           if (table.getSelectedColumn() < baseCol) {
              int columnCount = table.getColumnCount();
                if (columnCount > baseCol) {
                    Debug.println("setColumnSelectionInterval "
                                  + String.valueOf(baseCol)
                                  + " " + String.valueOf(columnCount - 1));
                              
                    table.setColumnSelectionInterval(baseCol, columnCount - 1);
                    table.removeColumnSelectionInterval(baseRow,baseRow);
                }
                }
              }*/
    }

Member Data Documentation

Definition at line 45 of file SharpTools.java.

Definition at line 122 of file SharpTools.java.

Definition at line 121 of file SharpTools.java.

Definition at line 124 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.chartIcon = new ImageIcon(getClass().getResource("/images/chart.gif")) [package]

Definition at line 117 of file SharpTools.java.

Definition at line 78 of file SharpTools.java.

ListSelectionModel SharpTools.SharpTools.columnSelectionModel [private]

Definition at line 54 of file SharpTools.java.

Definition at line 50 of file SharpTools.java.

Container SharpTools.SharpTools.container [private]

Definition at line 40 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.copyIcon = new ImageIcon(getClass().getResource("/images/copy.gif")) [package]

Definition at line 109 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.cutIcon = new ImageIcon(getClass().getResource("/images/cut.gif")) [package]

Definition at line 108 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.deleteColumnIcon = new ImageIcon(getClass().getResource("/images/deletecolumn.gif")) [package]

Definition at line 115 of file SharpTools.java.

Definition at line 82 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.deleteRowIcon = new ImageIcon(getClass().getResource("/images/deleterow.gif")) [package]

Definition at line 114 of file SharpTools.java.

Definition at line 76 of file SharpTools.java.

Definition at line 67 of file SharpTools.java.

Definition at line 93 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.exitIcon = new ImageIcon(getClass().getResource("/images/no.gif")) [package]

Definition at line 119 of file SharpTools.java.

Definition at line 73 of file SharpTools.java.

Definition at line 66 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.findIcon = new ImageIcon(getClass().getResource("/images/find.gif")) [package]

Definition at line 111 of file SharpTools.java.

Definition at line 89 of file SharpTools.java.

Definition at line 123 of file SharpTools.java.

JComponent SharpTools.SharpTools.funcList [private]

Definition at line 98 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.helpIcon = new ImageIcon(getClass().getResource("/images/help.gif")) [package]

Definition at line 118 of file SharpTools.java.

Definition at line 79 of file SharpTools.java.

Definition at line 47 of file SharpTools.java.

Definition at line 46 of file SharpTools.java.

Definition at line 34 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.insertColumnIcon = new ImageIcon(getClass().getResource("/images/insertcolumn.gif")) [package]

Definition at line 113 of file SharpTools.java.

Definition at line 81 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.insertRowIcon = new ImageIcon(getClass().getResource("/images/insertrow.gif")) [package]

Definition at line 112 of file SharpTools.java.

String SharpTools.SharpTools.language = "en" [static, package]

Definition at line 35 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.lockedIcon = new ImageIcon(getClass().getResource("/images/locked.gif")) [package]

Definition at line 104 of file SharpTools.java.

int SharpTools.SharpTools.maxNumPage = 1 [protected]

Definition at line 37 of file SharpTools.java.

JMenuBar SharpTools.SharpTools.menuBar [private]

Definition at line 44 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.newIcon = new ImageIcon(getClass().getResource("/images/new.gif")) [package]

Definition at line 100 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.openIcon = new ImageIcon(getClass().getResource("/images/open.gif")) [package]

Definition at line 101 of file SharpTools.java.

Definition at line 74 of file SharpTools.java.

Definition at line 95 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.pasteIcon = new ImageIcon(getClass().getResource("/images/paste.gif")) [package]

Definition at line 110 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.printIcon = new ImageIcon(getClass().getResource("/images/print.gif")) [package]

Definition at line 105 of file SharpTools.java.

Definition at line 75 of file SharpTools.java.

Definition at line 97 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.redoIcon = new ImageIcon(getClass().getResource("/images/redo.gif")) [package]

Definition at line 107 of file SharpTools.java.

Definition at line 88 of file SharpTools.java.

ListSelectionModel SharpTools.SharpTools.rowSelectionModel [private]

Definition at line 53 of file SharpTools.java.

Definition at line 94 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.saveIcon = new ImageIcon(getClass().getResource("/images/save.gif")) [package]

Definition at line 102 of file SharpTools.java.

Definition at line 85 of file SharpTools.java.

JCheckBoxMenuItem SharpTools.SharpTools.saveOnExitMenuItem [private]

Definition at line 86 of file SharpTools.java.

JScrollPane SharpTools.SharpTools.scrollPane [private]

Definition at line 42 of file SharpTools.java.

Definition at line 48 of file SharpTools.java.

JCheckBoxMenuItem SharpTools.SharpTools.showFunctionsMenuItem [private]

Definition at line 91 of file SharpTools.java.

JCheckBoxMenuItem SharpTools.SharpTools.showHistogramMenuItem [private]

Definition at line 90 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.sortIcon = new ImageIcon(getClass().getResource("/images/sort.gif")) [package]

Definition at line 116 of file SharpTools.java.

Definition at line 83 of file SharpTools.java.

Definition at line 33 of file SharpTools.java.

JTable SharpTools.SharpTools.table [private]

Definition at line 41 of file SharpTools.java.

Definition at line 77 of file SharpTools.java.

Definition at line 52 of file SharpTools.java.

Definition at line 68 of file SharpTools.java.

JToolBar SharpTools.SharpTools.toolBar [private]

Definition at line 43 of file SharpTools.java.

Properties SharpTools.SharpTools.translation = new Properties() [static]

Definition at line 36 of file SharpTools.java.

Definition at line 96 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.undoIcon = new ImageIcon(getClass().getResource("/images/undo.gif")) [package]

Definition at line 106 of file SharpTools.java.

Definition at line 87 of file SharpTools.java.

ImageIcon SharpTools.SharpTools.unlockedIcon = new ImageIcon(getClass().getResource("/images/unlocked.gif")) [package]

Definition at line 103 of file SharpTools.java.

Definition at line 56 of file SharpTools.java.


The documentation for this class was generated from the following file: