Browse Source

Merge pull request #165 in BA/design from ~RICHIE/design:dev to dev

* commit '95ec32998b13ac866d64ef3524fc0b96ba18932d':
  简化插件接口添加
master
superman 8 years ago
parent
commit
ab44193652
  1. 4
      designer/src/com/fr/design/module/DesignerModule.java
  2. 4
      designer_base/src/com/fr/design/gui/style/AlignmentPane.java
  3. 5
      designer_base/src/com/fr/design/style/AlignmentPane.java
  4. 27
      designer_form/src/com/fr/design/mainframe/FormDesigner.java

4
designer/src/com/fr/design/module/DesignerModule.java

@ -54,7 +54,9 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.fun.LogProvider;
import com.fr.stable.module.Module;
import com.fr.stable.plugin.PluginSimplify;
import com.fr.stable.script.CalculatorProviderContext;
import com.fr.stable.script.ValueConverter;
import com.fr.stable.xml.ObjectTokenizer;
@ -94,7 +96,7 @@ public class DesignerModule extends DesignModule {
InformationCollector.getInstance().collectStartTime();
ExtraDesignClassManager.getInstance().getFeedback().didFeedback();
ExtraClassManager.getInstance().addLogProvider(DesignerLogImpl.getInstance());
ExtraClassManager.getInstance().addMutable(LogProvider.MARK_STRING, DesignerLogImpl.getInstance(), PluginSimplify.NULL);
}
private void registerOtherPane() {

4
designer_base/src/com/fr/design/gui/style/AlignmentPane.java

@ -134,7 +134,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
private void initTextRotationCombox(){
ArrayList<String> selectOption = new ArrayList<String>();
selectOption.add(Inter.getLocText("FR-Designer_Custom-Angle"));
VerticalTextProcessor processor = ExtraClassManager.getInstance().getVerticalTextProcessor();
VerticalTextProcessor processor = ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG);
if (processor != null){
selectOption.addAll(Arrays.asList(processor.getComboxOption()));
}
@ -241,7 +241,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
} else {
this.textComboBox.setSelectedIndex(0);
}
if (style.getVerticalText() == Style.VERTICALTEXT && ExtraClassManager.getInstance().getVerticalTextProcessor() != null) {
if (style.getVerticalText() == Style.VERTICALTEXT && ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG) != null) {
textRotationComboBox.setSelectedIndex(style.getTextDirection() == Style.LEFT_TO_RIGHT ? 1 : 2);
} else {
textRotationComboBox.setSelectedIndex(0);

5
designer_base/src/com/fr/design/style/AlignmentPane.java

@ -17,6 +17,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager;
import com.fr.report.fun.VerticalTextProcessor;
import com.fr.stable.CoreConstants;
import javax.swing.*;
@ -125,7 +126,7 @@ public class AlignmentPane extends BasicPane {
directionBG.add(rightToLeftRB);
rightToLeftRB.setSelected(true);
if (ExtraClassManager.getInstance().getVerticalTextProcessor() == null){
if (ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG) == null){
return;
}
isVerticalTextPanel.add(isVerticalTextCheckBox);
@ -301,7 +302,7 @@ public class AlignmentPane extends BasicPane {
}
private void populateVertical(Style style){
if (ExtraClassManager.getInstance().getVerticalTextProcessor() == null){
if (ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG) == null){
return;
}
this.isVerticalTextCheckBox.setSelected(true);

27
designer_form/src/com/fr/design/mainframe/FormDesigner.java

@ -740,9 +740,6 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
public void refreshRoot() {
// 撤销恢复操作都会refreshRoot,这时候的target.getContainer里的widget会和之前不一样,所以不用root判断来取
XLayoutContainer formLayoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget().getContainer());
if(ExtraClassManager.getInstance().getDebugLogProviders().length != 0){
formDesignerDebug();
}
// 布局默认都是1,底层的border改为0,不然没意义
this.getTarget().getContainer().setMargin(new PaddingMargin(0,0,0,0));
formLayoutContainer.setBorder(null);
@ -799,9 +796,6 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
// 再次打开时,layout下root,有内边距的话组件加上
LayoutUtils.layoutContainer(centerContainer);
formLayoutContainer.add(rootComponent, WBorderLayout.CENTER);
if(ExtraClassManager.getInstance().getDebugLogProviders().length != 0){
formDesignerDebug();
}
}
@ -1069,30 +1063,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
*/
public void refreshDesignerUI() {
LayoutUtils.layoutRootContainer(getRootComponent());
if(ExtraClassManager.getInstance().getDebugLogProviders().length != 0){
formDesignerDebug();
}
repaint();
}
private void formDesignerDebug() {
if(this.getTarget().getContainer() instanceof WBorderLayout){
Widget widget= ((WBorderLayout) this.getTarget().getContainer()).getLayoutWidget(WBorderLayout.CENTER);
if(widget != null){
ExtraClassManager.getInstance().sendDebugLog(widget.getClass().getName()+"@"+Integer.toHexString(widget.hashCode()));
}
else {
ExtraClassManager.getInstance().sendDebugLog("Target.center is null");
}
}
if(this.getRootComponent() != null && this.getRootComponent().toData() != null){
ExtraClassManager.getInstance().sendDebugLog(this.getRootComponent().toData().getClass().getName()+"@"+Integer.toHexString(this.getRootComponent().toData().getClass().hashCode()));
}
else {
ExtraClassManager.getInstance().sendDebugLog("RootComponent or rootComponent.data is null");
}
}
/**
* 返回复制粘贴删除等动作
* @return 同上

Loading…
Cancel
Save