我正在使用vis.js来显示时间轴.
我有以下几项:
var items = new vis.DataSet([
{id: 1, content: '1) Next To 2', start: '2014-04-20 00:00:00', end : '2014-04-20 00:59:59'},
{id: 2, content: '2) Next To 1', start: '2014-04-20 01:00:00', end : '2014-04-20 02:59:59'},
{id: 3, content: 'Underneath ', start: '2014-04-20 00:00:00', end : '2014-04-20 05:59:59'}
]);
Run Code Online (Sandbox Code Playgroud)
id 1和id 2开始/结束彼此不重叠(按时间).所以我总是希望它们在时间轴内出现在同一行,而不管缩放级别如何.
但是我无法设置stack : false,因为我想要id : 3在1和2下面.
这是一个JSFiddle:http://jsfiddle.net/uqn6q4jd/17/
1)和2)应始终在同一条线上,3)始终在下面
我还能做到这一点吗?
我已经看过Vis JS源代码,并且觉得我可以通过以下方式实现我需要的改进:
exports.stack = function...
exports.nostack = function...
Run Code Online (Sandbox Code Playgroud)
如果有一个我失踪的设置或功能,那将是我做出改变的首选路线......
我有以下课程:
public interface MyInterface{}
public class MyImpl1 implements MyInterface{}
public class MyImpl2 implements MyInterface{}
public class Runner {
@Autowired private MyInterface myInterface;
}
Run Code Online (Sandbox Code Playgroud)
我想做的是决定,虽然应用程序已经运行(即不在启动时)应该注入实现Runner.
所以理想情况是这样的:
ApplicationContext appContext = ...
Integer request = ...
Runner runner = null;
if (request == 1) {
//here the property 'myInterface' of 'Runner' would be injected with MyImpl1
runner = appContext.getBean(Runner.class)
}
else if (request == 2) {
//here the property 'myInterface' of 'Runner' would be injected with MyImpl2
runner = …Run Code Online (Sandbox Code Playgroud) 我的应用程序使用 Spring 事件
@Resource
ApplicationEventPublisher publisher;
publisher.publishEvent(myEvent);
...
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
public void handleEvent(MyEvent myEvent)
Run Code Online (Sandbox Code Playgroud)
这样的事件有很多。有没有办法处理来自这些订阅方法的潜在异常?
理想情况下,与在 Web MVC 中处理 RequestMapping 请求的异常的方式类似,即
@ExceptionHandler(Exception.class)
Run Code Online (Sandbox Code Playgroud)