Skip to content

Commit

Permalink
some code cleanup
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/svn/omero/trunk@5587 05709c45-44f0-0310-885b-81a1db45b4a6
  • Loading branch information
brain committed Oct 23, 2009
1 parent 6e57c8a commit f553a46
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
import omero.model.Reagent;
import omero.model.Rect;
import omero.model.Screen;
import omero.model.ScreenAcquisition;
import omero.model.ScreenI;
import omero.model.Shape;
import omero.model.StageLabel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public void doImport() throws Throwable
{
for (File file : fads.keySet())
{
String fileName = file.getAbsolutePath();
library.importImage(file, 0, 0, 1, file.getAbsolutePath(),
null,
false, // To archive?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
import loci.formats.IFormatReader;
import loci.formats.ImageReader;
import loci.formats.MinMaxCalculator;
import loci.formats.in.FlexReader;
import loci.formats.in.InCellReader;
import loci.formats.in.LeicaReader;
import loci.formats.in.MIASReader;
import loci.formats.meta.MetadataStore;
import omero.model.Channel;
import omero.model.Pixels;
Expand All @@ -29,6 +26,7 @@

public class OMEROWrapper extends MinMaxCalculator {

@SuppressWarnings("unused")
private final static Log log = LogFactory.getLog(OMEROWrapper.class);

private ChannelSeparator separator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ private void sendRequest(String email, String comment, String extra)

try {
HtmlMessenger messenger = new HtmlMessenger(config.getTokenUrl(), postList);
@SuppressWarnings("unused")
String serverReply = messenger.executePost();
System.err.println(serverReply);
if (serverReply != null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,51 +1,33 @@
package ome.formats.importer.gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import java.util.concurrent.ScheduledExecutorService;

import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextPane;
import javax.swing.text.Style;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyledDocument;

import ome.formats.importer.IObservable;
import ome.formats.importer.IObserver;
import ome.formats.importer.ImportConfig;
import ome.formats.importer.ImportEvent;
import ome.formats.importer.util.ErrorContainer;
import ome.formats.importer.util.FileUploader;
import ome.formats.importer.util.HtmlMessenger;

import org.apache.commons.httpclient.methods.multipart.Part;
import org.apache.commons.httpclient.methods.multipart.StringPart;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@SuppressWarnings("serial")
public class ErrorHandler extends JPanel implements IObserver, IObservable {
/** Logger for this class */
@SuppressWarnings("unused")
private static Log log = LogFactory.getLog(ErrorHandler.class);

public final MyErrorHandler delegate; // THIS SHOULD NOT BE PUBLIC
private final ScheduledExecutorService ex;
private final ErrorTable errorTable;
private final GuiCommonElements gui;
private JTextPane debugTextPane;
private StyledDocument debugDocument;
private Style debugStyle;

public ErrorHandler(ScheduledExecutorService ex, ImportConfig config) {
this.ex = ex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class ErrorTable
implements ActionListener, PropertyChangeListener, IObserver, IObservable, MouseListener
{
/** Logger for this class */
@SuppressWarnings("unused")
private static Log log = LogFactory.getLog(ErrorTable.class);

ArrayList<IObserver> observers = new ArrayList<IObserver>();
Expand Down Expand Up @@ -118,8 +119,6 @@ public ErrorTable(GuiCommonElements gui)
"To help us, you can upload them to us by selecting the \"Upload\" checkbox " +
"besides each error.";


@SuppressWarnings("unused")
JTextPane instructions =
gui.addTextPane(mainPanel, message, "1,1,4,0", debug);
instructions.setMargin(new Insets(10,10,10,10));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
import javax.swing.filechooser.FileFilter;

import layout.TableLayout;
import loci.formats.ImageReader;
import ome.formats.importer.Main;
import ome.formats.importer.ImportConfig;
import ome.formats.importer.OMEROWrapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand All @@ -40,8 +39,6 @@
import javax.swing.filechooser.FileFilter;

import layout.TableLayout;
import loci.formats.FormatException;
import loci.formats.FormatTools;
import loci.formats.IFormatReader;
import loci.formats.gui.FormatFileFilter;

Expand All @@ -54,7 +51,6 @@
import ome.formats.importer.ImportEvent;
import ome.formats.importer.ImportLibrary;
import ome.formats.importer.OMEROWrapper;
import ome.formats.importer.util.ErrorHandler;
import omero.model.Dataset;
import omero.model.IObject;
import omero.model.Screen;
Expand Down Expand Up @@ -91,8 +87,6 @@ public class FileQueueHandler
private final ScheduledExecutorService importEx;
private JProgressBar directoryProgressBar;
private JDialog progressDialog;

private Integer directoryCount;

protected boolean cancelScan = false;

Expand All @@ -112,9 +106,7 @@ public class FileQueueHandler
this.historyTable = viewer.historyTable;
this.importReader = new OMEROWrapper(config);
this.scanReader = new OMEROWrapper(config);

directoryCount = 0;


//reader.setChannelStatCalculationStatus(true);

setLayout(new BorderLayout());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;

import javax.swing.BorderFactory;
import javax.swing.Box;
Expand All @@ -38,15 +37,12 @@
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;

import ome.formats.importer.Main;
import ome.formats.importer.IObservable;
import ome.formats.importer.IObserver;
import ome.formats.importer.ImportCandidates;
import ome.formats.importer.ImportConfig;
import ome.formats.importer.ImportContainer;
import ome.formats.importer.ImportEvent;
import ome.formats.importer.util.ETable;
import omero.model.IObject;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Expand Down Expand Up @@ -495,7 +491,7 @@ public Component getTableCellRendererComponent(
if (queue.getValueAt(row, 2).equals("failed"))
{ setForeground(Color.red);}
else if (queue.getValueAt(row, 2).equals("unreadable"))
{ setForeground(queue.DARK_ORANGE);}
{ setForeground(ETable.DARK_ORANGE);}
else
{ setForeground(null);}

Expand All @@ -513,8 +509,8 @@ public class CenterTextRenderer
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {

Component comp = super.getTableCellRendererComponent(
table, value, isSelected, hasFocus, row, column);
//Component c = super.getTableCellRendererComponent(
// table, value, isSelected, hasFocus, row, column);

setFont(UIManager.getFont("TableCell.font"));
setHorizontalAlignment(DefaultTableCellRenderer.CENTER);
Expand All @@ -530,7 +526,7 @@ public Component getTableCellRendererComponent(JTable table, Object value,
if (queue.getValueAt(row, 2).equals("failed"))
{ setForeground(Color.red);}
else if (queue.getValueAt(row, 2).equals("unreadable"))
{ setForeground(queue.DARK_ORANGE);}
{ setForeground(ETable.DARK_ORANGE);}
else
{ setForeground(null);}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.AdjustmentEvent;
Expand Down Expand Up @@ -72,7 +69,6 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.PropertyConfigurator;
import org.openmicroscopy.shoola.util.ui.MacOSMenuHandler;
import org.openmicroscopy.shoola.util.ui.login.LoginCredentials;
import org.openmicroscopy.shoola.util.ui.login.ScreenLogin;
Expand Down Expand Up @@ -517,7 +513,8 @@ public void actionPerformed(ActionEvent e)
System.exit(0);
}
} else if ("options".equals(cmd)) {
OptionsDialog dialog =
@SuppressWarnings("unused")
final OptionsDialog dialog =
new OptionsDialog(gui, this, "Import", true);
}
else if ("about".equals(cmd))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import java.util.Date;

import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;

import ome.formats.importer.IObservable;
import ome.formats.importer.IObserver;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package ome.formats.importer.gui;

import java.awt.BorderLayout;
import java.util.ArrayList;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;

import ome.formats.OMEROMetadataStoreClient;
import ome.formats.importer.IObserver;

@SuppressWarnings("serial")
public class HistoryHandler
extends JPanel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

public class HistoryTaskBar extends JXPanel implements ActionListener
{
private static final long serialVersionUID = 1L;

JXTaskPaneContainer tpContainer = new JXTaskPaneContainer();

DefaultListModel today = new DefaultListModel();
Expand Down Expand Up @@ -105,6 +107,7 @@ public void actionPerformed(ActionEvent e)
}

class ImportCellRenderer extends JLabel implements ListCellRenderer {
private static final long serialVersionUID = 1L;

public ImportCellRenderer() {
setOpaque(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@ public void actionPerformed(ActionEvent e)
{
if (e.getSource() == loginBtn)
{
@SuppressWarnings("unused")
String username = uname.getText();

@SuppressWarnings("unused")
String password = new String(pswd.getPassword());
//server = srvr.getText();
//port = prt.getText();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ void loginCancelled() {
viewer.setVisible(true);
}

@SuppressWarnings("unused")
private boolean displayLoginDialog(GuiImporter viewer, boolean modal)
{
if (modal == true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ class ServerDialog
private boolean isBookmarksShowing;

/** Collection of predefined servers or <code>null</code>. */
private List existingServers;
@SuppressWarnings("unchecked")
private List existingServers;

/** Available server. */
private JList servers;
Expand Down Expand Up @@ -241,7 +242,8 @@ private void setProperties()
}

/** Adds the list of existing servers to the {@link #bookmarks}. */
private void populateBookmarks()
@SuppressWarnings("unchecked")
private void populateBookmarks()
{
//bookmarks.removeAll();
final Object[][] objects = new Object[existingServers.size()][2];
Expand All @@ -266,7 +268,8 @@ private void populateBookmarks()
*
* @return See above.
*/
private String[] listToArray()
@SuppressWarnings("unchecked")
private String[] listToArray()
{
if (existingServers != null && existingServers.size() != 0) {
String[] array = new String[existingServers.size()];
Expand Down Expand Up @@ -450,7 +453,8 @@ private void buildGUI()
*
* @param servers Collection of predefined servers or <code>null</code>.
*/
ServerDialog(List servers)
@SuppressWarnings("unchecked")
ServerDialog(List servers)
{
super();
existingServers = servers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;

import loci.formats.FormatException;
import loci.formats.in.FlexReader;
import ome.formats.importer.Version;
import omero.util.TempFileManager;
Expand Down Expand Up @@ -54,7 +53,6 @@ public class IniFileLoader {

// Dynamic user settings
private String userSettingsDirectory;
private String userSettingsFile;
private Preferences userPrefs;

// Static config settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import java.io.File;

import ome.formats.importer.ImportConfig;
import ome.formats.importer.gui.LogAppender;

import org.apache.log4j.Appender;
Expand Down

0 comments on commit f553a46

Please sign in to comment.