Browse Source

Merge remote-tracking branch 'origin/feature/10.0' into feature/10.0

persist/11.0
Bryant 5 years ago
parent
commit
00e02b15c3
  1. 18
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  2. 32
      designer-base/src/main/java/com/fr/design/gui/style/FormatePaneNumField.java
  3. 34
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneNumFiled.java

18
designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

@ -2,6 +2,7 @@ package com.fr.design.data;
import com.fr.base.StoreProcedureParameter;
import com.fr.base.TableData;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.data.TableDataSource;
import com.fr.data.TableDataSourceTailor;
import com.fr.data.core.DataCoreXmlUtils;
@ -30,6 +31,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.data.DataModel;
import com.fr.general.data.TableDataException;
import com.fr.log.FineLoggerFactory;
import com.fr.module.ModuleContext;
import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils;
import com.fr.stable.ParameterProvider;
@ -48,8 +50,8 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
* 设计器管理操作数据集的类:
@ -444,11 +446,18 @@ public abstract class DesignTableDataManager {
} catch (Exception e) {
throw new TableDataException(e.getMessage(), e);
} finally {
new Timer().schedule(new TimerTask() {
ScheduledExecutorService scheduledExecutorService = ModuleContext
.getExecutor()
.newSingleThreadScheduledExecutor(new NamedThreadFactory(""));
scheduledExecutorService.schedule(new Runnable() {
@Override
public void run() {
if (loadingBar != null) {
loadingBar.close();
}
}, 100);
}
}, 100, TimeUnit.MILLISECONDS);
scheduledExecutorService.shutdown();
}
}
@ -513,6 +522,7 @@ public abstract class DesignTableDataManager {
if (inParameters.length > 0 && !ComparatorUtils.equals(threadLocal.get(), NO_PARAMETER)) {// 检查Parameter.
final ParameterInputPane pPane = new ParameterInputPane(inParameters);
pPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
parameterMap.putAll(pPane.update());
}

32
designer-base/src/main/java/com/fr/design/gui/style/FormatePaneNumField.java

@ -1,10 +1,14 @@
package com.fr.design.gui.style;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.module.ModuleContext;
import com.fr.value.ClearableLazyValue;
import org.jetbrains.annotations.NotNull;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
* Created with IntelliJ IDEA.
@ -14,31 +18,35 @@ import java.util.TimerTask;
* To change this template use File | Settings | File Templates.
*/
public class FormatePaneNumField extends UITextField {
private Timer timer;
private ClearableLazyValue<ScheduledExecutorService> ses = new ClearableLazyValue<ScheduledExecutorService>() {
@NotNull
@Override
protected ScheduledExecutorService compute() {
return ModuleContext.getExecutor()
.newSingleThreadScheduledExecutor(new NamedThreadFactory("FormatePaneNumFieldRunChange"));
}
};
public FormatePaneNumField() {
super();
}
@Override
protected void attributeChange() {
if (!AbstractAttrNoScrollPane.isHasChangeListener()) {
return;
}
if(timer != null){
timer.cancel();
}
timer = new Timer();
timer.schedule(new TimerTask() {
ses.getValue().schedule(new Runnable() {
@Override
public void run() {
runChange();
}
},100);
}, 100, TimeUnit.MILLISECONDS);
}
protected void runChange() {
super.attributeChange();
timer.cancel();
ses.getValue().shutdown();
ses.drop();
}
}

34
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneNumFiled.java

@ -1,9 +1,13 @@
package com.fr.design.mainframe.chart.gui.style.series;
import java.util.Timer;
import java.util.TimerTask;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.module.ModuleContext;
import com.fr.value.ClearableLazyValue;
import org.jetbrains.annotations.NotNull;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
* Created with IntelliJ IDEA.
@ -13,28 +17,34 @@ import com.fr.design.gui.itextfield.UINumberField;
* To change this template use File | Settings | File Templates.
*/
public class ColorPickerPaneNumFiled extends UINumberField {
private Timer timer;
private ClearableLazyValue<ScheduledExecutorService> ses = new ClearableLazyValue<ScheduledExecutorService>() {
@NotNull
@Override
protected ScheduledExecutorService compute() {
return ModuleContext.getExecutor()
.newSingleThreadScheduledExecutor(new NamedThreadFactory("FormatePaneNumFieldRunChange"));
}
};
public ColorPickerPaneNumFiled() {
super();
}
@Override
protected void attributeChange() {
if(timer != null){
timer.cancel();
}
timer = new Timer();
timer.schedule(new TimerTask() {
ses.getValue().schedule(new Runnable() {
@Override
public void run() {
// kuns: 默认修改500, 在地图修改系列颜色text时, 快速响应.
runChange();
}
},500);// kuns: 默认修改500, 在地图修改系列颜色text时, 快速响应.
}, 500, TimeUnit.MILLISECONDS);
}
protected void runChange() {
super.attributeChange();
timer.cancel();
ses.getValue().shutdown();
ses.drop();
}

Loading…
Cancel
Save