Ejemplo n.º 1
0
  /** Creates the main window and configures it according to persisted configuration. */
  public void createMainFrame() {

    GUI gUI = configuration.getgUI();

    Rectangle sizeAndLocation = gUI.getImageConflictViewer().getSizeAndLocation();

    this.setSize(sizeAndLocation.getSize());

    Point xyFromConfig = new Point(sizeAndLocation.getLocation());

    if (Screen.isVisibleOnScreen(sizeAndLocation)) {
      this.setLocation(xyFromConfig);
      this.setSize(sizeAndLocation.getSize());
    } else {
      JOptionPane.showMessageDialog(
          null,
          lang.get("errormessage.maingui.locationError"),
          lang.get("errormessage.maingui.errorMessageLabel"),
          JOptionPane.ERROR_MESSAGE);
      logger.logERROR(
          "Could not set location of Image Conflict Viewer GUI to: x = "
              + xyFromConfig.x
              + " and y = "
              + xyFromConfig.y
              + " since that is outside of available screen size.");

      this.setLocation(0, 0);
      this.setSize(
          GUIDefaults.IMAGE_CONFLICT_VIEWER_WIDTH, GUIDefaults.IMAGE_CONFLICT_VIEWER_HEIGHT);
    }

    try {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) {
      logger.logERROR("Could not set desired Look And Feel for Image Conflict Viewer GUI");
      logger.logERROR(e);
    }

    this.setTitle(lang.get("imagemerge.gui.conflict.viewer.title"));
    this.setModalityType(ModalityType.APPLICATION_MODAL);
    this.getContentPane().add(this.createThumbNailsBackgroundPanel(), BorderLayout.CENTER);
  }
Ejemplo n.º 2
0
 public void setColumns() {
   this.setColumnCount(0);
   this.addColumn(lang.get("information.panel.columnNameFileName"));
   this.addColumn(lang.get("variable.pictureDate"));
   this.addColumn(lang.get("variable.pictureTime"));
   this.addColumn(lang.get("variable.cameraModel"));
   this.addColumn(lang.get("variable.shutterSpeed"));
   this.addColumn(lang.get("variable.isoValue"));
   this.addColumn(lang.get("variable.pictureWidth"));
   this.addColumn(lang.get("variable.pictureHeight"));
   this.addColumn(lang.get("variable.apertureValue"));
 }
Ejemplo n.º 3
0
  public static void createAndWriteToFile(DefaultListModel<File> images, File file, Language lang) {

    boolean success = true;

    StringBuilder sb = new StringBuilder(512);

    if (FileUtil.createFile(file)) {
      for (int i = 0; i < images.size(); i++) {
        sb.append(images.get(i).getAbsolutePath() + C.LS);
      }

      try {
        FileUtil.writeToFile(file, sb.toString(), true);
      } catch (IOException e) {
        success = false;
        logger.logERROR("Could not write to file: " + file.getAbsolutePath());
        logger.logERROR(e);
      }
    } else {
      success = false;
      logger.logERROR("Could not create file: " + file.getAbsolutePath());
    }

    if (success) {
      JOptionPane.showMessageDialog(
          null,
          lang.get("maingui.tabbedpane.imagelist.imagelistformat.javaPEG.successfullySaved"),
          "",
          JOptionPane.INFORMATION_MESSAGE);
    } else {
      JOptionPane.showMessageDialog(
          null,
          lang.get("maingui.tabbedpane.imagelist.imagelistformat.javaPEG.notSuccessfullySaved"),
          "",
          JOptionPane.ERROR_MESSAGE);
    }
  }
Ejemplo n.º 4
0
  public void addTableRow(MetaData metaData) {

    String noValue = lang.get("common.missing.value");

    Object[] meta = new Object[9];

    meta[0] = MetaDataUtil.hasValue(metaData.getFileName()) ? metaData.getFileName() : noValue;
    meta[1] =
        MetaDataUtil.hasValue(metaData.getExifDateAsString())
            ? metaData.getExifDateAsString()
            : noValue;
    meta[2] =
        MetaDataUtil.hasValue(metaData.getExifTimeAsString())
            ? metaData.getExifTimeAsString()
            : noValue;
    meta[3] =
        MetaDataUtil.hasValue(metaData.getExifCameraModel())
            ? metaData.getExifCameraModel()
            : noValue;
    meta[4] =
        MetaDataUtil.hasValue(metaData.getExifExposureTime())
            ? metaData.getExifExposureTime()
            : noValue;
    meta[5] =
        MetaDataUtil.hasValue(metaData.getExifISOValue()) ? metaData.getExifISOValue() : noValue;
    meta[6] =
        MetaDataUtil.hasValue(metaData.getExifPictureWidth())
            ? metaData.getExifPictureWidth()
            : noValue;
    meta[7] =
        MetaDataUtil.hasValue(metaData.getExifPictureHeight())
            ? metaData.getExifPictureHeight()
            : noValue;
    meta[8] =
        MetaDataUtil.hasValue(metaData.getExifFNumber()) ? metaData.getExifFNumber() : noValue;

    this.addRow(meta);
  }