Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
GenieTim committed Mar 10, 2021
1 parent f1921a9 commit f916979
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 90 deletions.
16 changes: 11 additions & 5 deletions src/main/java/edu/harvard/mcz/imagecapture/entity/Tracking.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
package edu.harvard.mcz.imagecapture.entity;

import edu.harvard.mcz.imagecapture.ImageCaptureApp;

import java.io.Serializable;
import java.util.Date;

/**
* Tracking generated by hbm2java
*/
public class Tracking implements java.io.Serializable {
public class Tracking implements Serializable {

private static final long serialVersionUID = 3045144335474980280L;

private Long trackingId;
private Specimen specimen;
private String user;
private String eventType;
private String dataShotVersion;
private Date eventDateTime;
private String datashotVersion;

/**
* Utility constructor if no date is needed
*/
public Tracking() {
try {
this.dataShotVersion = ImageCaptureApp.getAppVersion();
this.datashotVersion = ImageCaptureApp.getAppVersion();
} catch (Exception e) {
}
}
Expand Down Expand Up @@ -64,9 +66,13 @@ public Tracking(Specimen specimen, String user, String eventType,

public void setEventType(String eventType) { this.eventType = eventType; }

public void setDataShotVersion(String v) { this.dataShotVersion = v; }
public String getDatashotVersion() {
return datashotVersion;
}

public String getDataShotVersion() { return dataShotVersion; }
public void setDatashotVersion(String datashotVersion) {
this.datashotVersion = datashotVersion;
}

public Date getEventDateTime() {
Date result = this.eventDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,88 +18,15 @@
*/
package edu.harvard.mcz.imagecapture.ui.frame;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.KeyEvent;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.stream.Collectors;

import javax.persistence.OptimisticLockException;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ActionMap;
import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.InputMap;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumn;

import org.hibernate.SessionException;
import org.hibernate.TransactionException;
import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
import org.jdesktop.swingx.autocomplete.ComboBoxCellEditor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.harvard.mcz.imagecapture.ImageCaptureApp;
import edu.harvard.mcz.imagecapture.ImageCaptureProperties;
import edu.harvard.mcz.imagecapture.KeyboardShortcutManager;
import edu.harvard.mcz.imagecapture.Singleton;
import edu.harvard.mcz.imagecapture.SpecimenController;
import edu.harvard.mcz.imagecapture.*;
import edu.harvard.mcz.imagecapture.data.HibernateUtil;
import edu.harvard.mcz.imagecapture.data.LocationInCollection;
import edu.harvard.mcz.imagecapture.data.MetadataRetriever;
import edu.harvard.mcz.imagecapture.entity.Collector;
import edu.harvard.mcz.imagecapture.entity.Determination;
import edu.harvard.mcz.imagecapture.entity.ICImage;
import edu.harvard.mcz.imagecapture.entity.LatLong;
import edu.harvard.mcz.imagecapture.entity.Number;
import edu.harvard.mcz.imagecapture.entity.Specimen;
import edu.harvard.mcz.imagecapture.entity.SpecimenPart;
import edu.harvard.mcz.imagecapture.entity.Tracking;
import edu.harvard.mcz.imagecapture.entity.fixed.Features;
import edu.harvard.mcz.imagecapture.entity.fixed.LifeStage;
import edu.harvard.mcz.imagecapture.entity.fixed.NatureOfId;
import edu.harvard.mcz.imagecapture.entity.fixed.Sex;
import edu.harvard.mcz.imagecapture.entity.fixed.TypeStatus;
import edu.harvard.mcz.imagecapture.entity.fixed.WorkFlowStatus;
import edu.harvard.mcz.imagecapture.entity.*;
import edu.harvard.mcz.imagecapture.entity.fixed.*;
import edu.harvard.mcz.imagecapture.exceptions.SaveFailedException;
import edu.harvard.mcz.imagecapture.lifecycle.CollectorLifeCycle;
import edu.harvard.mcz.imagecapture.lifecycle.HigherTaxonLifeCycle;
import edu.harvard.mcz.imagecapture.lifecycle.NumberLifeCycle;
import edu.harvard.mcz.imagecapture.lifecycle.SpecimenLifeCycle;
import edu.harvard.mcz.imagecapture.lifecycle.SpecimenPartLifeCycle;
import edu.harvard.mcz.imagecapture.lifecycle.TrackingLifeCycle;
import edu.harvard.mcz.imagecapture.lifecycle.*;
import edu.harvard.mcz.imagecapture.ui.ButtonEditor;
import edu.harvard.mcz.imagecapture.ui.ButtonRenderer;
import edu.harvard.mcz.imagecapture.ui.MouseWheelScrollListener;
Expand All @@ -112,6 +39,23 @@
import edu.harvard.mcz.imagecapture.ui.tablemodel.SpecimenPartsTableModel;
import edu.harvard.mcz.imagecapture.utility.OpenStreetMapUtility;
import net.miginfocom.swing.MigLayout;
import org.hibernate.SessionException;
import org.hibernate.TransactionException;
import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
import org.jdesktop.swingx.autocomplete.ComboBoxCellEditor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.persistence.OptimisticLockException;
import javax.swing.*;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumn;
import java.awt.*;
import java.awt.event.*;
import java.net.URL;
import java.util.*;
import java.util.stream.Collectors;

/**
* JPanel for editing a record of a Specimen in a details view for that
Expand Down Expand Up @@ -3086,14 +3030,12 @@ private void autocompleteGeoDataFromGeoreference() {
if (this.getPrimaryDivisionJTextField().getSelectedItem() == null ||
this.getPrimaryDivisionJTextField().getSelectedItem().equals(
"")) {
String primaryDivision = (String)data.get("address.state");
if(primaryDivisionMapping.containsKey(primaryDivision))
{
this.getPrimaryDivisionJTextField().setSelectedItem(primaryDivisionMapping.get(primaryDivision));
}
else {
this.getPrimaryDivisionJTextField().setSelectedItem(primaryDivision);
}
String primaryDivision = (String) data.get("address.state");
if (primaryDivisionMapping.containsKey(primaryDivision)) {
this.getPrimaryDivisionJTextField().setSelectedItem(primaryDivisionMapping.get(primaryDivision));
} else {
this.getPrimaryDivisionJTextField().setSelectedItem(primaryDivision);
}
} else {
log.debug("Won't automatically set primary division as is '" +
this.getCountryJTextField().getSelectedItem() + "'.");
Expand Down

0 comments on commit f916979

Please sign in to comment.