Browse Source

Merge branch 'release/9.0' of http://www.finedevelop.com:2015/scm/~kerry/design into release/9.0

master
kerry 7 years ago
parent
commit
a21a652cde
  1. 207
      designer/src/com/fr/design/actions/cell/style/AlignmentAction.java
  2. 140
      designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java
  3. 14
      designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java
  4. 13
      designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java
  5. 99
      designer/src/com/fr/design/mainframe/ElementCasePane.java
  6. 3
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  7. 24
      designer/src/com/fr/design/mainframe/ReportFloatPane.java
  8. 2
      designer/src/com/fr/design/report/UnitFieldPane.java
  9. 14
      designer/src/com/fr/start/Designer.java
  10. 2
      designer_base/src/com/fr/design/gui/ibutton/UIButton.java
  11. 4
      designer_base/src/com/fr/design/gui/ibutton/UIHeadGroup.java
  12. 2
      designer_base/src/com/fr/design/gui/ibutton/UIToggleButton.java
  13. 13
      designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java
  14. 1
      designer_base/src/com/fr/design/gui/itree/checkboxtree/NullTristateCheckBox.java
  15. BIN
      designer_base/src/com/fr/design/images/buttonicon/leftNormal.png
  16. BIN
      designer_base/src/com/fr/design/images/m_format/cellstyle/bold_white.png
  17. BIN
      designer_base/src/com/fr/design/images/m_format/cellstyle/h_center_normal_white.png
  18. BIN
      designer_base/src/com/fr/design/images/m_format/cellstyle/h_left_normal_white.png
  19. BIN
      designer_base/src/com/fr/design/images/m_format/cellstyle/h_right_normal_white.png
  20. BIN
      designer_base/src/com/fr/design/images/m_format/cellstyle/italic_white.png
  21. BIN
      designer_base/src/com/fr/design/images/m_format/cellstyle/underline_white.png
  22. 15
      designer_base/src/com/fr/env/RemoteEnv.java

207
designer/src/com/fr/design/actions/cell/style/AlignmentAction.java

