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
9d84a793
Commit
9d84a793
authored
May 08, 2019
by
Piotr Gawron
Browse files
layer elements contain z index
parent
c8fb7f9e
Changes
7
Hide whitespace changes
Inline
Side-by-side
model/src/main/java/lcsb/mapviewer/model/map/layout/graphics/LayerRect.java
View file @
9d84a793
...
...
@@ -55,6 +55,11 @@ public class LayerRect implements Serializable {
*/
private
Double
y
=
0.0
;
/**
* Z index.
*/
private
Integer
z
;
/**
* Width of the rectangle.
*/
...
...
@@ -239,4 +244,12 @@ public class LayerRect implements Serializable {
public
void
setHeight
(
Double
height
)
{
this
.
height
=
height
;
}
public
Integer
getZ
()
{
return
z
;
}
public
void
setZ
(
Integer
z
)
{
this
.
z
=
z
;
}
}
model/src/main/java/lcsb/mapviewer/model/map/layout/graphics/LayerText.java
View file @
9d84a793
...
...
@@ -66,6 +66,11 @@ public class LayerText implements Serializable {
*/
private
Double
y
=
0.0
;
/**
* Z-index.
*/
private
Integer
z
;
/**
* Width of the rectangle where text is drawn.
*/
...
...
@@ -350,4 +355,12 @@ public class LayerText implements Serializable {
return
"["
+
this
.
getClass
().
getSimpleName
()
+
": "
+
this
.
getNotes
()
+
"]"
;
}
public
Integer
getZ
()
{
return
z
;
}
public
void
setZ
(
Integer
z
)
{
this
.
z
=
z
;
}
}
persist/src/main/resources/db/migration/13.1.0~alpha.0/V13.1.0.20190508__z_index_to_layers.sql
0 → 100644
View file @
9d84a793
-- add z-index to all layer elements
alter
table
layer_rect_table
add
column
z
integer
;
alter
table
layer_oval_table
add
column
z
integer
;
alter
table
layer_text_table
add
column
z
integer
;
with
v_layer_text_table
as
(
select
id
,
row_number
()
over
(
order
by
width
*
height
desc
,
id
)
as
rn
from
layer_text_table
)
update
layer_text_table
set
z
=
v_layer_text_table
.
rn
from
v_layer_text_table
where
layer_text_table
.
id
=
v_layer_text_table
.
id
;
with
v_layer_oval_table
as
(
select
id
,
row_number
()
over
(
order
by
width
*
height
desc
,
id
)
as
rn
from
layer_oval_table
)
update
layer_oval_table
set
z
=
v_layer_oval_table
.
rn
from
v_layer_oval_table
where
layer_oval_table
.
id
=
v_layer_oval_table
.
id
;
with
v_layer_rect_table
as
(
select
id
,
row_number
()
over
(
order
by
width
*
height
desc
,
id
)
as
rn
from
layer_rect_table
)
update
layer_rect_table
set
z
=
v_layer_rect_table
.
rn
from
v_layer_rect_table
where
layer_rect_table
.
id
=
v_layer_rect_table
.
id
;
ALTER
TABLE
layer_rect_table
ALTER
COLUMN
z
SET
NOT
NULL
;
ALTER
TABLE
layer_oval_table
ALTER
COLUMN
z
SET
NOT
NULL
;
ALTER
TABLE
layer_text_table
ALTER
COLUMN
z
SET
NOT
NULL
;
persist/src/test/java/lcsb/mapviewer/persist/PersistTestFunctions.java
View file @
9d84a793
package
lcsb.mapviewer.persist
;
import
java.awt.Color
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileInputStream
;
...
...
@@ -41,6 +42,7 @@ import org.xml.sax.SAXException;
import
lcsb.mapviewer.common.exception.InvalidXmlSchemaException
;
import
lcsb.mapviewer.model.map.compartment.Compartment
;
import
lcsb.mapviewer.model.map.layout.graphics.LayerRect
;
import
lcsb.mapviewer.model.map.reaction.type.ModulationReaction
;
import
lcsb.mapviewer.model.map.reaction.type.TransportReaction
;
import
lcsb.mapviewer.model.map.species.AntisenseRna
;
...
...
@@ -384,4 +386,12 @@ public abstract class PersistTestFunctions {
return
result
;
}
protected
LayerRect
createRect
()
{
LayerRect
lr
=
new
LayerRect
();
lr
.
setColor
(
Color
.
YELLOW
);
lr
.
setZ
(
0
);
return
lr
;
}
}
persist/src/test/java/lcsb/mapviewer/persist/dao/map/CommentDaoTest.java
View file @
9d84a793
...
...
@@ -130,8 +130,7 @@ public class CommentDaoTest extends PersistTestFunctions {
Layer
layer
=
new
Layer
();
model
.
addLayer
(
layer
);
LayerRect
lr
=
new
LayerRect
();
lr
.
setColor
(
Color
.
YELLOW
);
LayerRect
lr
=
createRect
();
layer
.
addLayerRect
(
lr
);
Reaction
reaction
=
createReaction
();
...
...
persist/src/test/java/lcsb/mapviewer/persist/dao/map/LayoutDaoTest.java
View file @
9d84a793
...
...
@@ -175,9 +175,7 @@ public class LayoutDaoTest extends PersistTestFunctions {
Layer
layer
=
new
Layer
();
model
.
addLayer
(
layer
);
LayerRect
lr
=
new
LayerRect
();
lr
.
setColor
(
Color
.
YELLOW
);
layer
.
addLayerRect
(
lr
);
layer
.
addLayerRect
(
createRect
());
Reaction
reaction
=
createReaction
();
reaction
.
addProduct
(
new
Product
(
alias
));
...
...
persist/src/test/java/lcsb/mapviewer/persist/dao/map/ModelDaoTest.java
View file @
9d84a793
...
...
@@ -431,9 +431,7 @@ public class ModelDaoTest extends PersistTestFunctions {
Layer
layer
=
new
Layer
();
model
.
addLayer
(
layer
);
LayerRect
lr
=
new
LayerRect
();
lr
.
setColor
(
Color
.
YELLOW
);
layer
.
addLayerRect
(
lr
);
layer
.
addLayerRect
(
createRect
());
Reaction
reaction
=
createReaction
();
reaction
.
addProduct
(
new
Product
(
alias
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment