added attributes to UI
This commit is contained in:
@@ -189,18 +189,6 @@ public class GeocachingIcons {
|
||||
// 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) {
|
||||
GlyphIcons iconName = attributeMap.get(attribute);
|
||||
if (iconName == null) {
|
||||
|
||||
@@ -30,11 +30,15 @@ import com.lynden.gmapsfx.MapComponentInitializedListener;
|
||||
import com.lynden.gmapsfx.javascript.object.*;
|
||||
import de.geofroggerfx.application.SessionContext;
|
||||
import de.geofroggerfx.application.SessionContextListener;
|
||||
import de.geofroggerfx.model.Attribute;
|
||||
import de.geofroggerfx.model.Cache;
|
||||
import de.geofroggerfx.ui.FXMLController;
|
||||
import de.geofroggerfx.ui.GeocachingIcons;
|
||||
import de.geofroggerfx.ui.glyphs.GeofroggerGlyphsDude;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TitledPane;
|
||||
import javafx.scene.layout.FlowPane;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Text;
|
||||
import javafx.scene.web.WebEngine;
|
||||
@@ -47,7 +51,9 @@ import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
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.jensd.fx.glyphs.GlyphsDude.createIcon;
|
||||
|
||||
/**
|
||||
* Created by Andreas on 09.03.2015.
|
||||
@@ -76,6 +82,9 @@ public class DetailsController extends FXMLController {
|
||||
@FXML
|
||||
private GoogleMapView mapView;
|
||||
|
||||
@FXML
|
||||
private FlowPane attributeList;
|
||||
|
||||
private GoogleMap map;
|
||||
private Marker marker;
|
||||
|
||||
@@ -142,6 +151,11 @@ public class DetailsController extends FXMLController {
|
||||
final WebEngine webEngine = this.description.getEngine();
|
||||
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());
|
||||
MarkerOptions options = new MarkerOptions();
|
||||
options.position(latLong);
|
||||
|
||||
@@ -5,4 +5,4 @@ CREATE TABLE attribute (
|
||||
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>
|
||||
<TitledPane animated="false" collapsible="false" text="Attributes">
|
||||
<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>
|
||||
<FontAwesomeIcon glyphName="CAR" size="1.6em"/>
|
||||
<FontAwesomeIcon glyphName="CHILD" size="1.6em"/>
|
||||
<FontAwesomeIcon glyphName="WHEELCHAIR" size="1.6em"/>
|
||||
</children>
|
||||
<opaqueInsets>
|
||||
<Insets/>
|
||||
|
||||
Reference in New Issue
Block a user