Skip to content

Commit

Permalink
Library versions are updated to recent versions
Browse files Browse the repository at this point in the history
  • Loading branch information
solomax committed Aug 7, 2017
1 parent 569ad1a commit 8197b4b
Show file tree
Hide file tree
Showing 68 changed files with 380 additions and 359 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cache:
install: true

before_script:
- echo "MAVEN_OPTS='-Xmx2g -XX:MaxPermSize=512m'" > ~/.mavenrc
- echo "MAVEN_OPTS='-Xmx2g'" > ~/.mavenrc

script:
- "DEPLOY_OR_TEST=install"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
package org.wicketstuff.async.demo;

import java.util.concurrent.TimeUnit;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.Model;
import org.apache.wicket.util.time.Duration;
import org.wicketstuff.async.components.*;
import org.wicketstuff.async.components.IRunnableFactory;
import org.wicketstuff.async.components.InteractionState;
import org.wicketstuff.async.components.ProgressBar;
import org.wicketstuff.async.components.ProgressButton;
import org.wicketstuff.async.components.TaskState;
import org.wicketstuff.async.task.AbstractTaskContainer;
import org.wicketstuff.async.task.DefaultTaskManager;

import java.util.concurrent.TimeUnit;

public class DemoPage extends WebPage implements IRunnableFactory {
private static final long serialVersionUID = 1L;

public DemoPage() {
public DemoPage() {

// Create form
Form<?> form = new Form<Void>("form");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package org.wicketstuff.async.components;

import java.util.HashMap;
import java.util.Map;

import org.apache.wicket.Component;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.wicketstuff.async.task.AbstractTaskContainer;

import java.util.HashMap;
import java.util.Map;

/**
* This component renders a progress bar to an existent task which is controlled by a progress button.
*/
public class ProgressBar extends Panel {
private static final long serialVersionUID = 1L;

private final ProgressButton progressButton;

Expand All @@ -34,8 +34,8 @@ public ProgressBar(String id, ProgressButton progressButton) {
wrapper.add(bar);
wrapper.add(new Label("message", new TaskProgressMessageModel()));

stateCssClasses = new HashMap<StateDescription, IModel<String>>();
this.add(new AttributeAppender("class", progressButton.new StateDispatcherModel<String>(new Model<String>(), stateCssClasses), " "));
stateCssClasses = new HashMap<>();
this.add(new AttributeAppender("class", progressButton.new StateDispatcherModel<>(new Model<String>(), stateCssClasses), " "));

progressButton.addRefreshDependant(this);

Expand Down Expand Up @@ -73,7 +73,9 @@ protected double getDefaultWidth() {
return 0d;
}

private class TaskProgressMessageModel extends AbstractReadOnlyModel<String> {
private class TaskProgressMessageModel implements IModel<String> {
private static final long serialVersionUID = 1L;

@Override
public String getObject() {
Double progress = getTaskContainer().getProgress();
Expand All @@ -91,7 +93,9 @@ public String getObject() {
}
}

private class TaskProgressPercentageStyleModel extends AbstractReadOnlyModel<String> {
private class TaskProgressPercentageStyleModel implements IModel<String> {
private static final long serialVersionUID = 1L;

@Override
public String getObject() {
int percentProgress = getPercentProgress();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
package org.wicketstuff.async.components;

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Optional;

import org.apache.wicket.Component;
import org.apache.wicket.Page;
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.util.time.Duration;
import org.wicketstuff.async.task.AbstractTaskContainer;

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Optional;

/**
* A progress button which allows to control a {@link Runnable}. Each such button will refresh itself as given by
* by the {@link Duration} with which it was constructed. It represents a runnable by a {@link AbstractTaskContainer}.
* In order to create tasks, the button needs to be provided a {@link IRunnableFactory}.
*/
public class ProgressButton extends AjaxFallbackButton {

private static final long serialVersionUID = 1L;
private final Map<StateDescription, IModel<String>> stateTextModels;
private final Map<StateDescription, IModel<String>> stateCssClasses;

Expand Down Expand Up @@ -54,24 +53,24 @@ public ProgressButton(String id, IModel<String> model, Form<?> form, IModel<? ex
this.taskContainerModel = taskContainerModel;
this.runnableFactory = runnableFactory;

this.refreshDependants = new HashSet<Component>();
this.refreshDependants = new HashSet<>();

this.refreshBehavior = new RefreshBehavior(duration);
if (getTaskContainer().isRunning()) {
add(refreshBehavior);
}
this.stateTextModels = new HashMap<StateDescription, IModel<String>>();
this.setModel(new StateDispatcherModel<String>(getDefaultTextModel(model), stateTextModels));
this.stateTextModels = new HashMap<>();
this.setModel(new StateDispatcherModel<>(getDefaultTextModel(model), stateTextModels));

this.stateCssClasses = new HashMap<StateDescription, IModel<String>>();
this.add(new AttributeAppender("class", new StateDispatcherModel<String>(new Model<String>(), stateCssClasses), " "));
this.stateCssClasses = new HashMap<>();
this.add(new AttributeAppender("class", new StateDispatcherModel<>(new Model<String>(), stateCssClasses), " "));

this.setOutputMarkupId(true);
}

private IModel<String> getDefaultTextModel(IModel<String> userModel) {
private static IModel<String> getDefaultTextModel(IModel<String> userModel) {
if (userModel == null) {
return new Model<String>();
return new Model<>();
} else {
return userModel;
}
Expand Down Expand Up @@ -169,7 +168,7 @@ protected void refresh(AjaxRequestTarget target) {

private void concludeIfApplicable(Optional<AjaxRequestTarget> targetOptional) {
if (!getTaskContainer().isRunning()) {
targetOptional.ifPresent(target -> {
targetOptional.ifPresent(target -> {
refreshBehavior.stop(target);
});
if (getTaskContainer().isFailed()) {
Expand All @@ -195,6 +194,8 @@ public boolean isEnabled() {
}

private class RefreshBehavior extends AbstractAjaxTimerBehavior {
private static final long serialVersionUID = 1L;

public RefreshBehavior(Duration updateInterval) {
super(updateInterval);
}
Expand Down Expand Up @@ -299,7 +300,8 @@ public void registerCssClassModel(IModel<String> textModel, InteractionState...
}
}

class StateDispatcherModel<T> extends AbstractReadOnlyModel<T> {
class StateDispatcherModel<T> implements IModel<T> {
private static final long serialVersionUID = 1L;

private final IModel<T> defaultValue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.io.Serializable;

class StateDescription implements Serializable {

private static final long serialVersionUID = 1L;
private final TaskState taskState;
private final InteractionState interactionState;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.Arrays;
import java.util.List;

import com.google.javascript.jscomp.SourceFile;
import org.apache.wicket.javascript.IJavaScriptCompressor;
import org.apache.wicket.util.lang.Args;
import org.slf4j.Logger;
Expand All @@ -14,16 +13,16 @@
import com.google.javascript.jscomp.CompilationLevel;
import com.google.javascript.jscomp.Compiler;
import com.google.javascript.jscomp.CompilerOptions;
import com.google.javascript.jscomp.JSSourceFile;
import com.google.javascript.jscomp.Result;
import com.google.javascript.jscomp.SourceFile;

/**
* <p>
* create a javascript compressor based on google's closure compiler.
* </p>
* due to the amount of cpu used by closure compiler the generated javascript should definitely be
* cached, e.g. using resource caching in wicket 1.5.
*
*
* @author Peter Ertl
*/
public class ClosureCompilerJavaScriptCompressor implements IJavaScriptCompressor
Expand All @@ -47,6 +46,7 @@ public void setLevel(CompilationLevel level)
this.level = Args.notNull(level, "level");
}

@Override
public String compress(String uncompressed)
{
try
Expand Down Expand Up @@ -84,8 +84,8 @@ public final String compressSource(String uncompressed) throws Exception
// TODO integrate logging into slf4j

// input sources
final List<JSSourceFile> inputs = new ArrayList<JSSourceFile>();
inputs.add(JSSourceFile.fromCode("custom", uncompressed));
final List<SourceFile> inputs = new ArrayList<>();
inputs.add(SourceFile.fromCode("custom", uncompressed));

// compile input
final Result result = compiler.compile(externs, inputs, options);
Expand Down
1 change: 0 additions & 1 deletion console-parent/console-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
<!--<recompileMode>incremental</recompileMode>-->
<jvmArgs>
<jvmArg>-Xmx1024m</jvmArg>
<jvmArg>-XX:MaxPermSize=256m</jvmArg>
</jvmArgs>
<args>
<arg>-target:jvm-1.5</arg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@
<!-- HighCharts (integrated in Wicket by Wicked-Charts) -->
<dependency>
<groupId>com.googlecode.wicked-charts</groupId>
<artifactId>wicked-charts-wicket6</artifactId>
<artifactId>wicked-charts-wicket7</artifactId>
<version>${wickedCharts.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
*/
package org.wicketstuff.dashboard.widgets.charts;

import com.googlecode.wickedcharts.highcharts.options.Options;
import com.googlecode.wickedcharts.highcharts.options.SeriesType;
import com.googlecode.wickedcharts.wicket6.highcharts.Chart;
import java.util.Map;

import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.Model;
import org.wicketstuff.dashboard.AbstractWidget;
Expand All @@ -24,7 +23,9 @@
import org.wicketstuff.dashboard.widgets.charts.settings.HighChartsSettingsPanel;
import org.wicketstuff.dashboard.widgets.charts.settings.Settings;

import java.util.Map;
import com.googlecode.wickedcharts.highcharts.options.Options;
import com.googlecode.wickedcharts.highcharts.options.SeriesType;
import com.googlecode.wickedcharts.wicket7.highcharts.Chart;

/**
* @author <a href="http://www.GitHub.com/PaulBors">Paul Bors</a>
Expand Down Expand Up @@ -78,9 +79,10 @@ public boolean hasSettings() {

@Override
public Panel createSettingsPanel(String settingsPanelId) {
return new HighChartsSettingsPanel(settingsPanelId, new Model<HighChartsWidget>(this));
return new HighChartsSettingsPanel(settingsPanelId, new Model<>(this));
}

@Override
public WidgetView createView(String viewId) {
return new HighChartsWidgetView(viewId, new Model<Widget>(this));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@
*/
package org.wicketstuff.dashboard.widgets.charts.options;

import java.util.Arrays;

import com.googlecode.wickedcharts.highcharts.options.Axis;
import com.googlecode.wickedcharts.highcharts.options.ChartOptions;
import com.googlecode.wickedcharts.highcharts.options.CssStyle;
import com.googlecode.wickedcharts.highcharts.options.Labels;
import com.googlecode.wickedcharts.highcharts.options.Marker;
import com.googlecode.wickedcharts.highcharts.options.PlotOptions;
import com.googlecode.wickedcharts.highcharts.options.PlotOptionsChoice;
import com.googlecode.wickedcharts.highcharts.options.PlotOptionsState;
import com.googlecode.wickedcharts.highcharts.options.PlotOptionsStateChoice;
import com.googlecode.wickedcharts.highcharts.options.SeriesType;
import com.googlecode.wickedcharts.highcharts.options.State;
import com.googlecode.wickedcharts.highcharts.options.StatesChoice;
import com.googlecode.wickedcharts.highcharts.options.Symbol;
import com.googlecode.wickedcharts.highcharts.options.Title;
import com.googlecode.wickedcharts.highcharts.options.Tooltip;
import com.googlecode.wickedcharts.highcharts.options.series.Series;
import com.googlecode.wickedcharts.highcharts.options.series.SimpleSeries;

import java.util.Arrays;

/**
* @author <a href="http://www.GitHub.com/PaulBors">Paul Bors</a>
*/
Expand Down Expand Up @@ -63,10 +63,10 @@ public BasicAreaOptions() {

setTooltip(new Tooltip());

State hoverState = new State();
PlotOptionsState hoverState = new PlotOptionsState();
hoverState.setEnabled(Boolean.TRUE);

StatesChoice statesChoice = new StatesChoice();
PlotOptionsStateChoice statesChoice = new PlotOptionsStateChoice();
statesChoice.setHover(hoverState);

Marker marker = new Marker();
Expand Down
Loading

0 comments on commit 8197b4b

Please sign in to comment.