Loading cesiumjs4gwt-showcase/pom.xml +0 −11 Original line number Diff line number Diff line Loading @@ -19,17 +19,6 @@ <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> <includes> <include>**/version.txt</include> </includes> </resource> <resource> <directory>src/main/resources</directory> <filtering>false</filtering> <excludes> <exclude>**/version.txt</exclude> </excludes> </resource> </resources> Loading cesiumjs4gwt-showcase/src/main/java/org/cleanlogic/cesiumjs4gwt/showcase/ExamplePanel.java +15 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.event.dom.client.*; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.*; import org.cesiumjs.cs.Cesium; import org.cleanlogic.cesiumjs4gwt.showcase.i18n.I18NMessages; /** Loading Loading @@ -64,9 +65,21 @@ public class ExamplePanel extends Composite { sp.setWidget(vp); final Label lblName = new Label(example.getName()); HorizontalPanel hp = new HorizontalPanel(); hp.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE); hp.setSpacing(2); if (example.getExample().isNew()) { Image img = new Image(Resources.INSTANCE.icon_new()); img.setSize("24px", "24px"); hp.add(img); } hp.add(lblName); final Image lblImage = new Image(GWT.getModuleBaseURL() + "examples/" + example.getName() + ".jpg"); lblImage.setSize("225px", "150px"); final Label lblDescription = new Label(example.getDescription()); final StringBuffer sb = new StringBuffer(); final StringBuilder sb = new StringBuilder(); final String[] tags = example.getTags(); for (String tag : tags) { sb.append(tag).append(", "); Loading @@ -75,7 +88,7 @@ public class ExamplePanel extends Composite { lblTags.setStyleName("exampletags"); lblName.setStyleName("examplename"); vp.add(lblName); vp.add(hp); vp.add(lblImage); vp.add(lblDescription); vp.add(lblTags); Loading cesiumjs4gwt-showcase/src/main/java/org/cleanlogic/cesiumjs4gwt/showcase/Resources.java +3 −0 Original line number Diff line number Diff line Loading @@ -46,4 +46,7 @@ public interface Resources extends ClientBundle { */ @Source("resources/icon-info.png") ImageResource icon_info(); @Source("resources/icon-new.png") ImageResource icon_new(); } cesiumjs4gwt-showcase/src/main/java/org/cleanlogic/cesiumjs4gwt/showcase/basic/AbstractExample.java +22 −3 Original line number Diff line number Diff line Loading @@ -20,9 +20,12 @@ import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.VerticalPanel; import org.cesiumjs.cs.Cesium; import org.cleanlogic.cesiumjs4gwt.showcase.ExampleBean; import org.cleanlogic.cesiumjs4gwt.showcase.Resources; import org.cleanlogic.cesiumjs4gwt.showcase.components.store.ExampleStore; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; Loading @@ -38,16 +41,23 @@ public abstract class AbstractExample extends Composite { protected VerticalPanel contentPanel = new VerticalPanel(); protected HorizontalPanel horizontalPanel = new HorizontalPanel(); protected ExampleBean example; protected final String version; public AbstractExample(String name, String description, String[] tags, ExampleStore store) { this(name, description, tags); this(name, description, tags, ""); store.addExample(example); } public AbstractExample(String name, String description, String[] tags, ExampleStore store, String version) { this(name, description, tags, version); store.addExample(example); } /** * The constructor. */ public AbstractExample(String name, String description, String[] tags) { public AbstractExample(String name, String description, String[] tags, String version) { this.version = version; for (String sourceCodeUrl : getSourceCodeURLs()) { ShowSourceButton butShowSource = new ShowSourceButton(""); butShowSource.setSourceCodeURL(sourceCodeUrl); Loading @@ -73,13 +83,22 @@ public abstract class AbstractExample extends Composite { for (ShowSourceButton butShowSource : showSourceButtons) { horizontalPanel.add(butShowSource); } contentPanel.setSpacing(5); contentPanel.getElement().getStyle().setPadding(10, Unit.PX); contentPanel.setWidth("100%"); contentPanel.add(new HTML("<H1>" + title + "</H1>")); contentPanel.add(new HTML("<H1>" + title + (isNew() ? " New" : "") + "</H1>")); contentPanel.add(horizontalPanel); } public boolean isNew() { return Cesium.version().equals(this.version); } public String getVersion() { return this.version; } /** * @return the example */ Loading cesiumjs4gwt-showcase/src/main/java/org/cleanlogic/cesiumjs4gwt/showcase/components/ShowcaseExamplePanel.java +4 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,10 @@ import org.cleanlogic.cesiumjs4gwt.showcase.components.store.ShowcaseExampleStor import org.cleanlogic.cesiumjs4gwt.showcase.puregwt.ShowcaseEventBus; import org.cleanlogic.cesiumjs4gwt.showcase.puregwt.event.ExampleNumberEvent; import java.util.ArrayList; import java.util.Comparator; import java.util.List; /** * * @author Giuseppe La Scaleia - CNR IMAA geoSDI Group Loading Loading
cesiumjs4gwt-showcase/pom.xml +0 −11 Original line number Diff line number Diff line Loading @@ -19,17 +19,6 @@ <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> <includes> <include>**/version.txt</include> </includes> </resource> <resource> <directory>src/main/resources</directory> <filtering>false</filtering> <excludes> <exclude>**/version.txt</exclude> </excludes> </resource> </resources> Loading
cesiumjs4gwt-showcase/src/main/java/org/cleanlogic/cesiumjs4gwt/showcase/ExamplePanel.java +15 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.event.dom.client.*; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.*; import org.cesiumjs.cs.Cesium; import org.cleanlogic.cesiumjs4gwt.showcase.i18n.I18NMessages; /** Loading Loading @@ -64,9 +65,21 @@ public class ExamplePanel extends Composite { sp.setWidget(vp); final Label lblName = new Label(example.getName()); HorizontalPanel hp = new HorizontalPanel(); hp.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE); hp.setSpacing(2); if (example.getExample().isNew()) { Image img = new Image(Resources.INSTANCE.icon_new()); img.setSize("24px", "24px"); hp.add(img); } hp.add(lblName); final Image lblImage = new Image(GWT.getModuleBaseURL() + "examples/" + example.getName() + ".jpg"); lblImage.setSize("225px", "150px"); final Label lblDescription = new Label(example.getDescription()); final StringBuffer sb = new StringBuffer(); final StringBuilder sb = new StringBuilder(); final String[] tags = example.getTags(); for (String tag : tags) { sb.append(tag).append(", "); Loading @@ -75,7 +88,7 @@ public class ExamplePanel extends Composite { lblTags.setStyleName("exampletags"); lblName.setStyleName("examplename"); vp.add(lblName); vp.add(hp); vp.add(lblImage); vp.add(lblDescription); vp.add(lblTags); Loading
cesiumjs4gwt-showcase/src/main/java/org/cleanlogic/cesiumjs4gwt/showcase/Resources.java +3 −0 Original line number Diff line number Diff line Loading @@ -46,4 +46,7 @@ public interface Resources extends ClientBundle { */ @Source("resources/icon-info.png") ImageResource icon_info(); @Source("resources/icon-new.png") ImageResource icon_new(); }
cesiumjs4gwt-showcase/src/main/java/org/cleanlogic/cesiumjs4gwt/showcase/basic/AbstractExample.java +22 −3 Original line number Diff line number Diff line Loading @@ -20,9 +20,12 @@ import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.VerticalPanel; import org.cesiumjs.cs.Cesium; import org.cleanlogic.cesiumjs4gwt.showcase.ExampleBean; import org.cleanlogic.cesiumjs4gwt.showcase.Resources; import org.cleanlogic.cesiumjs4gwt.showcase.components.store.ExampleStore; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; Loading @@ -38,16 +41,23 @@ public abstract class AbstractExample extends Composite { protected VerticalPanel contentPanel = new VerticalPanel(); protected HorizontalPanel horizontalPanel = new HorizontalPanel(); protected ExampleBean example; protected final String version; public AbstractExample(String name, String description, String[] tags, ExampleStore store) { this(name, description, tags); this(name, description, tags, ""); store.addExample(example); } public AbstractExample(String name, String description, String[] tags, ExampleStore store, String version) { this(name, description, tags, version); store.addExample(example); } /** * The constructor. */ public AbstractExample(String name, String description, String[] tags) { public AbstractExample(String name, String description, String[] tags, String version) { this.version = version; for (String sourceCodeUrl : getSourceCodeURLs()) { ShowSourceButton butShowSource = new ShowSourceButton(""); butShowSource.setSourceCodeURL(sourceCodeUrl); Loading @@ -73,13 +83,22 @@ public abstract class AbstractExample extends Composite { for (ShowSourceButton butShowSource : showSourceButtons) { horizontalPanel.add(butShowSource); } contentPanel.setSpacing(5); contentPanel.getElement().getStyle().setPadding(10, Unit.PX); contentPanel.setWidth("100%"); contentPanel.add(new HTML("<H1>" + title + "</H1>")); contentPanel.add(new HTML("<H1>" + title + (isNew() ? " New" : "") + "</H1>")); contentPanel.add(horizontalPanel); } public boolean isNew() { return Cesium.version().equals(this.version); } public String getVersion() { return this.version; } /** * @return the example */ Loading
cesiumjs4gwt-showcase/src/main/java/org/cleanlogic/cesiumjs4gwt/showcase/components/ShowcaseExamplePanel.java +4 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,10 @@ import org.cleanlogic.cesiumjs4gwt.showcase.components.store.ShowcaseExampleStor import org.cleanlogic.cesiumjs4gwt.showcase.puregwt.ShowcaseEventBus; import org.cleanlogic.cesiumjs4gwt.showcase.puregwt.event.ExampleNumberEvent; import java.util.ArrayList; import java.util.Comparator; import java.util.List; /** * * @author Giuseppe La Scaleia - CNR IMAA geoSDI Group Loading