Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
e732a5e9
Commit
e732a5e9
authored
Jul 03, 2016
by
Clemens Krug
Browse files
Add map visualisation for local analysing
+ Maps are now displayed when using local analysing
parent
d29c85b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/mapvisualization/IMapVisualization.java
View file @
e732a5e9
...
...
@@ -21,8 +21,14 @@
package
de.tud.kom.p2psim.impl.topology.movement.modularosm.mapvisualization
;
import
java.awt.Graphics
;
import
java.awt.image.BufferedImage
;
public
interface
IMapVisualization
{
public
void
paint
(
Graphics
g
);
default
BufferedImage
getMapImage
()
{
return
null
;
}
}
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/mapvisualization/ShowMapQuestMapViz.java
View file @
e732a5e9
...
...
@@ -48,8 +48,16 @@ public class ShowMapQuestMapViz extends JComponent
private
String
mapQuestKey
;
private
BufferedImage
storedImage
;
private
boolean
initialized
=
false
;
private
int
subImageX
;
private
int
subImageY
;
private
int
subImageWidth
;
private
int
subImageHeight
;
private
boolean
drawSubImage
=
false
;
public
ShowMapQuestMapViz
()
{
setBounds
(
0
,
0
,
VisualizationInjector
.
getWorldX
(),
VisualizationInjector
.
getWorldY
());
...
...
@@ -149,7 +157,23 @@ public class ShowMapQuestMapViz extends JComponent
RenderingHints
.
VALUE_ANTIALIAS_ON
);
g
.
drawImage
(
originalImage
,
0
,
0
,
width
,
height
,
this
);
g
.
dispose
();
storedImage
=
resizedImage
;
return
resizedImage
;
}
@Override
public
BufferedImage
getMapImage
()
{
if
(
storedImage
==
null
)
{
initializeImage
();
resize
(
Toolkit
.
getDefaultToolkit
().
getImage
(
tempImageFilePath
),
VisualizationInjector
.
getWorldX
(),
VisualizationInjector
.
getWorldY
());
}
return
storedImage
;
}
}
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