@ -1,111 +1,134 @@
package com.fr.design.actions.cell.style;
import javax.swing.Icon;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.base.chart.BaseChartCollection;
import com.fr.design.constants.UIConstants;
import com.fr.design.actions.ButtonGroupAction;
import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.general.Inter;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.Inter;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.Constants;
import javax.swing.*;
public class AlignmentAction extends ButtonGroupAction implements StyleActionInterface {
public AlignmentAction(ElementCasePane t, Icon[] iconArray,
Integer[] valueArray) {
super(t, iconArray, valueArray);
}
/**
* executeStyle
*
* @param style
* @param selectedStyle
* @return style
*/
public Style executeStyle(Style style, Style selectedStyle) {
return style.deriveHorizontalAlignment(getSelectedValue());
}
/**
* 更新Style
*
* @param style style
*/
public void updateStyle(Style style) {
setSelectedIndex(BaseUtils.getAlignment4Horizontal(style));
}
/**
* executeActionReturnUndoRecordNeeded
*
* @return
*/
public boolean executeActionReturnUndoRecordNeeded() {
ElementCasePane reportPane = this.getEditingComponent();
if (reportPane == null) {
return false;
}
return ReportActionUtils.executeAction(this, reportPane);
}
/**
* update
*/
public void update() {
super.update();
//peter:如果当前没有ReportFrame,不需要继续.
if (!this.isEnabled()) {
return;
}
//got simple cell element from row and column
ElementCasePane reportPane = this.getEditingComponent();
if (reportPane == null) {
this.setEnabled(false);
return;
}
Selection cs = reportPane.getSelection();
TemplateElementCase tplEC = reportPane.getEditingElementCase();
if (tplEC != null && cs instanceof FloatSelection) {
FloatElement selectedFloat = tplEC.getFloatElement(((FloatSelection) cs).getSelectedFloatName());
Object value = selectedFloat.getValue();
if (value instanceof BaseChartCollection) {
this.setEnabled(false);
return;
}
}
this.updateStyle(ReportActionUtils.getCurrentStyle(reportPane));
}
/**
* 创建工具条且有提示
*
* @return
*/
public UIButtonGroup<Integer> createToolBarComponent() {
UIButtonGroup<Integer> group = super.createToolBarComponent();
if (group != null) {
group.setForToolBarButtonGroup(true);
group.setAllToolTips(new String[]{Inter.getLocText("StyleAlignment-Left"), Inter.getLocText("Center"), Inter.getLocText("StyleAlignment-Right")});
}
for (int i = 0; i < 3; i++) {
group.getButton(i).setRoundBorder(true, UIConstants.ARC);
group.getButton(i).setBorderPainted(true);
}
return group;
}
private static final Icon[] normalBlackIcon = new Icon[]{
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")};
private static final Icon[] toggleWhiteIcon = new Icon[]{
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal_white.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal_white.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal_white.png")};
private static final Integer[] valueArray = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
public AlignmentAction(ElementCasePane t) {
super(t, normalBlackIcon, valueArray);
}
/**
* executeStyle
*
* @param style
* @param selectedStyle
* @return style
*/
public Style executeStyle(Style style, Style selectedStyle) {
return style.deriveHorizontalAlignment(getSelectedValue());
}
/**
* 更新Style
*
* @param style style
*/
public void updateStyle(Style style) {
UIButtonGroup<Integer> buttonGroup = createToolBarComponent();
int selected = BaseUtils.getAlignment4Horizontal(style);
for (int i = 0; i < normalBlackIcon.length; i++) {
UIToggleButton button = buttonGroup.getButton(i);
Icon currentIcon = button.getIcon();
Icon newIcon = selected == valueArray[i] ? toggleWhiteIcon[i] : normalBlackIcon[i];
if (newIcon != currentIcon) {
button.setIcon(newIcon);
}
}
setSelectedIndex(selected);
}
/**
* executeActionReturnUndoRecordNeeded
*
* @return
*/
public boolean executeActionReturnUndoRecordNeeded() {
ElementCasePane reportPane = this.getEditingComponent();
if (reportPane == null) {
return false;
}
return ReportActionUtils.executeAction(this, reportPane);
}
/**
* update
*/
public void update() {
super.update();
//peter:如果当前没有ReportFrame,不需要继续.
if (!this.isEnabled()) {
return;
}
//got simple cell element from row and column
ElementCasePane reportPane = this.getEditingComponent();
if (reportPane == null) {
this.setEnabled(false);
return;
}
Selection cs = reportPane.getSelection();
TemplateElementCase tplEC = reportPane.getEditingElementCase();
if (tplEC != null && cs instanceof FloatSelection) {
FloatElement selectedFloat = tplEC.getFloatElement(((FloatSelection) cs).getSelectedFloatName());
Object value = selectedFloat.getValue();
if (value instanceof BaseChartCollection) {
this.setEnabled(false);
return;
}
}
this.updateStyle(ReportActionUtils.getCurrentStyle(reportPane));
}
/**
* 创建工具条且有提示
*
* @return
*/
public UIButtonGroup<Integer> createToolBarComponent() {
UIButtonGroup<Integer> group = super.createToolBarComponent();
if (group != null) {
group.setForToolBarButtonGroup(true);
group.setAllToolTips(new String[]{Inter.getLocText("StyleAlignment-Left"), Inter.getLocText("Center"), Inter.getLocText("StyleAlignment-Right")});
}
for (int i = 0; i < 3; i++) {
group.getButton(i).setRoundBorder(true, UIConstants.ARC);
group.getButton(i).setBorderPainted(true);
}
return group;
}
}

140
designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java

@ -8,84 +8,96 @@ import com.fr.base.Style;
import com.fr.base.core.StyleUtils;
import com.fr.design.actions.ToggleButtonUpdateAction;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import javax.swing.*;
/**
* Bold.
*/
public class ReportFontBoldAction extends AbstractStyleAction implements ToggleButtonUpdateAction {
private UIToggleButton button;
protected Style style;
private UIToggleButton button;
protected Style style;
private final static Icon blackIcon = BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png");
private final static Icon whiteIcon = BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold_white.png");
public ReportFontBoldAction(ElementCasePane t) {
super(t);
public ReportFontBoldAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("FRFont-bold"));
this.setSmallIcon(blackIcon);
}
this.setName(Inter.getLocText("FRFont-bold"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"));
}
/**
* 根据按钮状态获取格式
*
* @param style
* @param defStyle
* @return
*/
@Override
public Style executeStyle(Style style, Style defStyle) {
button = createToolBarComponent();
button.setIcon(getToggleButtonIcon(button.isSelected()));
button.setSelected(!button.isSelected());
if (button.isSelected()) {
setSelectedFont(style);
button.setSelected(false);
} else {
setUnselectedFont(style);
button.setSelected(true);
}
/**
* 根据按钮状态获取格式
*
* @param style
* @param defStyle
* @return
*/
@Override
public Style executeStyle(Style style, Style defStyle) {
createToolBarComponent().setSelected(!createToolBarComponent().isSelected());
if (createToolBarComponent().isSelected()) {
setSelectedFont(style);
createToolBarComponent().setSelected(false);
} else {
setUnselectedFont(style);
createToolBarComponent().setSelected(true);
}
return this.style;
}
return this.style;
}
protected Icon getToggleButtonIcon(boolean isSelected) {
return isSelected ? blackIcon : whiteIcon;
}
protected void setSelectedFont(Style style) {
this.style = StyleUtils.boldReportFont(style);
}
protected void setSelectedFont(Style style) {
this.style = StyleUtils.boldReportFont(style);
}
protected void setUnselectedFont(Style style) {
this.style = StyleUtils.unBoldReportFont(style);
}
protected void setUnselectedFont(Style style) {
this.style = StyleUtils.unBoldReportFont(style);
}
/**
* Update Style.
*/
@Override
public void updateStyle(Style style) {
if (style == null) {
return;
}
FRFont frFont = style.getFRFont();
if (frFont == null) {
return;
}
createToolBarComponent().setSelected(isStyle(frFont));
}
/**
* Update Style.
*/
@Override
public void updateStyle(Style style) {
if (style == null) {
return;
}
FRFont frFont = style.getFRFont();
if (frFont == null) {
return;
}
button = createToolBarComponent();
button.setSelected(isStyle(frFont));
button.setIcon(getToggleButtonIcon(!button.isSelected()));
}
protected boolean isStyle(FRFont frFont) {
return frFont.isBold();
}
protected boolean isStyle(FRFont frFont) {
return frFont.isBold();
}
/**
* Gets component on toolbar.
*
* @return the created components on toolbar.
*/
@Override
public UIToggleButton createToolBarComponent() {
if (button == null) {
button = GUICoreUtils.createToolBarComponent(this);
button.setEventBannded(true);
}
return button;
}
/**
* Gets component on toolbar.
*
* @return the created components on toolbar.
*/
@Override
public UIToggleButton createToolBarComponent() {
if (button == null) {
button = GUICoreUtils.createToolBarComponent(this);
button.setEventBannded(true);
}
return button;
}
}

14
designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java

@ -10,16 +10,21 @@ import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import javax.swing.*;
/**
* Bold.
*/
public class ReportFontItalicAction extends ReportFontBoldAction {
public ReportFontItalicAction(ElementCasePane t) {
private final static Icon blackIcon = BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png");
private final static Icon whiteIcon = BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic_white.png");
public ReportFontItalicAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("FRFont-italic"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"));
this.setSmallIcon(blackIcon);
}
@ -31,6 +36,9 @@ public class ReportFontItalicAction extends ReportFontBoldAction {
this.style = StyleUtils.unItalicReportFont(style);
}
protected Icon getToggleButtonIcon(boolean isSelected) {
return isSelected ? blackIcon : whiteIcon;
}
protected boolean isStyle(FRFont frFont) {
return frFont.isItalic();

13
designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java

@ -11,15 +11,21 @@ import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.stable.Constants;
import javax.swing.*;
/**
* Bold.
*/
public class ReportFontUnderlineAction extends ReportFontBoldAction {
public ReportFontUnderlineAction(ElementCasePane t) {
private final static Icon blackIcon = BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png");
private final static Icon whiteIcon = BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline_white.png");
public ReportFontUnderlineAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("FRFont-Underline"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png"));
this.setSmallIcon(blackIcon);
}
protected void setSelectedFont (Style style) {
@ -30,6 +36,9 @@ public class ReportFontUnderlineAction extends ReportFontBoldAction {
this.style = StyleUtils.setReportFontUnderline(style, false);
}
protected Icon getToggleButtonIcon(boolean isSelected) {
return isSelected ? blackIcon : whiteIcon;
}
protected boolean isStyle(FRFont frFont) {
return frFont.getUnderline() != Constants.LINE_NONE;

99
designer/src/com/fr/design/mainframe/ElementCasePane.java

@ -3,34 +3,7 @@
*/
package com.fr.design.mainframe;
import java.awt.AWTEvent;
import java.awt.Adjustable;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.event.*;
import java.lang.reflect.Constructor;
import java.util.Set;
import javax.swing.AbstractAction;
import javax.swing.ActionMap;
import javax.swing.Icon;
import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollBar;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.FRContext;
import com.fr.base.Formula;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.base.*;
import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
@ -39,30 +12,8 @@ import com.fr.design.actions.ExitAuthorityEditAction;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.cell.BorderAction;
import com.fr.design.actions.cell.CleanAuthorityAction;
import com.fr.design.actions.cell.style.AlignmentAction;
import com.fr.design.actions.cell.style.ReportFontBoldAction;
import com.fr.design.actions.cell.style.ReportFontForegroundAction;
import com.fr.design.actions.cell.style.ReportFontItalicAction;
import com.fr.design.actions.cell.style.ReportFontNameAction;
import com.fr.design.actions.cell.style.ReportFontSizeAction;
import com.fr.design.actions.cell.style.ReportFontUnderlineAction;
import com.fr.design.actions.cell.style.StyleBackgroundAction;
import com.fr.design.actions.columnrow.CancelColumnAction;
import com.fr.design.actions.columnrow.CancelRowAction;
import com.fr.design.actions.columnrow.ColumnHideAction;
import com.fr.design.actions.columnrow.ColumnWidthAction;
import com.fr.design.actions.columnrow.DeleteColumnAction;
import com.fr.design.actions.columnrow.DeleteRowAction;
import com.fr.design.actions.columnrow.FootColumnAction;
import com.fr.design.actions.columnrow.FootRowAction;
import com.fr.design.actions.columnrow.HeadColumnAction;
import com.fr.design.actions.columnrow.HeadRowAction;
import com.fr.design.actions.columnrow.InsertColumnAction;
import com.fr.design.actions.columnrow.InsertRowAction;
import com.fr.design.actions.columnrow.ResetColumnHideAction;
import com.fr.design.actions.columnrow.ResetRowHideAction;
import com.fr.design.actions.columnrow.RowHeightAction;
import com.fr.design.actions.columnrow.RowHideAction;
import com.fr.design.actions.cell.style.*;
import com.fr.design.actions.columnrow.*;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.edit.CopyAction;
import com.fr.design.actions.edit.CutAction;
@ -74,6 +25,7 @@ import com.fr.design.cell.clipboard.CellElementsClip;
import com.fr.design.cell.clipboard.ElementsTransferable;
import com.fr.design.cell.clipboard.FloatElementsClip;
import com.fr.design.cell.editor.*;
import com.fr.design.cell.editor.CellEditor;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.EditingState;
import com.fr.design.designer.TargetComponent;
@ -83,11 +35,7 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.cell.QuickEditorRegion;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.NameSeparator;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.menu.*;
import com.fr.design.selection.QuickEditor;
import com.fr.design.selection.Selectedable;
import com.fr.design.selection.SelectionEvent;
@ -95,11 +43,7 @@ import com.fr.design.selection.SelectionListener;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.grid.Grid;
import com.fr.grid.GridColumn;
import com.fr.grid.GridCorner;
import com.fr.grid.GridRow;
import com.fr.grid.GridUtils;
import com.fr.grid.*;
import com.fr.grid.dnd.ElementCasePaneDropTarget;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
@ -119,9 +63,17 @@ import com.fr.report.elementcase.ElementCase;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.ArrayUtils;
import com.fr.stable.ColumnRow;
import com.fr.stable.Constants;
import com.fr.stable.unit.FU;
import javax.swing.*;
import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.event.*;
import java.lang.reflect.Constructor;
import java.util.Set;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
@ -186,7 +138,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
/**
* Constructor.
*/
public ElementCasePane(T t) {
public ElementCasePane(T t) {
super(t);
// marks:能触发processEvent,不管是否给component增加listener。这里是使在reportPane中的任意位置滑动鼠标轮都能
// 下拉grid。
@ -209,7 +161,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
this.setLayout(new RGridLayout());
//todo 直接修改分辨率
if (this.resolution == 0){
if (this.resolution == 0) {
this.resolution = ScreenResolution.getScreenResolution();
}
@ -243,7 +195,6 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
}
public int getMenuState() {
return DesignState.WORK_SHEET;
}
@ -294,8 +245,8 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
setFormatState(DesignerContext.FORMAT_STATE_NULL);
formatBrush.setSelected(false);
grid.setCursor(UIConstants.CELL_DEFAULT_CURSOR);
if(DesignerContext.getReferencedElementCasePane() == null){
return;
if (DesignerContext.getReferencedElementCasePane() == null) {
return;
}
((ElementCasePane) DesignerContext.getReferencedElementCasePane()).getGrid().setNotShowingTableSelectPane(true);
@ -348,11 +299,11 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
}
public void setResolution(int resolution){
public void setResolution(int resolution) {
this.resolution = resolution;
}
public int getResolution(){
public int getResolution() {
return this.resolution;
}
@ -1149,7 +1100,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
HeadColumnAction headcolumnAction = new HeadColumnAction(this);
FootColumnAction footcolumnAction = new FootColumnAction(this);
ColumnRow selectedCellPoint = GridUtils.getAdjustEventColumnRow_withresolution(this, evt.getX(), evt.getY(),this.resolution);
ColumnRow selectedCellPoint = GridUtils.getAdjustEventColumnRow_withresolution(this, evt.getX(), evt.getY(), this.resolution);
ElementCase elementCase = this.getEditingElementCase();
boolean cancel = false;
ReportPageAttrProvider reportPageAttr = elementCase.getReportPageAttr();
@ -1267,11 +1218,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
protected ToolBarDef createAlignmentToolBar() {
return ShortCut.asToolBarDef(new ShortCut[]{
new AlignmentAction(this, new Icon[]{
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")},
new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT})}
new AlignmentAction(this)}
);
}

3
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -176,6 +176,9 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
for (int i = 0; i < actions.length; i++) {
subMenuDef.addShortCut(actions[i]);
}
// 顺便更新右侧属性面板悬浮元素tab中的菜单项
ReportFloatPane.getInstance().refreshInsertFloatMenu(this);
}
// 格式菜单

24
designer/src/com/fr/design/mainframe/ReportFloatPane.java

@ -23,7 +23,6 @@ import java.awt.*;
public class ReportFloatPane extends JPanel {
private static ReportFloatPane THIS;
private ElementCasePaneDelegate elementCasePaneDelegate;
private MenuDef insertFloatMenu;
private ReportFloatPane() {
@ -37,12 +36,20 @@ public class ReportFloatPane extends JPanel {
return THIS;
}
public void refreshInsertFloatMenu(ElementCasePaneDelegate elementCasePaneDelegate) {
insertFloatMenu.clearShortCuts();
UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, elementCasePaneDelegate);
for (int i = 0; i < actions.length; i++) {
insertFloatMenu.addShortCut(actions[i]);
}
}
private void initComponent() {
this.setLayout(new BorderLayout());
UIToolbar topToolBar = new UIToolbar();
topToolBar.setLayout(new BorderLayout());
insertFloatMenu = createInsertToolBar();
initInsertToolBar();
topToolBar.setPreferredSize(new Dimension(155,20));
topToolBar.add(createButtonUI(), BorderLayout.CENTER);
topToolBar.setBorder(BorderFactory.createEmptyBorder(-1, -1, -1, -1));
@ -66,19 +73,14 @@ public class ReportFloatPane extends JPanel {
this.add(leftTopPane, BorderLayout.NORTH);
}
private MenuDef createInsertToolBar() {
MenuDef insertFloatMenu = new MenuDef(true);
private void initInsertToolBar() {
insertFloatMenu = new MenuDef(true);
insertFloatMenu.setName(KeySetUtils.INSERT_FLOAT.getMenuKeySetName());
insertFloatMenu.setTooltip(Inter.getLocText("FR-Designer_T_Insert_Float"));
insertFloatMenu.setIconPath("com/fr/design/images/control/addPopup.png");
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
elementCasePaneDelegate = (ElementCasePaneDelegate) editingTemplate.getCurrentElementCasePane();
UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, elementCasePaneDelegate);
for (int i = 0; i < actions.length; i++) {
insertFloatMenu.addShortCut(actions[i]);
}
return insertFloatMenu;
ElementCasePaneDelegate elementCasePaneDelegate = (ElementCasePaneDelegate) editingTemplate.getCurrentElementCasePane();
refreshInsertFloatMenu(elementCasePaneDelegate);
}
private UIButton createButtonUI() {

2
designer/src/com/fr/design/report/UnitFieldPane.java

@ -48,7 +48,7 @@ public class UnitFieldPane extends JPanel {
} else if (unitType == Constants.UNIT_INCH) {
this.setText(Inter.getLocText("FR-Designer_Unit_INCH"));
} else {
this.setText(Inter.getLocText("FR-Designer_Unit_MM-mm"));
this.setText(Inter.getLocText("FR-Designer_Unit_MM"));
}
//ajust the heigt of unitLabel.

14
designer/src/com/fr/start/Designer.java

@ -135,26 +135,24 @@ public class Designer extends BaseDesigner {
public UILargeToolbar createLargeToolbar() {
UILargeToolbar largeToolbar = super.createLargeToolbar();
largeToolbar.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 4));
JPanel templeJpanel = new JPanel() {
largeToolbar.add(new JPanel() {
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.width = 1;
return dim;
}
};
templeJpanel.setBackground(Color.WHITE);
largeToolbar.add(templeJpanel);
});
createRunButton(largeToolbar);
largeToolbar.add(run);
templeJpanel = new JPanel() {
run.setBackground(UIConstants.TREE_BACKGROUND);
largeToolbar.add(new JPanel() {
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.width = GAP;
return dim;
}
};
templeJpanel.setBackground(Color.WHITE);
largeToolbar.add(templeJpanel);
});
largeToolbar.addSeparator(new Dimension(2, 42));
largeToolbar.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), UIConstants.LINE_COLOR));
return largeToolbar;
}

2
designer_base/src/com/fr/design/gui/ibutton/UIButton.java

@ -36,7 +36,7 @@ public class UIButton extends JButton implements UIObserver {
private CellBorderStyle border = null;
protected UIObserverListener uiObserverListener;
private static final int TOOLTIP_INIT_DELAY = 1000; // 延迟 1s 显示提示文字
private static final int TOOLTIP_INIT_DELAY = 300; // 延迟 0.3s 显示提示文字
public UIButton() {
this(StringUtils.EMPTY);

4
designer_base/src/com/fr/design/gui/ibutton/UIHeadGroup.java

@ -23,8 +23,8 @@ public class UIHeadGroup extends JPanel {
public UIHeadGroup(String[] textArray) {
labelButtonList = new ArrayList<UIToggleButton>(textArray.length);
this.setBackground(UIConstants.NORMAL_BACKGROUND);
this.setLayout(new GridLayout(0, textArray.length, 1, 0));
this.setBackground(UIConstants.TREE_BACKGROUND);
this.setLayout(new GridLayout(0, textArray.length, 0, 0));
// this.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
for (int i = 0; i < textArray.length; i++) {
final int index = i;

2
designer_base/src/com/fr/design/gui/ibutton/UIToggleButton.java

@ -122,7 +122,7 @@ public class UIToggleButton extends UIButton implements GlobalNameObserver{
@Override
public void mouseClicked(MouseEvent e) {
if (isEnabled() && !isEventBannded) {
setSelectedWithFireListener(!isSelected());
setSelectedWithFireListener(!isSelected());
}
}
};

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

@ -26,9 +26,16 @@ public class UIComboBoxRenderer extends DefaultListCellRenderer {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
cellHasFocus = cellHasFocus && !this.isEnabled();
JLabel renderer =(JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
renderer.setForeground(Color.black);
list.setSelectionBackground(UIConstants.COMBOBOX_BTN_PRESS);
list.setSelectionForeground(Color.black);
renderer.setOpaque(true);
list.setSelectionBackground(UIConstants.NORMAL_BLUE);
list.setSelectionForeground(Color.WHITE);
if (isSelected) {
renderer.setForeground(list.getSelectionForeground());
renderer.setBackground(list.getSelectionBackground());
} else {
renderer.setForeground(list.getForeground());
renderer.setBackground(list.getBackground());
}
renderer.setText(" " + renderer.getText());
return renderer;
}

1
designer_base/src/com/fr/design/gui/itree/checkboxtree/NullTristateCheckBox.java

@ -65,7 +65,6 @@ public class NullTristateCheckBox extends TristateCheckBox {
// @Override
public void updateUI() {
super.updateUI();
clearAttribute();
}

BIN
designer_base/src/com/fr/design/images/buttonicon/leftNormal.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

After

Width:  |  Height:  |  Size: 193 B

BIN
designer_base/src/com/fr/design/images/m_format/cellstyle/bold_white.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

BIN
designer_base/src/com/fr/design/images/m_format/cellstyle/h_center_normal_white.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

BIN
designer_base/src/com/fr/design/images/m_format/cellstyle/h_left_normal_white.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

BIN
designer_base/src/com/fr/design/images/m_format/cellstyle/h_right_normal_white.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

BIN
designer_base/src/com/fr/design/images/m_format/cellstyle/italic_white.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

BIN
designer_base/src/com/fr/design/images/m_format/cellstyle/underline_white.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

15
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -175,12 +175,8 @@ public class RemoteEnv extends AbstractEnv {
* 根据nameValuePairs,也就是参数对,生成PostMethod,不同之处在于,参数拼在path后面,不是method.addParameters
*/
private HttpClient createHttpMethod2(HashMap<String, String> para) throws EnvException {
StringBuilder sb = new StringBuilder(path);
sb.append('?');
sb.append("id=").append(createUserID());
return new HttpClient(sb.toString(), para, true);
String methodPath = path + '?' + "id=" + createUserID();
return new HttpClient(methodPath, para, true);
}
@ -362,7 +358,7 @@ public class RemoteEnv extends AbstractEnv {
Inter.getLocText(new String[]{"Datasource-Connection_failed", "Registration-User_Name", "Password", "Error"}, new String[]{",", "", "", "!"})
, Inter.getLocText("FR-Server-All_Error"), JOptionPane.ERROR_MESSAGE);
return false;
} else if (res.indexOf("RegistEditionException") != -1) {
} else if (res.contains("RegistEditionException")) {
if (needMessage) {
JOptionPane.showMessageDialog(parentComponent, Inter.getLocText(new String[]{"Datasource-Connection_failed", "Version-does-not-support"}, new String[]{",", "!"}));
} else {
@ -415,9 +411,8 @@ public class RemoteEnv extends AbstractEnv {
para.put("op", "fr_remote_design");
para.put("cmd", "heart_beat");
para.put("user", user);
para.put("userid", userID);
HttpClient client = createHttpMethod(para, true);
HttpClient client = createHttpMethod(para);
execute4InputStream(client);
//这做法不好, 30秒刷一次, 刷新的时候会重新构建树, 构建完会把子节点都收缩起来, 效果太差.
@ -552,7 +547,7 @@ public class RemoteEnv extends AbstractEnv {
if (resJSON == null) {
return false;
}
if (resJSON.indexOf("RegistEditionException") != -1) {
if (resJSON.contains("RegistEditionException")) {
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Lic_does_not_Support_Remote"));
return false;
}

Loading…
Cancel
Save