Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
ffb6bdc0
Commit
ffb6bdc0
authored
Jul 25, 2019
by
Sascha Herzinger
Browse files
formatted *.java with eclipse style guide
parent
9fbc049b
Pipeline
#12065
passed with stage
in 9 minutes and 36 seconds
Changes
1000
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Too many changes to show.
To preserve performance only
1000 of 1000+
files are displayed.
Plain diff
Email patch
CellDesigner-plugin/src/main/java/lcsb/mapviewer/cdplugin/copypaste/CopyAction.java
View file @
ffb6bdc0
package
lcsb.mapviewer.cdplugin.copypaste
;
import
org.apache.logging.log4j.*
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
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
;
/**
* 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
*
...
...
CellDesigner-plugin/src/main/java/lcsb/mapviewer/cdplugin/copypaste/CopyPasteAbstractAction.java
View file @
ffb6bdc0
...
...
@@ -3,14 +3,13 @@ package lcsb.mapviewer.cdplugin.copypaste;
import
java.util.HashSet
;
import
java.util.Set
;
import
org.apache.logging.log4j.*
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
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
lcsb.mapviewer.model.map.*
;
/**
* This abstract class defines common function for {@link CopyAction} and
...
...
@@ -20,17 +19,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
...
...
CellDesigner-plugin/src/main/java/lcsb/mapviewer/cdplugin/copypaste/CopyPastePlugin.java
View file @
ffb6bdc0
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
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
jp.sbi.celldesigner.MainWindow
;
import
jp.sbi.celldesigner.plugin.CellDesignerPlugin
;
...
...
@@ -94,6 +94,10 @@ public class CopyPastePlugin extends CellDesignerPlugin {
};
}
@Override
public
void
addPluginMenu
()
{
}
// CHECKSTYLE:OFF
@Override
public
void
SBaseAdded
(
PluginSBase
arg0
)
{
...
...
@@ -105,28 +109,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
model
Clos
ed
(
PluginSBase
arg0
)
{
public
void
model
Open
ed
(
PluginSBase
arg0
)
{
}
@Override
public
void
model
Open
ed
(
PluginSBase
arg0
)
{
public
void
model
SelectChang
ed
(
PluginSBase
arg0
)
{
}
@Override
public
void
model
SelectChang
ed
(
PluginSBase
arg0
)
{
public
void
model
Clos
ed
(
PluginSBase
arg0
)
{
}
...
...
CellDesigner-plugin/src/main/java/lcsb/mapviewer/cdplugin/copypaste/CopyPluginAction.java
View file @
ffb6bdc0
...
...
@@ -2,7 +2,8 @@ package lcsb.mapviewer.cdplugin.copypaste;
import
java.awt.event.ActionEvent
;
import
org.apache.logging.log4j.*
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
jp.sbi.celldesigner.MainWindow
;
import
jp.sbi.celldesigner.plugin.PluginAction
;
...
...
@@ -18,15 +19,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.
*/
...
...
CellDesigner-plugin/src/main/java/lcsb/mapviewer/cdplugin/copypaste/PasteAction.java
View file @
ffb6bdc0
...
...
@@ -2,13 +2,10 @@ package lcsb.mapviewer.cdplugin.copypaste;
import
java.util.Set
;
import
org.apache.logging.log4j.*
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
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
;
...
...
CellDesigner-plugin/src/main/java/lcsb/mapviewer/cdplugin/copypaste/PastePluginAction.java
View file @
ffb6bdc0
...
...
@@ -2,7 +2,8 @@ package lcsb.mapviewer.cdplugin.copypaste;
import
java.awt.event.ActionEvent
;
import
org.apache.logging.log4j.*
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
jp.sbi.celldesigner.MainWindow
;
import
jp.sbi.celldesigner.plugin.PluginAction
;
...
...
@@ -18,13 +19,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.
*/
...
...
CellDesigner-plugin/src/main/java/lcsb/mapviewer/cdplugin/info/InfoFrame.java
View file @
ffb6bdc0
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
javax.swing.*
;
import
org.apache.logging.log4j.*
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
jp.sbi.celldesigner.plugin.PluginSpeciesAlias
;
...
...
@@ -61,24 +50,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 +115,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 +150,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 +189,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 +218,7 @@ public final class InfoFrame {
/**
* Returns frame title.
*
*
* @return frame title
*/
public
JFrame
getFrame
()
{
...
...
@@ -253,7 +227,7 @@ public final class InfoFrame {
/**
* Set {@link JFrame#defaultCloseOperation}.
*
*
* @param type
* new {@link JFrame#defaultCloseOperation} value
*/
...
...
@@ -263,7 +237,7 @@ public final class InfoFrame {
/**
* Set {@link JFrame#setAlwaysOnTop(boolean)}.
*
*
* @param always
* new {@link JFrame#isAlwaysOnTop()} value
*/
...
...
@@ -275,4 +249,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
();
}
}
CellDesigner-plugin/src/main/java/lcsb/mapviewer/cdplugin/info/InfoPlugin.java
View file @
ffb6bdc0
package
lcsb.mapviewer.cdplugin.info
;
import
java.awt.KeyEventDispatcher
;
import
java.awt.KeyboardFocusManager
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.awt.event.KeyEvent
;
import
java.awt.*
;
import
java.awt.event.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.swing.
Timer
;
import
javax.swing.
*
;
import
org.apache.logging.log4j.*
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
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
jp.sbi.celldesigner.plugin.*
;
/**
* This class represent a plugin to CellDesigner that add info text box with
...
...
@@ -127,6 +122,10 @@ public class InfoPlugin extends CellDesignerPlugin {
}
}
@Override
public
void
addPluginMenu
()
{
}
// CHECKSTYLE:OFF
@Override
public
void
SBaseAdded
(
PluginSBase
arg0
)
{
...
...
@@ -138,28 +137,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
model
Clos
ed
(
PluginSBase
arg0
)
{
public
void
model
Open
ed
(
PluginSBase
arg0
)
{
}
@Override
public
void
model
Open
ed
(
PluginSBase
arg0
)
{
public
void
model
SelectChang
ed
(
PluginSBase
arg0
)
{
}
@Override
public
void
model
SelectChang
ed
(
PluginSBase
arg0
)
{
public
void
model
Clos
ed
(
PluginSBase
arg0
)
{
}
...
...
CellDesigner-plugin/src/test/java/lcsb/mapviewer/cdplugin/CdPluginFunctions.java
View file @
ffb6bdc0
...
...
@@ -6,10 +6,7 @@ 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
jp.sbi.celldesigner.plugin.*
;
import
lcsb.mapviewer.common.MinervaLoggerAppender
;
import
lcsb.mapviewer.common.UnitTestFailedWatcher
;
...
...
CellDesigner-plugin/src/test/java/lcsb/mapviewer/cdplugin/copypaste/CopyActionTest.java
View file @
ffb6bdc0
...
...
@@ -3,7 +3,8 @@ package lcsb.mapviewer.cdplugin.copypaste;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotEquals
;
import
org.apache.logging.log4j.*
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.junit.Test
;
import
org.mockito.Mockito
;
...
...
CellDesigner-plugin/src/test/java/lcsb/mapviewer/cdplugin/copypaste/CopyPastePluginTest.java
View file @
ffb6bdc0
...
...
@@ -38,7 +38,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 +60,7 @@ public class CopyPastePluginTest extends CdPluginFunctions {
PluginListOf
list
=
createPluginListWithSpecies
(
1
);
when
(
copyPastePlugin
.
getSelectedAllNode
()).
thenReturn
(
list
);
plugin
.
getPastePluginAction
().
setPlugin
(
copyPastePlugin
);
plugin
.
createKeyEventDispatcher
().
dispatchKeyEvent
(
event
);
}
...
...
CellDesigner-plugin/src/test/java/lcsb/mapviewer/cdplugin/copypaste/PasteActionTest.java
View file @
ffb6bdc0
...
...
@@ -8,10 +8,7 @@ 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
jp.sbi.celldesigner.plugin.*
;
import
lcsb.mapviewer.cdplugin.CdPluginFunctions
;
import
lcsb.mapviewer.common.SystemClipboard
;
...
...
CellDesigner-plugin/src/test/java/lcsb/mapviewer/cdplugin/info/InfoFrameTest.java
View file @
ffb6bdc0
...
...
@@ -2,11 +2,10 @@ package lcsb.mapviewer.cdplugin.info;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.*
;
import
org.apache.logging.log4j.*
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.junit.Test
;
import
jp.sbi.celldesigner.plugin.PluginSpeciesAlias
;
...
...
CellDesigner-plugin/src/test/java/lcsb/mapviewer/cdplugin/info/InfoPluginTest.java
View file @
ffb6bdc0
...
...
@@ -5,7 +5,8 @@ import static org.junit.Assert.assertEquals;
import
java.util.Arrays
;
import
java.util.List
;
import
org.apache.logging.log4j.*
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.junit.Test
;
import
jp.sbi.celldesigner.plugin.PluginSpeciesAlias
;
...
...
annotation/src/main/java/lcsb/mapviewer/annotation/SpringAnnotationConfig.java
View file @
ffb6bdc0
...
...
@@ -4,6 +4,6 @@ import org.springframework.context.annotation.ComponentScan;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@ComponentScan
(
basePackages
=
{
"lcsb.mapviewer.annotation"
})
@ComponentScan
(
basePackages
=
{
"lcsb.mapviewer.annotation"
})
public
class
SpringAnnotationConfig
{
}
annotation/src/main/java/lcsb/mapviewer/annotation/cache/ApplicationLevelCache.java
View file @
ffb6bdc0
...
...
@@ -3,7 +3,8 @@ package lcsb.mapviewer.annotation.cache;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.apache.logging.log4j.*
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.stereotype.Service
;
import
org.w3c.dom.Node
;
...
...
@@ -48,9 +49,16 @@ public final class ApplicationLevelCache implements QueryCacheInterface {
*/
private
static
ApplicationLevelCache
cache
=
null
;
/**
* Default constructor. Prevents instantiation.
*/
private
ApplicationLevelCache
()
{
}
/**
* Returns single instance of global application cache (singleton pattern).
*
*
* @return single instance of global application cache
*/
public
static
ApplicationLevelCache
getInstance
()
{
...
...
@@ -64,13 +72,6 @@ public final class ApplicationLevelCache implements QueryCacheInterface {
}
}
/**
* Default constructor. Prevents instantiation.
*/
private
ApplicationLevelCache
()
{
}
@Override
public
synchronized
Node
getXmlNodeByQuery
(
String
query
,
CacheType
type
)
{
Node
result
=
null
;
...
...
@@ -89,7 +90,7 @@ public final class ApplicationLevelCache implements QueryCacheInterface {
public
synchronized
void
setCachedQuery
(
String
query
,
CacheType
type
,
Object
object
)
{
setCachedQuery
(
query
,
type
,
object
,
0
);
}
@Override
public
synchronized
void
setCachedQuery
(
String
query
,
CacheType
type
,
Object
object
,
int
validDays
)
{
performMemoryBalance
();
...
...
@@ -105,6 +106,24 @@ public final class ApplicationLevelCache implements QueryCacheInterface {
}
}
@Override
public
synchronized
void
clearCache
()
{
logger
.
info
(
"Clearing application cache"
);
cachedQueryNodes
.
clear
();
cachedQueryString
.
clear
();
}
@Override
public
synchronized
void
removeByQuery
(
String
query
,
CacheType
type
)
{