fotoButton = new MTImageButton(fotoButtonImg, p);
fotoButton.setName("fotoButton");
fotoButton.setNoStroke(true);
fotoButton.setDepthBufferDisabled(true); //Draw on top of everything
// fotoButton.translate(new Vector3D(MT4jSettings.getInstance().getScreenWidth() - fotoButton.getWidthXY(TransformSpace.RELATIVE_TO_PARENT) -5, MT4jSettings.getInstance().getScreenHeight()- fotoButton.getHeightXY(TransformSpace.RELATIVE_TO_PARENT) -5, 0));
fotoButton.translate(new Vector3D(0, MT4jSettings.getInstance().getWindowHeight()- fotoButton.getHeightXY(TransformSpace.RELATIVE_TO_PARENT) , 0));
fotoButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae) {
switch (ae.getID()) {
case TapEvent.BUTTON_CLICKED:
Point[] p = getScreenPoints();
for (int i = 0; i < p.length; i++) {
Point point = p[i];
Location loc = map.pointLocation(point.x ,point.y);
getPictures(loc, getAccuracyForZoom(map), true);
}
getPictures(map.getCenter(), getAccuracyForZoom(map), false);
}
}
});
fotoButton.setTextureEnabled(true);
fotoButton.setUseDirectGL(true);
this.buttonContainer.addChild(fotoButton);
tagToPhoto = new HashMap<MTEllipse, Photo>();
/// Create map provider menu \\\
IFont font = FontManager.getInstance().createFont(p, "SansSerif.Bold", 15, MTColor.WHITE, MTColor.WHITE);
MTRoundRectangle mapMenu = new MTRoundRectangle(0,0,0, 220,335, 20,20, p);
// mapMenu.setFillColor(new MTColor(110,110,110,180));
// mapMenu.setStrokeColor(new MTColor(110,110,110,180));
mapMenu.setFillColor(new MTColor(35,35,35,180));
mapMenu.setStrokeColor(new MTColor(35,35,35,180));
mapMenu.setPositionGlobal(new Vector3D(p.width/2f, p.height/2f));
mapMenu.translateGlobal(new Vector3D(-p.width/2f - 80,0));
getCanvas().addChild(mapMenu);
float cellWidth = 155;
float cellHeight = 40;
MTColor cellFillColor = new MTColor(new MTColor(0,0,0,210));
MTColor cellPressedFillColor = new MTColor(new MTColor(20,20,20,220));
MTList list = new MTList(0,0, 152, 7* cellHeight + 7*3, p);
list.setChildClip(null); //FIXME TEST -> do no clipping for performance
list.setNoFill(true);
list.setNoStroke(true);
list.unregisterAllInputProcessors();
list.setAnchor(PositionAnchor.CENTER);
list.setPositionRelativeToParent(mapMenu.getCenterPointLocal());
mapMenu.addChild(list);
list.addListElement(this.createListCell("Microsoft Aerial", font, new Microsoft.AerialProvider(), cellWidth, cellHeight, cellFillColor, cellPressedFillColor));
list.addListElement(this.createListCell("Microsoft Road", font, new Microsoft.RoadProvider(), cellWidth, cellHeight, cellFillColor, cellPressedFillColor));
list.addListElement(this.createListCell("Microsoft Hybrid", font, new Microsoft.HybridProvider(), cellWidth, cellHeight, cellFillColor, cellPressedFillColor));
list.addListElement(this.createListCell("Open Street Maps", font, new OpenStreetMaps(), cellWidth, cellHeight, cellFillColor, cellPressedFillColor));
list.addListElement(this.createListCell("Cloudmade Tourist", font, new CloudMade.Tourist(), cellWidth, cellHeight, cellFillColor, cellPressedFillColor));
list.addListElement(this.createListCell("Blue Marble", font, new BlueMarble(), cellWidth, cellHeight, cellFillColor, cellPressedFillColor));
list.addListElement(this.createListCell("Daily Planet", font, new DailyPlanet(), cellWidth, cellHeight, cellFillColor, cellPressedFillColor));
MultiPurposeInterpolator in = new MultiPurposeInterpolator(0,170, 700, 0.1f, 0.7f, 1);
final Animation slideOut = new Animation("slide out animation", in, mapMenu);
slideOut.addAnimationListener(new IAnimationListener() {
public void processAnimationEvent(AnimationEvent ae) {
float delta = ae.getCurrentStepDelta();
((IMTComponent3D)ae.getTargetObject()).translateGlobal(new Vector3D(delta,0,0));
switch (ae.getId()) {
case AnimationEvent.ANIMATION_ENDED:
doSlideIn = true;
animationRunning = false;
break;
}
}
});
final Animation slideIn = new Animation("slide out animation", in, mapMenu);
slideIn.addAnimationListener(new IAnimationListener() {
public void processAnimationEvent(AnimationEvent ae) {
float delta = -ae.getCurrentStepDelta();
((IMTComponent3D)ae.getTargetObject()).translateGlobal(new Vector3D(delta,0,0));
switch (ae.getId()) {
case AnimationEvent.ANIMATION_ENDED:
doSlideIn = false;
animationRunning = false;
break;