Commit 3603a66b authored by kai's avatar kai
Browse files

Progress indicator implemented.

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="lib/GMapsFX-1.1.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>RegionChooser</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="ASCII"?>
<anttasks:AntTask xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:anttasks="http://org.eclipse.fx.ide.jdt/1.0" buildDirectory="${project}/build">
<deploy>
<application name="RegionChooser"/>
<info/>
</deploy>
<signjar/>
</anttasks:AntTask>
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.VBox?>
<?import com.lynden.gmapsfx.GoogleMapView?>
<AnchorPane id="AnchorPane" fx:controller="eu.simstadt.regionchooser.RegionChooserController" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<GoogleMapView fx:id="mapView" prefHeight="750.0" prefWidth="750.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"/>
<VBox alignment="TOP_CENTER" fillWidth="false" layoutX="26.0" layoutY="29.0" prefHeight="478.0" prefWidth="221.0" spacing="10.0" styleClass="panel-background" stylesheets="@../styles/Styles.css"
AnchorPane.bottomAnchor="50.0" AnchorPane.leftAnchor="26.0" AnchorPane.topAnchor="88.0">
</VBox>
</children>
</AnchorPane>
package eu.simstadt.regionchooser;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import com.lynden.gmapsfx.GoogleMapView;
import com.lynden.gmapsfx.MapComponentInitializedListener;
import com.lynden.gmapsfx.javascript.object.GoogleMap;
import com.lynden.gmapsfx.javascript.object.InfoWindow;
import com.lynden.gmapsfx.javascript.object.InfoWindowOptions;
import com.lynden.gmapsfx.javascript.object.LatLong;
import com.lynden.gmapsfx.javascript.object.MapOptions;
import com.lynden.gmapsfx.javascript.object.MapTypeIdEnum;
import com.lynden.gmapsfx.javascript.object.Marker;
import com.lynden.gmapsfx.javascript.object.MarkerOptions;
public class RegionChooserController implements Initializable, MapComponentInitializedListener
{
@FXML
private Button button;
@FXML
private GoogleMapView mapView;
private GoogleMap map;
@Override
public void initialize(URL url, ResourceBundle rb) {
mapView.addMapInializedListener(this);
}
@Override
public void mapInitialized() {
LatLong bochumLoc = new LatLong(51.482, 7.225);
LatLong hamburgLoc = new LatLong(53.551, 9.994);
LatLong stuttgartLoc = new LatLong(48.778, 9.176);
LatLong dresdenLoc = new LatLong(51.049, 13.741);
//Set the initial properties of the map.
MapOptions mapOptions = new MapOptions();
mapOptions.center(new LatLong(51.3, 11.0))
.mapType(MapTypeIdEnum.ROADMAP)
.overviewMapControl(false)
.panControl(false)
.rotateControl(false)
.scaleControl(false)
.streetViewControl(false)
.zoomControl(false)
.zoom(7);
map = mapView.createMap(mapOptions);
//Add markers to the map
MarkerOptions markerOptions1 = new MarkerOptions();
markerOptions1.position(bochumLoc);
MarkerOptions markerOptions2 = new MarkerOptions();
markerOptions2.position(hamburgLoc);
MarkerOptions markerOptions3 = new MarkerOptions();
markerOptions3.position(stuttgartLoc);
MarkerOptions markerOptions4 = new MarkerOptions();
markerOptions4.position(dresdenLoc);
Marker bochumMarker = new Marker(markerOptions1);
Marker hamburgMarker = new Marker(markerOptions2);
Marker stuttgartMarker = new Marker(markerOptions3);
Marker dresdenMarker = new Marker(markerOptions4);
map.addMarker(bochumMarker);
map.addMarker(hamburgMarker);
map.addMarker(stuttgartMarker);
map.addMarker(dresdenMarker);
InfoWindowOptions infoWindowOptions = new InfoWindowOptions();
infoWindowOptions.content("<h2>Bochum</h2>Tief im Westen");
InfoWindow bochumInfoWindow = new InfoWindow(infoWindowOptions);
bochumInfoWindow.open(map, bochumMarker);
}
}
\ No newline at end of file
package eu.simstadt.regionchooser;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class RegionChooserMain extends Application
{
@Override
public void start(Stage primaryStage) {
try {
AnchorPane root = (AnchorPane) FXMLLoader.load(getClass().getResource("RegionChooser.fxml"));
Scene scene = new Scene(root, 750, 750);
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
launch(args);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment