Browse Source

REPORT-2897 9.0设计器修改

缩放条在不同的sheet切换不应该继承
PMD
master
MoMeak 7 years ago
parent
commit
b68082f4e4
  1. 5
      designer/src/com/fr/design/mainframe/JWorkBook.java
  2. 5
      designer/src/com/fr/design/mainframe/ReportComponent.java
  3. 8
      designer/src/com/fr/design/mainframe/ReportComponentComposite.java
  4. 11
      designer/src/com/fr/design/mainframe/WorkSheetDesigner.java
  5. 8
      designer/src/com/fr/poly/PolyDesigner.java
  6. 13
      designer_base/src/com/fr/design/gui/icombobox/TextFontComboBox.java
  7. 2
      designer_base/src/com/fr/design/mainframe/JTemplate.java
  8. 5
      designer_form/src/com/fr/design/mainframe/JForm.java

5
designer/src/com/fr/design/mainframe/JWorkBook.java

@ -129,6 +129,11 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
return getEditingElementCasePane();
}
@Override
public JComponent getCurrentReportComponentPane() {
return reportComposite;
}
@Override
protected UIModeControlContainer createCenterPane() {
parameterPane = ModuleContext.isModuleStarted(Module.FORM_MODULE) ? new ParameterDefinitePane() : null;

5
designer/src/com/fr/design/mainframe/ReportComponent.java

@ -44,6 +44,11 @@ public abstract class ReportComponent<T extends TemplateReport, E extends Elemen
public abstract S getDefaultSelectElement();
/**
* 更新JSliderPane
*/
public abstract void updateJSliderValue();
@Override
public ShortCut[] shortcut4TemplateMenu() {

8
designer/src/com/fr/design/mainframe/ReportComponentComposite.java

@ -145,13 +145,7 @@ public class ReportComponentComposite extends JComponent {
}
private void updateJSlider(){
int value = 0;
if (centerCardPane.editingComponet.elementCasePane != null) {
value = centerCardPane.editingComponet.elementCasePane.getResolution() * HUND / ScreenResolution.getScreenResolution();
}else {
value = centerCardPane.getPolyDezi().getResolution() * HUND / ScreenResolution.getScreenResolution();
}
jSliderContainer.getShowVal().setValue(value);
centerCardPane.editingComponet.updateJSliderValue();
}
/**

11
designer/src/com/fr/design/mainframe/WorkSheetDesigner.java

@ -4,11 +4,13 @@ import java.awt.BorderLayout;
import javax.swing.*;
import com.fr.base.ScreenResolution;
import com.fr.design.DesignState;
import com.fr.design.actions.report.*;
import com.fr.design.designer.EditingState;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.*;
import com.fr.grid.selection.CellSelection;
@ -21,6 +23,8 @@ import com.fr.stable.ArrayUtils;
public class WorkSheetDesigner extends ReportComponent<WorkSheet, ElementCasePaneDelegate, Selection> {
private static final int HUND = 100;
public WorkSheetDesigner(WorkSheet sheet) {
super(sheet);
@ -166,6 +170,13 @@ public class WorkSheetDesigner extends ReportComponent<WorkSheet, ElementCasePan
return cellElement == null ? new CellSelection() : new CellSelection(0, 0, cellElement.getColumnSpan(), cellElement.getRowSpan());
}
@Override
public void updateJSliderValue() {
ReportComponentComposite reportComposite = (ReportComponentComposite) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentReportComponentPane();
JSliderPane jSliderContainer = reportComposite.getjSliderContainer();
jSliderContainer.getShowVal().setValue((int)Math.ceil((double) this.elementCasePane.getResolution() * HUND / ScreenResolution.getScreenResolution()));
}
@Override
public void addSelectionChangeListener(SelectionListener selectionListener) {
elementCasePane.addSelectionChangeListener(selectionListener);

8
designer/src/com/fr/poly/PolyDesigner.java

@ -87,6 +87,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
// richer:鼠标滚轮每滚动一下,PolyDesignPane的尺寸就改变ROTATIONS这么多
private static final int ROTATIONS = 50;
private static final int MIN = 10;
private static final int HUND = 100;
private JScrollBar verScrollBar;
private JScrollBar horScrollBar;
@ -845,6 +846,13 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
return null;
}
@Override
public void updateJSliderValue() {
ReportComponentComposite reportComposite = (ReportComponentComposite) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentReportComponentPane();
JSliderPane jSliderContainer = reportComposite.getjSliderContainer();
jSliderContainer.getShowVal().setValue((int)Math.ceil((double)this.resolution * HUND / ScreenResolution.getScreenResolution()));
}
/**
* @return

13
designer_base/src/com/fr/design/gui/icombobox/TextFontComboBox.java

@ -4,6 +4,7 @@ package com.fr.design.gui.icombobox;
import com.fr.design.gui.icombobox.filter.Filter;
import com.fr.design.gui.icombobox.filter.StartsWithFilter;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
@ -16,7 +17,7 @@ import java.util.List;
/**
* Created by MoMeak on 2017/9/5.
*/
public class TextFontComboBox<T> extends ExtendedComboBox{
public class TextFontComboBox<T> extends ExtendedComboBox {
private Filter filter;
public TextFontComboBox() {
@ -38,8 +39,8 @@ public class TextFontComboBox<T> extends ExtendedComboBox{
public void setItemArray(T[] objectArray) {
List<T> itemList = new ArrayList<T>();
if(objectArray != null) {
for(int i = 0; i < objectArray.length; i++) {
if (objectArray != null) {
for (int i = 0; i < objectArray.length; i++) {
itemList.add(objectArray[i]);
}
}
@ -48,8 +49,8 @@ public class TextFontComboBox<T> extends ExtendedComboBox{
}
public void setItemList(List<T> itemList) {
((FilterableComboBoxModel)this.getModel()).setPrefix("");
((FilterableComboBoxModel)this.getModel()).setItemList(itemList);
((FilterableComboBoxModel) this.getModel()).setPrefix(StringUtils.EMPTY);
((FilterableComboBoxModel) this.getModel()).setItemList(itemList);
}
class FilterComboBoxEditor implements ComboBoxEditor, DocumentListener {
@ -75,7 +76,7 @@ public class TextFontComboBox<T> extends ExtendedComboBox{
this.item = item;
this.setting = true;
String newText = (item == null) ? "" : item.toString();
String newText = (item == null) ? StringUtils.EMPTY : item.toString();
textField.setText(newText);
this.setting = false;
}

2
designer_base/src/com/fr/design/mainframe/JTemplate.java

@ -114,6 +114,8 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
public abstract TargetComponent getCurrentElementCasePane();
public abstract JComponent getCurrentReportComponentPane();
// 为收集模版信息作准备
private void initForCollect() {
template.initTemplateID(); // 为新模板设置 templateID 属性

5
designer_form/src/com/fr/design/mainframe/JForm.java

@ -103,6 +103,11 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
return elementCaseDesign.getEditingElementCasePane();
}
@Override
public JComponent getCurrentReportComponentPane() {
return null;
}
public int getMenuState() {
return DesignState.JFORM;

Loading…
Cancel
Save