Browse Source

REPORT-3348 视觉调整

master
yaoh.wu 7 years ago
parent
commit
35b57ab860
  1. 13
      designer/src/com/fr/quickeditor/CellQuickEditor.java
  2. 11
      designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java
  3. 8
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  4. 12
      designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java
  5. 12
      designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java
  6. 4
      designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java
  7. 12
      designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java

13
designer/src/com/fr/quickeditor/CellQuickEditor.java

@ -48,6 +48,12 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
private int selectedIndex;
private JPanel leftContentPane;
private UIScrollBar scrollBar;
/*占位label*/
protected static UILabel emptyLabel = new UILabel();
static {
emptyLabel.setPreferredSize(new Dimension(60, 20));
}
public CellQuickEditor() {
@ -89,13 +95,14 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p};
JComponent centerBody = createCenterBody();
centerBody.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground()));
Component[][] components = new Component[][]{
new Component[]{initTopContent(), null},
new Component[]{createCenterBody(), null}
new Component[]{centerBody, null}
};
leftContentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BarLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
this.add(scrollBar);
this.add(leftContentPane);
}
@ -116,7 +123,7 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
new Component[]{insertContentLabel, cellElementEditButton},
};
JPanel topContent = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
topContent.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
topContent.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
return topContent;
}

11
designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java

@ -5,9 +5,10 @@ import com.fr.design.actions.insert.cell.BiasCellAction;
import com.fr.design.cell.editor.BiasTextPainterCellEditor.BiasTextPainterPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.cell.painter.BiasTextPainter;
@ -25,8 +26,7 @@ public class CellBiasTextPainterEditor extends CellQuickEditor {
@Override
public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
content.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
UIButton editButton = new UIButton(Inter.getLocText("Edit"), IOUtils.readIcon("/com/fr/design/images/m_insert/bias.png"));
UIButton editButton = new UIButton(Inter.getLocText("Edit"));
editButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -34,7 +34,10 @@ public class CellBiasTextPainterEditor extends CellQuickEditor {
}
});
editButton.setOpaque(false);
content.add(editButton, BorderLayout.CENTER);
content.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, editButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}), BorderLayout.CENTER);
return content;
}

8
designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -135,7 +135,6 @@ public class CellDSColumnEditor extends CellQuickEditor {
String[] iconArray = new String[paneList.size()];
card = new CardLayout();
cardContainer = new JPanel(card);
cardContainer.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
for (int i = 0; i < paneList.size(); i++) {
CellEditorPane pane = paneList.get(i);
iconArray[i] = pane.getIconPath();
@ -227,9 +226,8 @@ public class CellDSColumnEditor extends CellQuickEditor {
new Component[]{uiLabel, uiButton}
};
conditionPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.add(this.createContentPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
}
@ -302,7 +300,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
public DSColumnAdvancedEditorPane() {
this.setLayout(new BorderLayout());
this.add(this.createContentPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
}
@ -330,7 +328,6 @@ public class CellDSColumnEditor extends CellQuickEditor {
}
}
@SuppressWarnings("Duplicates")
@Override
public void populate() {
if (cellElement != null) {
@ -374,7 +371,6 @@ public class CellDSColumnEditor extends CellQuickEditor {
/**
* 更新单元格扩展属性
*/
@SuppressWarnings("Duplicates")
private void updateExtendConfig() {
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
if (cellExpandAttr == null) {

12
designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java

@ -5,10 +5,11 @@ import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.ImageCellAction;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.report.SelectImagePane;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.cell.cellattr.CellImage;
@ -33,8 +34,7 @@ public class CellImageQuickEditor extends CellQuickEditor {
@Override
public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
content.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
UIButton editButton = new UIButton(Inter.getLocText("Edit"), IOUtils.readIcon("/com/fr/design/images/m_insert/image.png"));
UIButton editButton = new UIButton(Inter.getLocText("Edit"));
editButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -42,11 +42,13 @@ public class CellImageQuickEditor extends CellQuickEditor {
}
});
editButton.setOpaque(false);
content.add(editButton, BorderLayout.CENTER);
content.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, editButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}), BorderLayout.CENTER);
return content;
}
@SuppressWarnings("Duplicates")
private void showEditingDialog() {
final SelectImagePane imageEditorPane = new SelectImagePane();
imageEditorPane.populate(cellElement);

12
designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java

@ -3,6 +3,8 @@ package com.fr.quickeditor.cellquick;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.RichTextCellAction;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import com.fr.quickeditor.CellQuickEditor;
@ -22,14 +24,15 @@ public class CellRichTextEditor extends CellQuickEditor {
super();
}
@SuppressWarnings("Duplicates")
@Override
public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
content.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
richTextButton = new UIButton();
richTextButton.setOpaque(false);
content.add(richTextButton, BorderLayout.CENTER);
content.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, richTextButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}), BorderLayout.CENTER);
return content;
}
@ -41,7 +44,8 @@ public class CellRichTextEditor extends CellQuickEditor {
@Override
protected void refreshDetails() {
RichTextCellAction subReportCellAction = new RichTextCellAction(tc);
subReportCellAction.setName(Inter.getLocText("FR-Designer_RichTextEditor"));
subReportCellAction.setName(Inter.getLocText("Edit"));
subReportCellAction.setSmallIcon(null);
richTextButton.setAction(subReportCellAction);
}

4
designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java

@ -28,7 +28,6 @@ public class CellStringQuickEditor extends CellQuickEditor {
//编辑状态
private boolean isEditing = false;
//august:如果是原来编辑的是公式,要保留公式里的这些属性,不然在公式和字符串转化时,就会丢失这些属性设置。
private boolean reserveInResult = false;
private boolean reserveOnWriteOrAnaly = true;
@ -61,7 +60,6 @@ public class CellStringQuickEditor extends CellQuickEditor {
@Override
public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
content.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
stringTextArea = new UITextArea();
stringTextArea.addKeyListener(new KeyAdapter() {
@ -71,7 +69,7 @@ public class CellStringQuickEditor extends CellQuickEditor {
return;
}
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
//todo yaoh.wu虽然模仿选中单元格按enter可以做到,但是原理没有弄清楚。
//todo 按enter键换至下一个单元格 yaoh.wu虽然模仿选中单元格按enter这种场景可以做到,但是原理没有弄清楚。
GridKeyListener dispatchListener = new GridKeyListener(tc.getGrid());
dispatchListener.keyPressed(e);
dispatchListener.keyTyped(e);

12
designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java

@ -3,6 +3,8 @@ package com.fr.quickeditor.cellquick;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.SubReportCellAction;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import com.fr.quickeditor.CellQuickEditor;
@ -23,21 +25,23 @@ public class CellSubReportEditor extends CellQuickEditor {
super();
}
@SuppressWarnings("Duplicates")
@Override
public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
content.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
subReportButton = new UIButton();
subReportButton.setOpaque(false);
content.add(subReportButton, BorderLayout.CENTER);
content.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, subReportButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}), BorderLayout.CENTER);
return content;
}
@Override
protected void refreshDetails() {
SubReportCellAction subReportCellAction = new SubReportCellAction(tc);
subReportCellAction.setName(Inter.getLocText(new String[]{"Edit", "Sub_Report"}));
subReportCellAction.setName(Inter.getLocText("Edit"));
subReportCellAction.setSmallIcon(null);
subReportButton.setAction(subReportCellAction);
}

Loading…
Cancel
Save