added attributes to UI
This commit is contained in:
@@ -189,18 +189,6 @@ public class GeocachingIcons {
|
|||||||
// attributeMap.put(GEOTOUR_FALSE(-67);
|
// attributeMap.put(GEOTOUR_FALSE(-67);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Text getIconAsText(Attribute attribute, String iconSize) {
|
|
||||||
return createIcon(getIcon(attribute), iconSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Text getIconAsText(Attribute attribute) {
|
|
||||||
return getIconAsText(attribute, GlyphIcon.DEFAULT_ICON_SIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getIconAsString(Attribute attribute) {
|
|
||||||
return getIcon(attribute).characterToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static GlyphIcons getIcon(Attribute attribute) {
|
public static GlyphIcons getIcon(Attribute attribute) {
|
||||||
GlyphIcons iconName = attributeMap.get(attribute);
|
GlyphIcons iconName = attributeMap.get(attribute);
|
||||||
if (iconName == null) {
|
if (iconName == null) {
|
||||||
|
|||||||
@@ -30,11 +30,15 @@ import com.lynden.gmapsfx.MapComponentInitializedListener;
|
|||||||
import com.lynden.gmapsfx.javascript.object.*;
|
import com.lynden.gmapsfx.javascript.object.*;
|
||||||
import de.geofroggerfx.application.SessionContext;
|
import de.geofroggerfx.application.SessionContext;
|
||||||
import de.geofroggerfx.application.SessionContextListener;
|
import de.geofroggerfx.application.SessionContextListener;
|
||||||
|
import de.geofroggerfx.model.Attribute;
|
||||||
import de.geofroggerfx.model.Cache;
|
import de.geofroggerfx.model.Cache;
|
||||||
import de.geofroggerfx.ui.FXMLController;
|
import de.geofroggerfx.ui.FXMLController;
|
||||||
|
import de.geofroggerfx.ui.GeocachingIcons;
|
||||||
|
import de.geofroggerfx.ui.glyphs.GeofroggerGlyphsDude;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.TitledPane;
|
import javafx.scene.control.TitledPane;
|
||||||
|
import javafx.scene.layout.FlowPane;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
import javafx.scene.text.Text;
|
import javafx.scene.text.Text;
|
||||||
import javafx.scene.web.WebEngine;
|
import javafx.scene.web.WebEngine;
|
||||||
@@ -47,7 +51,9 @@ import java.net.URL;
|
|||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
import static de.geofroggerfx.application.SessionContext.CURRENT_CACHE;
|
import static de.geofroggerfx.application.SessionContext.CURRENT_CACHE;
|
||||||
|
import static de.geofroggerfx.ui.GeocachingIcons.getIcon;
|
||||||
import static de.geofroggerfx.ui.GeocachingIcons.getStarsAsString;
|
import static de.geofroggerfx.ui.GeocachingIcons.getStarsAsString;
|
||||||
|
import static de.jensd.fx.glyphs.GlyphsDude.createIcon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Andreas on 09.03.2015.
|
* Created by Andreas on 09.03.2015.
|
||||||
@@ -76,6 +82,9 @@ public class DetailsController extends FXMLController {
|
|||||||
@FXML
|
@FXML
|
||||||
private GoogleMapView mapView;
|
private GoogleMapView mapView;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private FlowPane attributeList;
|
||||||
|
|
||||||
private GoogleMap map;
|
private GoogleMap map;
|
||||||
private Marker marker;
|
private Marker marker;
|
||||||
|
|
||||||
@@ -142,6 +151,11 @@ public class DetailsController extends FXMLController {
|
|||||||
final WebEngine webEngine = this.description.getEngine();
|
final WebEngine webEngine = this.description.getEngine();
|
||||||
webEngine.loadContent(description);
|
webEngine.loadContent(description);
|
||||||
|
|
||||||
|
attributeList.getChildren().clear();
|
||||||
|
for (Attribute attribute: cache.getAttributes()) {
|
||||||
|
attributeList.getChildren().add(createIcon(getIcon(attribute), "1.6em"));
|
||||||
|
}
|
||||||
|
|
||||||
LatLong latLong = new LatLong(cache.getMainWayPoint().getLatitude(), cache.getMainWayPoint().getLongitude());
|
LatLong latLong = new LatLong(cache.getMainWayPoint().getLatitude(), cache.getMainWayPoint().getLongitude());
|
||||||
MarkerOptions options = new MarkerOptions();
|
MarkerOptions options = new MarkerOptions();
|
||||||
options.position(latLong);
|
options.position(latLong);
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ CREATE TABLE attribute (
|
|||||||
FOREIGN KEY(cache_id) REFERENCES cache(id) ON DELETE CASCADE
|
FOREIGN KEY(cache_id) REFERENCES cache(id) ON DELETE CASCADE
|
||||||
);
|
);
|
||||||
|
|
||||||
INSERT INTO version(version) values(2);
|
UPDATE version SET version=2;
|
||||||
@@ -27,11 +27,8 @@
|
|||||||
<children>
|
<children>
|
||||||
<TitledPane animated="false" collapsible="false" text="Attributes">
|
<TitledPane animated="false" collapsible="false" text="Attributes">
|
||||||
<content>
|
<content>
|
||||||
<FlowPane hgap="4.0" prefWidth="200.0" vgap="4.0">
|
<FlowPane fx:id="attributeList" hgap="4.0" prefWidth="200.0" vgap="4.0">
|
||||||
<children>
|
<children>
|
||||||
<FontAwesomeIcon glyphName="CAR" size="1.6em"/>
|
|
||||||
<FontAwesomeIcon glyphName="CHILD" size="1.6em"/>
|
|
||||||
<FontAwesomeIcon glyphName="WHEELCHAIR" size="1.6em"/>
|
|
||||||
</children>
|
</children>
|
||||||
<opaqueInsets>
|
<opaqueInsets>
|
||||||
<Insets/>
|
<Insets/>
|
||||||
|
|||||||
Reference in New Issue
Block a user