Commit 19007420 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

formatted *.java with eclipse style guide

parent 9fbc049b
Pipeline #12064 passed with stage
in 10 minutes and 53 seconds
package lcsb.mapviewer.cdplugin.copypaste;
import org.apache.logging.log4j.*;
import jp.sbi.celldesigner.plugin.PluginListOf;
import jp.sbi.celldesigner.plugin.PluginReaction;
import jp.sbi.celldesigner.plugin.PluginSBase;
import jp.sbi.celldesigner.plugin.PluginSpecies;
import jp.sbi.celldesigner.plugin.PluginSpeciesAlias;
import jp.sbi.celldesigner.plugin.*;
import lcsb.mapviewer.common.SystemClipboard;
import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* CD Plugin action responsible for translating annotation stored in notes to xml
* format stored in annotations.
* CD Plugin action responsible for translating annotation stored in notes to
* xml format stored in annotations.
*
* @author Piotr Gawron
*
......
......@@ -3,14 +3,14 @@ package lcsb.mapviewer.cdplugin.copypaste;
import java.util.HashSet;
import java.util.Set;
import org.apache.logging.log4j.*;
import lcsb.mapviewer.common.Pair;
import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
import lcsb.mapviewer.converter.annotation.XmlAnnotationParser;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
import lcsb.mapviewer.model.map.MiriamType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* This abstract class defines common function for {@link CopyAction} and
......@@ -20,17 +20,16 @@ import lcsb.mapviewer.model.map.MiriamType;
*
*/
public class CopyPasteAbstractAction {
/**
* Default class logger.
*/
@SuppressWarnings("unused")
private final Logger logger = LogManager.getLogger(CopyPasteAbstractAction.class);
/**
* Prefix used for serialization/deserialization of {@link MiriamData} to string
* stored in system clipboard.
*/
private static final String PREFIX = "[MIRIAM]";
/**
* Default class logger.
*/
@SuppressWarnings("unused")
private final Logger logger = LogManager.getLogger(CopyPasteAbstractAction.class);
/**
* Serializes {@link MiriamData} into string that will be stored into system
......
package lcsb.mapviewer.cdplugin.copypaste;
import java.awt.KeyEventDispatcher;
import java.awt.KeyboardFocusManager;
import java.awt.*;
import java.awt.event.KeyEvent;
import org.apache.logging.log4j.*;
import jp.sbi.celldesigner.MainWindow;
import jp.sbi.celldesigner.plugin.CellDesignerPlugin;
import jp.sbi.celldesigner.plugin.PluginSBase;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* This class represent a plugin to cell designer with copy past functionality
......@@ -94,6 +93,10 @@ public class CopyPastePlugin extends CellDesignerPlugin {
};
}
@Override
public void addPluginMenu() {
}
// CHECKSTYLE:OFF
@Override
public void SBaseAdded(PluginSBase arg0) {
......@@ -105,28 +108,24 @@ public class CopyPastePlugin extends CellDesignerPlugin {
}
@Override
public void SBaseDeleted(PluginSBase arg0) {
}
// CHECKSTYLE:ON
@Override
public void addPluginMenu() {
public void SBaseDeleted(PluginSBase arg0) {
}
@Override
public void modelClosed(PluginSBase arg0) {
public void modelOpened(PluginSBase arg0) {
}
@Override
public void modelOpened(PluginSBase arg0) {
public void modelSelectChanged(PluginSBase arg0) {
}
@Override
public void modelSelectChanged(PluginSBase arg0) {
public void modelClosed(PluginSBase arg0) {
}
......
......@@ -2,11 +2,11 @@ package lcsb.mapviewer.cdplugin.copypaste;
import java.awt.event.ActionEvent;
import org.apache.logging.log4j.*;
import jp.sbi.celldesigner.MainWindow;
import jp.sbi.celldesigner.plugin.PluginAction;
import jp.sbi.celldesigner.plugin.PluginListOf;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* This class represent action that copy species/reaction annotations and notes
......@@ -18,15 +18,13 @@ import jp.sbi.celldesigner.plugin.PluginListOf;
public class CopyPluginAction extends PluginAction {
/**
* Default class logger.
*
*/
private Logger logger = LogManager.getLogger(PasteAction.class.getName());
private static final long serialVersionUID = 1L;
/**
*
* Default class logger.
*/
private static final long serialVersionUID = 1L;
private Logger logger = LogManager.getLogger(PasteAction.class.getName());
/**
* Plugin that access this action.
*/
......
......@@ -2,17 +2,13 @@ package lcsb.mapviewer.cdplugin.copypaste;
import java.util.Set;
import org.apache.logging.log4j.*;
import jp.sbi.celldesigner.plugin.PluginListOf;
import jp.sbi.celldesigner.plugin.PluginReaction;
import jp.sbi.celldesigner.plugin.PluginSBase;
import jp.sbi.celldesigner.plugin.PluginSpecies;
import jp.sbi.celldesigner.plugin.PluginSpeciesAlias;
import jp.sbi.celldesigner.plugin.*;
import lcsb.mapviewer.common.Pair;
import lcsb.mapviewer.common.SystemClipboard;
import lcsb.mapviewer.converter.annotation.XmlAnnotationParser;
import lcsb.mapviewer.model.map.MiriamData;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* CD Plugin action responsible for translating annotation stored in notes to
......
......@@ -2,11 +2,11 @@ package lcsb.mapviewer.cdplugin.copypaste;
import java.awt.event.ActionEvent;
import org.apache.logging.log4j.*;
import jp.sbi.celldesigner.MainWindow;
import jp.sbi.celldesigner.plugin.PluginAction;
import jp.sbi.celldesigner.plugin.PluginListOf;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* This class represent action that paste annotations and notes from clipboard
......@@ -18,13 +18,13 @@ import jp.sbi.celldesigner.plugin.PluginListOf;
public class PastePluginAction extends PluginAction {
/**
* Default class logger.
*
*/
private Logger logger = LogManager.getLogger(PasteAction.class.getName());
private static final long serialVersionUID = 1L;
/**
*
* Default class logger.
*/
private static final long serialVersionUID = 1L;
private Logger logger = LogManager.getLogger(PasteAction.class.getName());
/**
* Plugin that access this action.
*/
......
package lcsb.mapviewer.cdplugin.info;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import org.apache.logging.log4j.*;
import javax.swing.*;
import jp.sbi.celldesigner.plugin.PluginSpeciesAlias;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* This class represent a frame that visualize MIRIAM data and notes for a
......@@ -61,24 +48,20 @@ public final class InfoFrame {
* Font size of the caption label.
*/
private static final int CAPTION_FONT_SIZE = 18;
/**
* Singleton instance of this class (there can be only one instance of the
* frame).
*/
private static InfoFrame instance = null;
/**
* Default class logger.
*/
@SuppressWarnings("unused")
private final Logger logger = LogManager.getLogger(InfoFrame.class);
/**
* Instance of the JFrame representation of windows.
*/
private JFrame frame = null;
/**
* Singleton instance of this class (there can be only one instance of the
* frame).
*/
private static InfoFrame instance = null;
/**
* Font used for captions.
*/
......@@ -130,27 +113,6 @@ public final class InfoFrame {
return instance;
}
/**
* Set visible flag for {@link #frame}.
*
* @param visible
* should the frame be visible or not
*/
public void setVisible(boolean visible) {
frame.setVisible(visible);
}
/**
* This method assign a set of species to this form.
*
* @param species
* - species to be shown in the form
*/
public void setSpecies(List<PluginSpeciesAlias> species) {
this.species = species;
updateSpecies();
}
/**
* Updates information about species in the form.
*/
......@@ -186,7 +148,7 @@ public final class InfoFrame {
/**
* This method create a panel for a species with all information to be
* presented.
*
*
* @param species
* CellDesigner species alias
* @return {@link JPanel} object with information about species
......@@ -225,16 +187,26 @@ public final class InfoFrame {
/**
* Returns info if the frame is visible.
*
*
* @return info if the frame is visible
*/
public boolean isVisible() {
return frame.isVisible();
}
/**
* Set visible flag for {@link #frame}.
*
* @param visible
* should the frame be visible or not
*/
public void setVisible(boolean visible) {
frame.setVisible(visible);
}
/**
* Sets frame title.
*
*
* @param title
* title of the frame
*/
......@@ -244,7 +216,7 @@ public final class InfoFrame {
/**
* Returns frame title.
*
*
* @return frame title
*/
public JFrame getFrame() {
......@@ -253,7 +225,7 @@ public final class InfoFrame {
/**
* Set {@link JFrame#defaultCloseOperation}.
*
*
* @param type
* new {@link JFrame#defaultCloseOperation} value
*/
......@@ -263,7 +235,7 @@ public final class InfoFrame {
/**
* Set {@link JFrame#setAlwaysOnTop(boolean)}.
*
*
* @param always
* new {@link JFrame#isAlwaysOnTop()} value
*/
......@@ -275,4 +247,15 @@ public final class InfoFrame {
return species;
}
/**
* This method assign a set of species to this form.
*
* @param species
* - species to be shown in the form
*/
public void setSpecies(List<PluginSpeciesAlias> species) {
this.species = species;
updateSpecies();
}
}
package lcsb.mapviewer.cdplugin.info;
import java.awt.KeyEventDispatcher;
import java.awt.KeyboardFocusManager;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.List;
import javax.swing.Timer;
import org.apache.logging.log4j.*;
import javax.swing.*;
import jp.sbi.celldesigner.plugin.CellDesignerPlugin;
import jp.sbi.celldesigner.plugin.PluginListOf;
import jp.sbi.celldesigner.plugin.PluginSBase;
import jp.sbi.celldesigner.plugin.PluginSpeciesAlias;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* This class represent a plugin to CellDesigner that add info text box with
......@@ -127,6 +125,10 @@ public class InfoPlugin extends CellDesignerPlugin {
}
}
@Override
public void addPluginMenu() {
}
// CHECKSTYLE:OFF
@Override
public void SBaseAdded(PluginSBase arg0) {
......@@ -138,28 +140,24 @@ public class InfoPlugin extends CellDesignerPlugin {
}
@Override
public void SBaseDeleted(PluginSBase arg0) {
}
// CHECKSTYLE:ON
@Override
public void addPluginMenu() {
public void SBaseDeleted(PluginSBase arg0) {
}
@Override
public void modelClosed(PluginSBase arg0) {
public void modelOpened(PluginSBase arg0) {
}
@Override
public void modelOpened(PluginSBase arg0) {
public void modelSelectChanged(PluginSBase arg0) {
}
@Override
public void modelSelectChanged(PluginSBase arg0) {
public void modelClosed(PluginSBase arg0) {
}
......
package lcsb.mapviewer.cdplugin;
import lcsb.mapviewer.cdplugin.copypaste.AllCopyPasteTests;
import lcsb.mapviewer.cdplugin.info.AllInfoTests;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
import lcsb.mapviewer.cdplugin.copypaste.AllCopyPasteTests;
import lcsb.mapviewer.cdplugin.info.AllInfoTests;
@RunWith(Suite.class)
@SuiteClasses({ AllCopyPasteTests.class,
AllInfoTests.class })
......
......@@ -2,16 +2,17 @@ package lcsb.mapviewer.cdplugin;
import java.util.List;
import org.apache.logging.log4j.core.LogEvent;
import org.junit.*;
import org.mockito.Mockito;
import jp.sbi.celldesigner.plugin.PluginListOf;
import jp.sbi.celldesigner.plugin.PluginReaction;
import jp.sbi.celldesigner.plugin.PluginSpecies;
import jp.sbi.celldesigner.plugin.PluginSpeciesAlias;
import lcsb.mapviewer.common.MinervaLoggerAppender;
import lcsb.mapviewer.common.UnitTestFailedWatcher;
import org.apache.logging.log4j.core.LogEvent;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.mockito.Mockito;
public class CdPluginFunctions {
......
......@@ -3,13 +3,13 @@ package lcsb.mapviewer.cdplugin.copypaste;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import org.apache.logging.log4j.*;
import org.junit.Test;
import org.mockito.Mockito;
import jp.sbi.celldesigner.plugin.PluginListOf;
import lcsb.mapviewer.cdplugin.CdPluginFunctions;
import lcsb.mapviewer.common.SystemClipboard;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Test;
import org.mockito.Mockito;
public class CopyActionTest extends CdPluginFunctions {
Logger logger = LogManager.getLogger(CopyActionTest.class);
......
......@@ -4,13 +4,16 @@ import static org.junit.Assert.*;
import java.util.Set;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.*;
import lcsb.mapviewer.cdplugin.CdPluginFunctions;
import lcsb.mapviewer.common.Pair;
import lcsb.mapviewer.model.map.*;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
import lcsb.mapviewer.model.map.MiriamType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class CopyPasteAbstractActionTest extends CdPluginFunctions {
Logger logger = LogManager.getLogger(CopyPasteAbstractActionTest.class);
......
......@@ -6,12 +6,11 @@ import static org.mockito.Mockito.when;
import java.awt.event.KeyEvent;
import org.junit.Test;
import org.mockito.Mockito;
import jp.sbi.celldesigner.plugin.PluginListOf;
import lcsb.mapviewer.cdplugin.CdPluginFunctions;
import lcsb.mapviewer.common.SystemClipboard;
import org.junit.Test;
import org.mockito.Mockito;
public class CopyPastePluginTest extends CdPluginFunctions {
......@@ -38,7 +37,7 @@ public class CopyPastePluginTest extends CdPluginFunctions {
PluginListOf list = createPluginListWithSpecies(1);
when(copyPastePlugin.getSelectedAllNode()).thenReturn(list);
plugin.getCopyPluginAction().setPlugin(copyPastePlugin);
plugin.createKeyEventDispatcher().dispatchKeyEvent(event);
String newData = cp.getClipboardContents();
......@@ -60,7 +59,7 @@ public class CopyPastePluginTest extends CdPluginFunctions {
PluginListOf list = createPluginListWithSpecies(1);
when(copyPastePlugin.getSelectedAllNode()).thenReturn(list);
plugin.getPastePluginAction().setPlugin(copyPastePlugin);
plugin.createKeyEventDispatcher().dispatchKeyEvent(event);
}
......
......@@ -5,15 +5,14 @@ import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.times;
import org.junit.Test;
import org.mockito.Mockito;
import jp.sbi.celldesigner.plugin.PluginListOf;
import jp.sbi.celldesigner.plugin.PluginReaction;
import jp.sbi.celldesigner.plugin.PluginSpecies;
import jp.sbi.celldesigner.plugin.PluginSpeciesAlias;
import lcsb.mapviewer.cdplugin.CdPluginFunctions;
import lcsb.mapviewer.common.SystemClipboard;
import org.junit.Test;
import org.mockito.Mockito;
public class PasteActionTest extends CdPluginFunctions {
......
......@@ -6,11 +6,11 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;