Package kameleon.exception

Examples of kameleon.exception.FileReadingException


    try {
      this.setIconImage((new ImageIcon(
          ImageUtility.getImageBytes(src))).getImage()) ;
      src.close() ;
    } catch (Exception ex) {
      throw new FileReadingException(
          "Unable to load main frame icon") ; //$NON-NLS-1$
    }// try
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ;
    this.pack() ;
    this.setLocationRelativeTo(null) ;
View Full Code Here


    iconLabel.setIcon(new ImageIcon(ImageUtility.getImageBytes(src))) ;
    try {
      src.close() ;
    } catch(IOException ioe) {
      this.model.displayDebugInformation(
          new FileReadingException(ioe.getMessage())) ;
    }// try
  }// initIcon(JLabel, State)
View Full Code Here

        BufferedOutputStream destination = null ;
        BufferedInputStream source = null ;
        InputStream src =
            GuiWorkSpaceManager.class.getResourceAsStream(sourceFile) ;
        if (src == null) {
          throw new FileReadingException(sourceFile) ;
        }// if
        source = new BufferedInputStream(src) ;
        try {
          destination = new BufferedOutputStream(
              new FileOutputStream(targetFile)) ;
View Full Code Here

      isrc = new BufferedInputStream(isrc) ;
      icon = new ImageIcon(ImageUtility.getImageBytes(isrc)) ;
      try {
        isrc.close() ;
      } catch (IOException ioe) {
        throw new FileReadingException(new File(UNKNOWN_FORMAT_FILE)) ;
      }// try
    }// try
   
    return icon ;
  }// getIcon(boolean)
View Full Code Here

      while (next != -1) {
        buffer.add(new Integer(next)) ;
        next = is.read() ;
      }// while
    } catch (IOException e) {
      throw new FileReadingException() ;
    }// try
   
    // Copy the content of the buffer into an array
    byte[] imageBytes = new byte[buffer.size()] ;
    int index = 0 ;
View Full Code Here

          new FileInputStream(source));
      byte[] result = getImageBytes(is) ;
      is.close() ;
      return result ;
    } catch (FileNotFoundException e) {
      throw new FileReadingException(new File(source)) ;
    } catch (IOException e) {
      throw new FileReadingException(new File(source)) ;
    }// try
  }// getImageBytes(String)
View Full Code Here

        SelectionView.class.getResourceAsStream(MORE_INFORMATION_FILE)) ;
    ImageIcon buttonIcon = new ImageIcon(ImageUtility.getImageBytes(src)) ;
    try {
      src.close() ;
    } catch (IOException ioe) {
      throw new FileReadingException(new File(MORE_INFORMATION_FILE)) ;
    }// try
    this.moreInfo = new JButton(buttonIcon);
    this.moreInfo.setToolTipText(MORE_INFO_BUTTON);
    this.moreInfo.setEnabled(SelectionView.this.model.fileIsSelected()
        && (this.model.getSelectedFileInfo().getLastGeneration() != null)) ;
View Full Code Here

        GUI_FLAG_ICON_FILE,
        targetLang.getCountry().getCountry().toLowerCase()) ;
    InputStream src = thisClass.getResourceAsStream(filePath) ;
    File flagFile = new File(filePath) ;
    if (src == null) {
      throw new FileReadingException(flagFile) ;
    }// if
    icon = new ImageIcon(ImageUtility.getImageBytes(
        new BufferedInputStream(src))) ;
    try {
      src.close() ;
    } catch (IOException e) {
      throw new FileReadingException(flagFile) ;
    }// try
   
    // Build menu item
    JMenuItem item = new JMenuItem(icon) ;
    item.setMnemonic(mnemonic) ;
View Full Code Here

TOP

Related Classes of kameleon.exception.FileReadingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.