Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
36122b2d
Commit
36122b2d
authored
Sep 14, 2021
by
Piotr Gawron
Browse files
parameter name standard enforced
parent
ec6e65ca
Changes
25
Hide whitespace changes
Inline
Side-by-side
checkstyle.xml
View file @
36122b2d
...
...
@@ -167,12 +167,12 @@
<message
key=
"name.invalidPattern"
value=
"Member name ''{0}'' must match pattern ''{1}''."
/>
</module>
<!--
<module name="ParameterName">
<module
name=
"ParameterName"
>
<property
name=
"format"
value=
"^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"
/>
<message
key=
"name.invalidPattern"
value=
"Parameter name ''{0}'' must match pattern ''{1}''."
/>
</module>
<module name="LambdaParameterName">
<!--
<module name="LambdaParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
...
...
commons/src/main/java/lcsb/mapviewer/common/Configuration.java
View file @
36122b2d
...
...
@@ -303,12 +303,12 @@ public final class Configuration {
}
/**
* @param
xFrametD
omains
* @param
d
omains
* the xFrametDomain to set
* @see #xFrametDomain
*/
public
static
void
setxFrameDomain
(
List
<
String
>
xFrametD
omains
)
{
Configuration
.
xFrametDomain
=
xFrametD
omains
;
public
static
void
setxFrameDomain
(
List
<
String
>
d
omains
)
{
Configuration
.
xFrametDomain
=
d
omains
;
}
/**
...
...
commons/src/main/java/lcsb/mapviewer/common/SystemClipboard.java
View file @
36122b2d
...
...
@@ -52,11 +52,11 @@ public class SystemClipboard implements ClipboardOwner {
* Place a String on the clipboard, and make this class the owner of the
* Clipboard's contents.
*
* @param
aS
tring
* @param
s
tring
* what we want to put into clipboard
*/
public
void
setClipboardContents
(
String
aS
tring
)
{
StringSelection
stringSelection
=
new
StringSelection
(
aS
tring
);
public
void
setClipboardContents
(
String
s
tring
)
{
StringSelection
stringSelection
=
new
StringSelection
(
s
tring
);
Clipboard
clipboard
=
Toolkit
.
getDefaultToolkit
().
getSystemClipboard
();
clipboard
.
setContents
(
stringSelection
,
this
);
}
...
...
converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParser.java
View file @
36122b2d
...
...
@@ -318,16 +318,16 @@ public class RestAnnotationParser {
*
* @param type
* - relationtype of the annotaion ids
* @param mType
* @param
miria
mType
* {@link MiriamType type} of the reference resource
* @param ids
* - list of ids
* @return set of miriam data
*/
private
Set
<
MiriamData
>
idsToData
(
MiriamRelationType
type
,
MiriamType
mType
,
ArrayList
<
String
>
ids
)
{
private
Set
<
MiriamData
>
idsToData
(
MiriamRelationType
type
,
MiriamType
miria
mType
,
ArrayList
<
String
>
ids
)
{
Set
<
MiriamData
>
result
=
new
HashSet
<
MiriamData
>();
for
(
String
id
:
ids
)
{
MiriamData
md
=
new
MiriamData
(
type
,
mType
,
id
);
MiriamData
md
=
new
MiriamData
(
type
,
miria
mType
,
id
);
result
.
add
(
md
);
}
return
result
;
...
...
model/src/main/java/lcsb/mapviewer/model/map/MiriamData.java
View file @
36122b2d
...
...
@@ -31,12 +31,12 @@ public class MiriamData implements Comparable<MiriamData>, Serializable {
*
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* Default class logger.
*/
private
static
Logger
logger
=
LogManager
.
getLogger
();
/**
* Unique database identifier.
*/
...
...
@@ -199,27 +199,17 @@ public class MiriamData implements Comparable<MiriamData>, Serializable {
}
@Override
public
boolean
equals
(
Object
aThat
)
{
// check for self-comparison
if
(
this
==
aThat
)
{
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
{
return
true
;
}
// use instanceof instead of getClass here for two reasons
// 1. if need be, it can match any supertype, and not just one class;
// 2. it renders an explict check for "that == null" redundant, since
// it does the check for null already - "null instanceof [type]" always
// returns false. (See Effective Java by Joshua Bloch.)
if
(!(
aThat
instanceof
MiriamData
))
{
if
(!(
o
instanceof
MiriamData
))
{
return
false
;
}
// Alternative to the above line :
// if ( aThat == null || aThat.getClass() != this.getClass() ) return false;
// cast to native object is now safe
MiriamData
that
=
(
MiriamData
)
aThat
;
MiriamData
that
=
(
MiriamData
)
o
;
// now a proper field-by-field evaluation can be made
return
this
.
compareTo
(
that
)
==
0
;
}
...
...
model/src/main/java/lcsb/mapviewer/model/map/OverviewModelLink.java
View file @
36122b2d
...
...
@@ -131,12 +131,12 @@ public class OverviewModelLink extends OverviewLink {
}
/**
* @param x
Coord
* @param x
* the xCoord to set
* @see #xCoord
*/
public
void
setxCoord
(
Integer
x
Coord
)
{
this
.
xCoord
=
x
Coord
;
public
void
setxCoord
(
Integer
x
)
{
this
.
xCoord
=
x
;
}
/**
...
...
@@ -163,12 +163,12 @@ public class OverviewModelLink extends OverviewLink {
}
/**
* @param y
Coord
* @param y
* the yCoord to set
* @see #yCoord
*/
public
void
setyCoord
(
Integer
y
Coord
)
{
this
.
yCoord
=
y
Coord
;
public
void
setyCoord
(
Integer
y
)
{
this
.
yCoord
=
y
;
}
/**
...
...
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/DataNode.java
View file @
36122b2d
...
...
@@ -132,17 +132,17 @@ public class DataNode extends GraphicalPathwayElement {
* @return the vAlign
* @see #verticalAlign
*/
public
String
get
v
Align
()
{
public
String
get
Vertical
Align
()
{
return
verticalAlign
;
}
/**
* @param vAlign
* @param v
ertical
Align
* the vAlign to set
* @see #verticalAlign
*/
public
void
set
v
Align
(
String
vAlign
)
{
this
.
verticalAlign
=
vAlign
;
public
void
set
Vertical
Align
(
String
v
ertical
Align
)
{
this
.
verticalAlign
=
v
ertical
Align
;
}
/**
...
...
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/Edge.java
View file @
36122b2d
...
...
@@ -454,12 +454,12 @@ public class Edge implements Serializable {
}
/**
* @param z
Order
* @param z
* the zOrder to set
* @see #zOrder
*/
public
void
setzOrder
(
Integer
z
Order
)
{
this
.
zOrder
=
z
Order
;
public
void
setzOrder
(
Integer
z
)
{
this
.
zOrder
=
z
;
}
/**
...
...
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/Label.java
View file @
36122b2d
...
...
@@ -112,17 +112,17 @@ public class Label extends GraphicalPathwayElement {
* @return the vAlign
* @see #verticalAlign
*/
public
String
get
v
Align
()
{
public
String
get
Vertical
Align
()
{
return
verticalAlign
;
}
/**
* @param vAlign
* @param v
ertical
Align
* the vAlign to set
* @see #verticalAlign
*/
public
void
set
v
Align
(
String
vAlign
)
{
this
.
verticalAlign
=
vAlign
;
public
void
set
Vertical
Align
(
String
v
ertical
Align
)
{
this
.
verticalAlign
=
v
ertical
Align
;
}
/**
...
...
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/PathwayElement.java
View file @
36122b2d
...
...
@@ -127,12 +127,12 @@ public abstract class PathwayElement implements Serializable {
}
/**
* @param z
Order
* @param z
* the zOrder to set
* @see #zOrder
*/
public
void
setzOrder
(
Integer
z
Order
)
{
this
.
zOrder
=
z
Order
;
public
void
setzOrder
(
Integer
z
)
{
this
.
zOrder
=
z
;
}
/**
...
...
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/Shape.java
View file @
36122b2d
...
...
@@ -163,17 +163,17 @@ public class Shape extends GraphicalPathwayElement {
* @return the vAlign
* @see #verticalAlign
*/
public
String
get
v
Align
()
{
public
String
get
Vertical
Align
()
{
return
verticalAlign
;
}
/**
* @param vAlign
* @param v
ertical
Align
* the vAlign to set
* @see #verticalAlign
*/
public
void
set
v
Align
(
String
vAlign
)
{
this
.
verticalAlign
=
vAlign
;
public
void
set
Vertical
Align
(
String
v
ertical
Align
)
{
this
.
verticalAlign
=
v
ertical
Align
;
}
/**
...
...
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/xml/DataNodeParser.java
View file @
36122b2d
...
...
@@ -47,12 +47,12 @@ public class DataNodeParser extends GraphicalPathwayElementParser<DataNode> {
}
@Override
public
DataNode
parse
(
Element
e
E
lement
)
throws
UnknownTypeException
{
if
(!
e
E
lement
.
getNodeName
().
equals
(
"DataNode"
))
{
public
DataNode
parse
(
Element
element
)
throws
UnknownTypeException
{
if
(!
element
.
getNodeName
().
equals
(
"DataNode"
))
{
throw
new
InvalidArgumentException
(
ShapeParser
.
class
.
getSimpleName
()
+
" can parse only DataNode xml nodes"
);
}
String
id
=
e
E
lement
.
getAttribute
(
"GraphId"
);
String
id
=
element
.
getAttribute
(
"GraphId"
);
if
(
id
==
null
||
id
.
isEmpty
())
{
id
=
"gen_dn_"
+
counter
++;
logger
.
warn
(
new
LogMarker
(
ProjectLogEntryType
.
PARSING_ISSUE
,
"DataNode"
,
null
,
getMapName
()),
...
...
@@ -60,7 +60,7 @@ public class DataNodeParser extends GraphicalPathwayElementParser<DataNode> {
}
DataNode
node
=
new
DataNode
(
id
,
getMapName
());
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
e
E
lement
))
{
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
element
))
{
switch
(
entry
.
getLeft
())
{
case
(
"GraphId"
):
break
;
...
...
@@ -79,7 +79,7 @@ public class DataNodeParser extends GraphicalPathwayElementParser<DataNode> {
}
}
NodeList
tmpList
=
e
E
lement
.
getChildNodes
();
NodeList
tmpList
=
element
.
getChildNodes
();
for
(
int
j
=
0
;
j
<
tmpList
.
getLength
();
j
++)
{
Node
tmpNode
=
tmpList
.
item
(
j
);
if
(
tmpNode
.
getNodeType
()
==
Node
.
ELEMENT_NODE
)
{
...
...
@@ -105,7 +105,7 @@ public class DataNodeParser extends GraphicalPathwayElementParser<DataNode> {
break
;
default
:
logger
.
warn
(
node
.
getLogMarker
(),
"Unknown sub-node of "
+
e
E
lement
.
getNodeName
()
+
" node: "
+
eTmp
.
getNodeName
());
"Unknown sub-node of "
+
element
.
getNodeName
()
+
" node: "
+
eTmp
.
getNodeName
());
break
;
}
}
...
...
@@ -127,19 +127,19 @@ public class DataNodeParser extends GraphicalPathwayElementParser<DataNode> {
/**
* Parse graphics xml node in the shape node.
*
* @param e
Tmp
* @param e
lement
* xml node with graphics
* @param shape
* shape where data should be added
* @throws UnknownTypeException
* thrown when node contains unknown types
*/
private
void
parseGraphics
(
Element
e
Tmp
,
DataNode
shape
)
throws
UnknownTypeException
{
private
void
parseGraphics
(
Element
e
lement
,
DataNode
shape
)
throws
UnknownTypeException
{
Double
centerX
=
null
;
Double
centerY
=
null
;
Double
width
=
null
;
Double
height
=
null
;
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
e
Tmp
))
{
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
e
lement
))
{
if
(!
parseCommonGraphicAttributes
(
shape
,
entry
))
{
switch
(
entry
.
getLeft
())
{
case
(
"CenterX"
):
...
...
@@ -178,10 +178,10 @@ public class DataNodeParser extends GraphicalPathwayElementParser<DataNode> {
shape
.
setFontWeight
(
entry
.
getRight
());
break
;
case
(
"Valign"
):
shape
.
set
v
Align
(
entry
.
getRight
());
shape
.
set
Vertical
Align
(
entry
.
getRight
());
break
;
default
:
logger
.
warn
(
"Unknown attribute of "
+
e
Tmp
.
getNodeName
()
+
" node: "
+
entry
.
getLeft
());
logger
.
warn
(
"Unknown attribute of "
+
e
lement
.
getNodeName
()
+
" node: "
+
entry
.
getLeft
());
break
;
}
}
...
...
@@ -192,14 +192,14 @@ public class DataNodeParser extends GraphicalPathwayElementParser<DataNode> {
/**
* Method that parses {@link DataNode} xml attribute.
*
* @param e
Tmp
* @param e
lement
* xml node with attribute
* @param shape
* shape where data should be added
*/
private
void
parseAttribute
(
Element
e
Tmp
,
DataNode
shape
)
{
String
key
=
e
Tmp
.
getAttribute
(
"Key"
);
String
value
=
e
Tmp
.
getAttribute
(
"Value"
);
private
void
parseAttribute
(
Element
e
lement
,
DataNode
shape
)
{
String
key
=
e
lement
.
getAttribute
(
"Key"
);
String
value
=
e
lement
.
getAttribute
(
"Value"
);
switch
(
key
)
{
case
(
"org.pathvisio.model.BackpageHead"
):
// it's deprecated in PathVisio so we can skip it
...
...
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/xml/EdgeLineParser.java
View file @
36122b2d
...
...
@@ -46,14 +46,14 @@ public class EdgeLineParser extends ElementGpmlParser<Edge> {
* @throws ConverterException
*/
@Override
public
Edge
parse
(
Element
e
E
lement
)
throws
ConverterException
{
if
(!
e
E
lement
.
getNodeName
().
equals
(
"GraphicalLine"
))
{
public
Edge
parse
(
Element
element
)
throws
ConverterException
{
if
(!
element
.
getNodeName
().
equals
(
"GraphicalLine"
))
{
throw
new
InvalidArgumentException
(
ShapeParser
.
class
.
getSimpleName
()
+
" can parse only GraphicalLine xml nodes. But "
+
e
E
lement
.
getNodeName
());
ShapeParser
.
class
.
getSimpleName
()
+
" can parse only GraphicalLine xml nodes. But "
+
element
.
getNodeName
());
}
Edge
line
=
edgeParser
.
createEmpty
();
NodeList
nodes
=
e
E
lement
.
getChildNodes
();
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
e
E
lement
))
{
NodeList
nodes
=
element
.
getChildNodes
();
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
element
))
{
switch
(
entry
.
getLeft
())
{
case
(
"GraphId"
):
line
.
setGraphId
(
entry
.
getRight
());
...
...
@@ -62,7 +62,7 @@ public class EdgeLineParser extends ElementGpmlParser<Edge> {
line
.
setGroupRef
(
entry
.
getRight
());
break
;
default
:
logger
.
warn
(
"Unknown attribute of "
+
e
E
lement
.
getNodeName
()
+
" node: "
+
entry
.
getLeft
());
logger
.
warn
(
"Unknown attribute of "
+
element
.
getNodeName
()
+
" node: "
+
entry
.
getLeft
());
}
}
...
...
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/xml/EdgeParser.java
View file @
36122b2d
...
...
@@ -87,15 +87,15 @@ public class EdgeParser extends ElementGpmlParser<Edge> {
* thrown when there is a problem with parsing edge
*/
@Override
public
Edge
parse
(
Element
e
Element
)
throws
ConverterException
{
public
Edge
parse
(
Element
parent
Element
)
throws
ConverterException
{
String
graphId
=
e
Element
.
getAttribute
(
"GraphId"
);
String
graphId
=
parent
Element
.
getAttribute
(
"GraphId"
);
if
(
graphId
==
null
||
graphId
.
equals
(
""
))
{
graphId
=
getNewId
();
}
Edge
edge
=
new
Edge
(
graphId
,
getMapName
());
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
e
Element
))
{
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
parent
Element
))
{
switch
(
entry
.
getLeft
())
{
case
(
"GraphId"
):
break
;
...
...
@@ -103,12 +103,12 @@ public class EdgeParser extends ElementGpmlParser<Edge> {
edge
.
setGroupRef
(
entry
.
getRight
());
break
;
default
:
logger
.
warn
(
"Unknown attribute of "
+
e
Element
.
getNodeName
()
+
" node: "
+
entry
.
getLeft
());
logger
.
warn
(
"Unknown attribute of "
+
parent
Element
.
getNodeName
()
+
" node: "
+
entry
.
getLeft
());
break
;
}
}
NodeList
nodes
=
e
Element
.
getChildNodes
();
NodeList
nodes
=
parent
Element
.
getChildNodes
();
boolean
graphicsParsed
=
false
;
for
(
int
i
=
0
;
i
<
nodes
.
getLength
();
i
++)
{
Node
node
=
nodes
.
item
(
i
);
...
...
@@ -581,14 +581,14 @@ public class EdgeParser extends ElementGpmlParser<Edge> {
/**
* Method that parses {@link Edge} xml attribute.
*
* @param e
Tmp
* @param e
lement
* xml node with attribute
* @param edge
* edge where data should be added
*/
private
void
parseAttribute
(
Element
e
Tmp
,
Edge
edge
)
{
String
key
=
e
Tmp
.
getAttribute
(
"Key"
);
String
value
=
e
Tmp
.
getAttribute
(
"Value"
);
private
void
parseAttribute
(
Element
e
lement
,
Edge
edge
)
{
String
key
=
e
lement
.
getAttribute
(
"Key"
);
String
value
=
e
lement
.
getAttribute
(
"Value"
);
switch
(
key
)
{
case
(
"org.pathvisio.core.ds"
):
// skip for now (no idea what does it mean)
...
...
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/xml/GpmlParser.java
View file @
36122b2d
...
...
@@ -698,11 +698,11 @@ public class GpmlParser {
return
result
;
}
private
PolylineData
parseLine
(
Node
l
Node
)
throws
UnknownTypeException
{
private
PolylineData
parseLine
(
Node
parent
Node
)
throws
UnknownTypeException
{
int
refs
=
0
;
PolylineData
line
=
new
PolylineData
();
List
<
Point2D
>
points
=
new
ArrayList
<>();
NodeList
nodes
=
l
Node
.
getChildNodes
();
NodeList
nodes
=
parent
Node
.
getChildNodes
();
for
(
int
i
=
0
;
i
<
nodes
.
getLength
();
i
++)
{
Node
node
=
nodes
.
item
(
i
);
if
(
node
.
getNodeType
()
==
Node
.
ELEMENT_NODE
)
{
...
...
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/xml/LabelParser.java
View file @
36122b2d
...
...
@@ -41,13 +41,13 @@ public class LabelParser extends GraphicalPathwayElementParser<Label> {
}
@Override
public
Label
parse
(
Element
e
E
lement
)
throws
UnknownTypeException
{
if
(!
e
E
lement
.
getNodeName
().
equals
(
"Label"
))
{
public
Label
parse
(
Element
element
)
throws
UnknownTypeException
{
if
(!
element
.
getNodeName
().
equals
(
"Label"
))
{
throw
new
InvalidArgumentException
(
ShapeParser
.
class
.
getSimpleName
()
+
" can parse only Label xml nodes"
);
}
Label
label
=
new
Label
(
e
E
lement
.
getAttribute
(
"GraphId"
),
getMapName
());
Label
label
=
new
Label
(
element
.
getAttribute
(
"GraphId"
),
getMapName
());
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
e
E
lement
))
{
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
element
))
{
switch
(
entry
.
getLeft
())
{
case
(
"GraphId"
):
break
;
...
...
@@ -70,12 +70,12 @@ public class LabelParser extends GraphicalPathwayElementParser<Label> {
label
.
setGroupRef
(
entry
.
getRight
());
break
;
default
:
logger
.
warn
(
"Unknown attribute of "
+
e
E
lement
.
getNodeName
()
+
" node: "
+
entry
.
getLeft
());
logger
.
warn
(
"Unknown attribute of "
+
element
.
getNodeName
()
+
" node: "
+
entry
.
getLeft
());
break
;
}
}
NodeList
tmpList
=
e
E
lement
.
getChildNodes
();
NodeList
tmpList
=
element
.
getChildNodes
();
for
(
int
j
=
0
;
j
<
tmpList
.
getLength
();
j
++)
{
Node
tmpNode
=
tmpList
.
item
(
j
);
if
(
tmpNode
.
getNodeType
()
==
Node
.
ELEMENT_NODE
)
{
...
...
@@ -94,7 +94,7 @@ public class LabelParser extends GraphicalPathwayElementParser<Label> {
parseAttribute
(
eTmp
,
label
);
break
;
default
:
logger
.
warn
(
"Unknown sub-node of "
+
e
E
lement
.
getNodeName
()
+
" node: "
+
eTmp
.
getNodeName
());
logger
.
warn
(
"Unknown sub-node of "
+
element
.
getNodeName
()
+
" node: "
+
eTmp
.
getNodeName
());
break
;
}
}
...
...
@@ -116,19 +116,19 @@ public class LabelParser extends GraphicalPathwayElementParser<Label> {
/**
* Parse graphics xml node in the shape node.
*
* @param e
Tmp
* @param e
lement
* xml node with graphics
* @param shape
* shape where data should be added
* @throws UnknownTypeException
* thrown when some elements contain unknown typevalues
*/
protected
void
parseGraphics
(
Element
e
Tmp
,
Label
shape
)
throws
UnknownTypeException
{
protected
void
parseGraphics
(
Element
e
lement
,
Label
shape
)
throws
UnknownTypeException
{
Double
centerX
=
null
;
Double
centerY
=
null
;
Double
width
=
null
;
Double
height
=
null
;
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
e
Tmp
))
{
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
e
lement
))
{
if
(!
parseCommonGraphicAttributes
(
shape
,
entry
))
{
switch
(
entry
.
getLeft
())
{
case
(
"CenterX"
):
...
...
@@ -159,13 +159,13 @@ public class LabelParser extends GraphicalPathwayElementParser<Label> {
shape
.
setFontWeight
(
entry
.
getRight
());
break
;
case
(
"Valign"
):
shape
.
set
v
Align
(
entry
.
getRight
());
shape
.
set
Vertical
Align
(
entry
.
getRight
());
break
;
case
(
"ShapeType"
):
shape
.
setShape
(
entry
.
getRight
());
break
;
default
:
logger
.
warn
(
"Unknown attribute of "
+
e
Tmp
.
getNodeName
()
+
" node: "
+
entry
.
getLeft
()
+
"; value: "
logger
.
warn
(
"Unknown attribute of "
+
e
lement
.
getNodeName
()
+
" node: "
+
entry
.
getLeft
()
+
"; value: "
+
entry
.
getRight
());
break
;
}
...
...
@@ -177,14 +177,14 @@ public class LabelParser extends GraphicalPathwayElementParser<Label> {
/**
* Method that parses {@link Label} xml attribute.
*
* @param e
Tmp
* @param e
lement
* xml node with attribute
* @param shape
* shape where data should be added
*/
private
void
parseAttribute
(
Element
e
Tmp
,
Label
shape
)
{
String
key
=
e
Tmp
.
getAttribute
(
"Key"
);
String
value
=
e
Tmp
.
getAttribute
(
"Value"
);
private
void
parseAttribute
(
Element
e
lement
,
Label
shape
)
{
String
key
=
e
lement
.
getAttribute
(
"Key"
);
String
value
=
e
lement
.
getAttribute
(
"Value"
);
switch
(
key
)
{
case
(
"org.pathvisio.model.GenMAPP-Xref"
):
// skip it when it's empty
...
...
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/xml/ShapeParser.java
View file @
36122b2d
...
...
@@ -39,12 +39,12 @@ public class ShapeParser extends GraphicalPathwayElementParser<Shape> {
}
@Override
public
Shape
parse
(
Element
e
E
lement
)
throws
ConverterException
{
if
(!
e
E
lement
.
getNodeName
().
equals
(
"Shape"
))
{
public
Shape
parse
(
Element
element
)
throws
ConverterException
{
if
(!
element
.
getNodeName
().
equals
(
"Shape"
))
{
throw
new
InvalidArgumentException
(
ShapeParser
.
class
.
getSimpleName
()
+
" can parse only Shape xml nodes"
);
}
Shape
shape
=
new
Shape
(
e
E
lement
.
getAttribute
(
"GraphId"
),
getMapName
());
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
e
E
lement
))
{
Shape
shape
=
new
Shape
(
element
.
getAttribute
(
"GraphId"
),
getMapName
());
for
(
Pair
<
String
,
String
>
entry
:
getAttributes
(
element
))
{
switch
(
entry
.
getLeft
())
{
case
(
"GraphId"
):
break
;
...
...
@@ -55,12 +55,12 @@ public class ShapeParser extends GraphicalPathwayElementParser<Shape> {
shape
.
setGroupRef
(
entry
.
getRight
());
break
;
default
:
logger
.
warn
(
"Unknown attribute of "
+
e
E
lement
.
getNodeName
()
+
" node: "
+
entry
.
getLeft
());
logger
.
warn
(
"Unknown attribute of "
+
element
.
getNodeName
()
+
" node: "
+
entry
.
getLeft
());
break
;
}
}
NodeList
tmpList
=
e
E
lement
.
getChildNodes
();
NodeList
tmpList
=
element
.
getChildNodes
();
for
(
int
j
=
0
;
j
<
tmpList
.
getLength
();
j
++)
{
Node
tmpNode
=
tmpList
.
item
(
j
);
if
(
tmpNode
.
getNodeType
()
==
Node
.
ELEMENT_NODE
)
{
...