Ignore:
Timestamp:
2014-02-19T10:26:43+01:00 (12 years ago)
Author:
malcolmh
Message:

save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed2/src/panels/PanelMain.java

    r30285 r30298  
    5252                        if (e.getSource() == importButton) {
    5353                                Smed2Action.panelS57.setVisible(true);
    54         messageBar.setText("Select S-57 ENC file for import");
     54        setStatus("Select S-57 ENC file for import", Color.yellow);
    5555                                int returnVal = ifc.showOpenDialog(Main.parent);
    5656                                if (returnVal == JFileChooser.APPROVE_OPTION) {
     
    6060                                        } catch (IOException e1) {
    6161                                                Smed2Action.panelS57.setVisible(false);
    62                                                 messageBar.setText("IO Exception");
     62                                                setStatus("IO Exception", Color.red);
    6363                                        }
    6464                                } else {
    6565                                        Smed2Action.panelS57.setVisible(false);
    66                                         messageBar.setText("");
     66                                        clrStatus();
    6767                                }
    6868                        }
     
    7676                        if (e.getSource() == exportButton) {
    7777                                Smed2Action.panelS57.setVisible(true);
    78         messageBar.setText("Select S-57 ENC file for export");
     78        setStatus("Select S-57 ENC file for export", Color.yellow);
    7979        int returnVal = efc.showOpenDialog(Main.parent);
    8080        if (returnVal == JFileChooser.APPROVE_OPTION) {
     
    8383                                        } catch (IOException e1) {
    8484                                                Smed2Action.panelS57.setVisible(false);
    85                                                 messageBar.setText("IO Exception");
     85                                                setStatus("IO Exception", Color.red);
    8686                                        }
    8787         } else {
    8888                                        Smed2Action.panelS57.setVisible(false);
    89                                         messageBar.setText("");
     89                                        clrStatus();
    9090         }
    9191      }
     
    153153                g2.setBackground(new Color(0xb5d0d0));
    154154                if (img != null) g2.clearRect(0, 0, img.getWidth(), img.getHeight());
    155                 g2.drawImage(img, 0, 0, null);;
     155                g2.drawImage(img, 0, 0, null);
     156        }
     157       
     158        public static void setStatus(String text, Color bg) {
     159                messageBar.setBackground(bg);
     160                messageBar.setText(text);
     161        }
     162       
     163        public static void clrStatus() {
     164                messageBar.setBackground(Color.white);
     165                messageBar.setText("");
    156166        }
    157167       
Note: See TracChangeset for help on using the changeset viewer.