Fix wrong Scale calculation for Matplot1.
[scilab.git] / scilab / modules / scinotes / src / java / org / scilab / modules / scinotes / actions / ConfigTabulationsAction.java
index c486fce..2557b95 100644 (file)
@@ -37,20 +37,18 @@ import javax.swing.JScrollBar;
 import javax.swing.JSpinner;
 import javax.swing.KeyStroke;
 import javax.swing.SpinnerNumberModel;
-import javax.swing.text.View;
 
 import org.scilab.modules.commons.ScilabConstants;
 import org.scilab.modules.gui.menuitem.MenuItem;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.scinotes.IndentManager;
 import org.scilab.modules.scinotes.SciNotes;
 import org.scilab.modules.scinotes.ScilabDocument;
 import org.scilab.modules.scinotes.ScilabEditorPane;
 import org.scilab.modules.scinotes.ScilabView;
-import org.scilab.modules.scinotes.ScilabPlainView;
 import org.scilab.modules.scinotes.TabManager;
-import org.scilab.modules.scinotes.utils.SciNotesMessages;
 import org.scilab.modules.scinotes.utils.ConfigSciNotesManager;
-
+import org.scilab.modules.scinotes.utils.SciNotesMessages;
 /**
  * ConfigTabulationsAction Class
  * @author Calixte DENIZET
@@ -86,8 +84,9 @@ public class ConfigTabulationsAction extends DefaultAction {
     /**
      * doAction
      */
+    @Override
     public void doAction() {
-        ScilabEditorPane sep = (ScilabEditorPane) getEditor().getTextPane();
+        ScilabEditorPane sep = getEditor().getTextPane();
         openConfTabWindow();
     }
 
@@ -125,10 +124,11 @@ public class ConfigTabulationsAction extends DefaultAction {
         TabManager.Tabulation tabProps = ConfigSciNotesManager.getDefaultTabulation();
 
         mainFrame = new JFrame();
-        mainFrame.setIconImage(new ImageIcon(SCI + "/modules/gui/images/icons/scilab.png").getImage());
+        mainFrame.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
         mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         mainFrame.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE , 0), ESCAPE);
         mainFrame.getRootPane().getActionMap().put(ESCAPE, new AbstractAction() {
+                @Override
                 public void actionPerformed(ActionEvent e) {
                     closeConfTabWindow();
                 }
@@ -186,6 +186,7 @@ public class ConfigTabulationsAction extends DefaultAction {
 
         contentPanel.add(panelRepresentation);
         useWhitesCheckBox.addActionListener(new ActionListener() {
+                @Override
                 public void actionPerformed(ActionEvent e) {
                     boolean b = !useWhitesCheckBox.isSelected();
                     for (Component c : panelRepresentation.getComponents()) {
@@ -207,6 +208,7 @@ public class ConfigTabulationsAction extends DefaultAction {
         mainFrame.setContentPane(framePanel);
 
         cancelButton.addActionListener(new ActionListener() {
+                @Override
                 public void actionPerformed(ActionEvent e) {
                     ConfigTabulationsAction.windowAlreadyExist = false;
                     mainFrame.dispose();
@@ -214,6 +216,7 @@ public class ConfigTabulationsAction extends DefaultAction {
             });
 
         okButton.addActionListener(new ActionListener() {
+                @Override
                 public void actionPerformed(ActionEvent e) {
                     ConfigTabulationsAction.windowAlreadyExist = false;
                     refreshPane();
@@ -222,11 +225,11 @@ public class ConfigTabulationsAction extends DefaultAction {
             });
 
         applyButton.addActionListener(new ActionListener() {
+                @Override
                 public void actionPerformed(ActionEvent e) {
                     ScilabEditorPane sep = getEditor().getTextPane();
                     IndentManager indent = sep.getIndentManager();
                     ScilabDocument doc = (ScilabDocument) sep.getDocument();
-                    int currentLine = doc.getDefaultRootElement().getElementIndex(sep.getCaretPosition());
                     JScrollBar sb = sep.getScrollPane().getHorizontalScrollBar();
                     int val = -1;
                     if (sb != null) {
@@ -241,16 +244,23 @@ public class ConfigTabulationsAction extends DefaultAction {
             });
 
         mainFrame.addWindowListener(new WindowListener() {
+                @Override
                 public void windowClosed(WindowEvent arg0) { }
+                @Override
                 public void windowDeiconified(WindowEvent arg0) { }
+                @Override
                 public void windowActivated(WindowEvent arg0) { }
 
+                @Override
                 public void windowClosing(WindowEvent arg0) {
                     closeConfTabWindow();
                 }
 
+                @Override
                 public void windowDeactivated(WindowEvent arg0) { }
+                @Override
                 public void windowIconified(WindowEvent arg0) { };
+                @Override
                 public void windowOpened(WindowEvent arg0) { }
             });