Browse Source

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

master
kerry 8 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; package com.fr.design.actions.cell.style;
import javax.swing.Icon;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BaseChartCollection;
import com.fr.design.constants.UIConstants;
import com.fr.design.actions.ButtonGroupAction; import com.fr.design.actions.ButtonGroupAction;
import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButtonGroup; 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.design.mainframe.ElementCasePane;
import com.fr.general.Inter;
import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection; import com.fr.grid.selection.Selection;
import com.fr.report.cell.FloatElement; import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.Constants;
import javax.swing.*;
public class AlignmentAction extends ButtonGroupAction implements StyleActionInterface { public class AlignmentAction extends ButtonGroupAction implements StyleActionInterface {
public AlignmentAction(ElementCasePane t, Icon[] iconArray, private static final Icon[] normalBlackIcon = new Icon[]{
Integer[] valueArray) { BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
super(t, iconArray, valueArray); 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"),
* executeStyle 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")};
* @param style
* @param selectedStyle private static final Integer[] valueArray = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
* @return style
*/ public AlignmentAction(ElementCasePane t) {
public Style executeStyle(Style style, Style selectedStyle) { super(t, normalBlackIcon, valueArray);
return style.deriveHorizontalAlignment(getSelectedValue()); }
}
/** /**
* 更新Style * executeStyle
* *
* @param style style * @param style
*/ * @param selectedStyle
public void updateStyle(Style style) { * @return style
setSelectedIndex(BaseUtils.getAlignment4Horizontal(style)); */
} public Style executeStyle(Style style, Style selectedStyle) {
return style.deriveHorizontalAlignment(getSelectedValue());
/** }
* executeActionReturnUndoRecordNeeded
* /**
* @return * 更新Style
*/ *
public boolean executeActionReturnUndoRecordNeeded() { * @param style style
ElementCasePane reportPane = this.getEditingComponent(); */
if (reportPane == null) { public void updateStyle(Style style) {
return false; UIButtonGroup<Integer> buttonGroup = createToolBarComponent();
} int selected = BaseUtils.getAlignment4Horizontal(style);
for (int i = 0; i < normalBlackIcon.length; i++) {
return ReportActionUtils.executeAction(this, reportPane); UIToggleButton button = buttonGroup.getButton(i);
} Icon currentIcon = button.getIcon();
Icon newIcon = selected == valueArray[i] ? toggleWhiteIcon[i] : normalBlackIcon[i];
/** if (newIcon != currentIcon) {
* update button.setIcon(newIcon);
*/ }
public void update() { }
super.update(); setSelectedIndex(selected);
}
//peter:如果当前没有ReportFrame,不需要继续.
if (!this.isEnabled()) { /**
return; * executeActionReturnUndoRecordNeeded
} *
* @return
//got simple cell element from row and column */
ElementCasePane reportPane = this.getEditingComponent(); public boolean executeActionReturnUndoRecordNeeded() {
if (reportPane == null) { ElementCasePane reportPane = this.getEditingComponent();
this.setEnabled(false); if (reportPane == null) {
return; return false;
} }
Selection cs = reportPane.getSelection();
TemplateElementCase tplEC = reportPane.getEditingElementCase(); return ReportActionUtils.executeAction(this, reportPane);
}
if (tplEC != null && cs instanceof FloatSelection) {
FloatElement selectedFloat = tplEC.getFloatElement(((FloatSelection) cs).getSelectedFloatName()); /**
Object value = selectedFloat.getValue(); * update
if (value instanceof BaseChartCollection) { */
this.setEnabled(false); public void update() {
return; super.update();
}
} //peter:如果当前没有ReportFrame,不需要继续.
this.updateStyle(ReportActionUtils.getCurrentStyle(reportPane)); if (!this.isEnabled()) {
} return;
}
/**
* 创建工具条且有提示 //got simple cell element from row and column
* ElementCasePane reportPane = this.getEditingComponent();
* @return if (reportPane == null) {
*/ this.setEnabled(false);
public UIButtonGroup<Integer> createToolBarComponent() { return;
UIButtonGroup<Integer> group = super.createToolBarComponent(); }
if (group != null) { Selection cs = reportPane.getSelection();
group.setForToolBarButtonGroup(true); TemplateElementCase tplEC = reportPane.getEditingElementCase();
group.setAllToolTips(new String[]{Inter.getLocText("StyleAlignment-Left"), Inter.getLocText("Center"), Inter.getLocText("StyleAlignment-Right")});
} if (tplEC != null && cs instanceof FloatSelection) {
for (int i = 0; i < 3; i++) { FloatElement selectedFloat = tplEC.getFloatElement(((FloatSelection) cs).getSelectedFloatName());
group.getButton(i).setRoundBorder(true, UIConstants.ARC); Object value = selectedFloat.getValue();
group.getButton(i).setBorderPainted(true); if (value instanceof BaseChartCollection) {
} this.setEnabled(false);
return group; 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.base.core.StyleUtils;
import com.fr.design.actions.ToggleButtonUpdateAction; import com.fr.design.actions.ToggleButtonUpdateAction;
import com.fr.design.gui.ibutton.UIToggleButton; 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.mainframe.ElementCasePane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import javax.swing.*;
/** /**
* Bold. * Bold.
*/ */
public class ReportFontBoldAction extends AbstractStyleAction implements ToggleButtonUpdateAction { public class ReportFontBoldAction extends AbstractStyleAction implements ToggleButtonUpdateAction {
private UIToggleButton button; private UIToggleButton button;
protected Style style; 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) { this.setName(Inter.getLocText("FRFont-bold"));
super(t); 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);
}
/** return this.style;
* 根据按钮状态获取格式 }
*
* @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; protected Icon getToggleButtonIcon(boolean isSelected) {
} return isSelected ? blackIcon : whiteIcon;
}
protected void setSelectedFont(Style style) { protected void setSelectedFont(Style style) {
this.style = StyleUtils.boldReportFont(style); this.style = StyleUtils.boldReportFont(style);
} }
protected void setUnselectedFont(Style style) { protected void setUnselectedFont(Style style) {
this.style = StyleUtils.unBoldReportFont(style); this.style = StyleUtils.unBoldReportFont(style);
} }
/** /**
* Update Style. * Update Style.
*/ */
@Override @Override
public void updateStyle(Style style) { public void updateStyle(Style style) {
if (style == null) { if (style == null) {
return; return;
} }
FRFont frFont = style.getFRFont(); FRFont frFont = style.getFRFont();
if (frFont == null) { if (frFont == null) {
return; return;
} }
createToolBarComponent().setSelected(isStyle(frFont)); button = createToolBarComponent();
} button.setSelected(isStyle(frFont));
button.setIcon(getToggleButtonIcon(!button.isSelected()));
}
protected boolean isStyle(FRFont frFont) { protected boolean isStyle(FRFont frFont) {
return frFont.isBold(); return frFont.isBold();
} }
/** /**
* Gets component on toolbar. * Gets component on toolbar.
* *
* @return the created components on toolbar. * @return the created components on toolbar.
*/ */
@Override @Override
public UIToggleButton createToolBarComponent() { public UIToggleButton createToolBarComponent() {
if (button == null) { if (button == null) {
button = GUICoreUtils.createToolBarComponent(this); button = GUICoreUtils.createToolBarComponent(this);
button.setEventBannded(true); button.setEventBannded(true);
} }
return button; 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.general.Inter;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import javax.swing.*;
/** /**
* Bold. * Bold.
*/ */
public class ReportFontItalicAction extends ReportFontBoldAction { 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); super(t);
this.setName(Inter.getLocText("FRFont-italic")); 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); this.style = StyleUtils.unItalicReportFont(style);
} }
protected Icon getToggleButtonIcon(boolean isSelected) {
return isSelected ? blackIcon : whiteIcon;
}
protected boolean isStyle(FRFont frFont) { protected boolean isStyle(FRFont frFont) {
return frFont.isItalic(); 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.design.mainframe.ElementCasePane;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.*;
/** /**
* Bold. * Bold.
*/ */
public class ReportFontUnderlineAction extends ReportFontBoldAction { 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); super(t);
this.setName(Inter.getLocText("FRFont-Underline")); 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) { protected void setSelectedFont (Style style) {
@ -30,6 +36,9 @@ public class ReportFontUnderlineAction extends ReportFontBoldAction {
this.style = StyleUtils.setReportFontUnderline(style, false); this.style = StyleUtils.setReportFontUnderline(style, false);
} }
protected Icon getToggleButtonIcon(boolean isSelected) {
return isSelected ? blackIcon : whiteIcon;
}
protected boolean isStyle(FRFont frFont) { protected boolean isStyle(FRFont frFont) {
return frFont.getUnderline() != Constants.LINE_NONE; return frFont.getUnderline() != Constants.LINE_NONE;

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

@ -3,34 +3,7 @@
*/ */
package com.fr.design.mainframe; package com.fr.design.mainframe;
import java.awt.AWTEvent; import com.fr.base.*;
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.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; 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.UpdateAction;
import com.fr.design.actions.cell.BorderAction; import com.fr.design.actions.cell.BorderAction;
import com.fr.design.actions.cell.CleanAuthorityAction; import com.fr.design.actions.cell.CleanAuthorityAction;
import com.fr.design.actions.cell.style.AlignmentAction; import com.fr.design.actions.cell.style.*;
import com.fr.design.actions.cell.style.ReportFontBoldAction; import com.fr.design.actions.columnrow.*;
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.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.edit.CopyAction; import com.fr.design.actions.edit.CopyAction;
import com.fr.design.actions.edit.CutAction; 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.ElementsTransferable;
import com.fr.design.cell.clipboard.FloatElementsClip; import com.fr.design.cell.clipboard.FloatElementsClip;
import com.fr.design.cell.editor.*; import com.fr.design.cell.editor.*;
import com.fr.design.cell.editor.CellEditor;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.designer.EditingState; import com.fr.design.designer.EditingState;
import com.fr.design.designer.TargetComponent; 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.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.cell.QuickEditorRegion; import com.fr.design.mainframe.cell.QuickEditorRegion;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.*;
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.selection.QuickEditor; import com.fr.design.selection.QuickEditor;
import com.fr.design.selection.Selectedable; import com.fr.design.selection.Selectedable;
import com.fr.design.selection.SelectionEvent; 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.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.Grid; import com.fr.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.dnd.ElementCasePaneDropTarget; import com.fr.grid.dnd.ElementCasePaneDropTarget;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection; 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.report.elementcase.TemplateElementCase;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRow;
import com.fr.stable.Constants;
import com.fr.stable.unit.FU; 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; 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. * Constructor.
*/ */
public ElementCasePane(T t) { public ElementCasePane(T t) {
super(t); super(t);
// marks:能触发processEvent,不管是否给component增加listener。这里是使在reportPane中的任意位置滑动鼠标轮都能 // marks:能触发processEvent,不管是否给component增加listener。这里是使在reportPane中的任意位置滑动鼠标轮都能
// 下拉grid。 // 下拉grid。
@ -209,7 +161,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
this.setLayout(new RGridLayout()); this.setLayout(new RGridLayout());
//todo 直接修改分辨率 //todo 直接修改分辨率
if (this.resolution == 0){ if (this.resolution == 0) {
this.resolution = ScreenResolution.getScreenResolution(); this.resolution = ScreenResolution.getScreenResolution();
} }
@ -243,7 +195,6 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
} }
public int getMenuState() { public int getMenuState() {
return DesignState.WORK_SHEET; return DesignState.WORK_SHEET;
} }
@ -294,8 +245,8 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
setFormatState(DesignerContext.FORMAT_STATE_NULL); setFormatState(DesignerContext.FORMAT_STATE_NULL);
formatBrush.setSelected(false); formatBrush.setSelected(false);
grid.setCursor(UIConstants.CELL_DEFAULT_CURSOR); grid.setCursor(UIConstants.CELL_DEFAULT_CURSOR);
if(DesignerContext.getReferencedElementCasePane() == null){ if (DesignerContext.getReferencedElementCasePane() == null) {
return; return;
} }
((ElementCasePane) DesignerContext.getReferencedElementCasePane()).getGrid().setNotShowingTableSelectPane(true); ((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; this.resolution = resolution;
} }
public int getResolution(){ public int getResolution() {
return this.resolution; return this.resolution;
} }
@ -1149,7 +1100,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
HeadColumnAction headcolumnAction = new HeadColumnAction(this); HeadColumnAction headcolumnAction = new HeadColumnAction(this);
FootColumnAction footcolumnAction = new FootColumnAction(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(); ElementCase elementCase = this.getEditingElementCase();
boolean cancel = false; boolean cancel = false;
ReportPageAttrProvider reportPageAttr = elementCase.getReportPageAttr(); ReportPageAttrProvider reportPageAttr = elementCase.getReportPageAttr();
@ -1267,11 +1218,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
protected ToolBarDef createAlignmentToolBar() { protected ToolBarDef createAlignmentToolBar() {
return ShortCut.asToolBarDef(new ShortCut[]{ return ShortCut.asToolBarDef(new ShortCut[]{
new AlignmentAction(this, new Icon[]{ new AlignmentAction(this)}
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})}
); );
} }

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++) { for (int i = 0; i < actions.length; i++) {
subMenuDef.addShortCut(actions[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 { public class ReportFloatPane extends JPanel {
private static ReportFloatPane THIS; private static ReportFloatPane THIS;
private ElementCasePaneDelegate elementCasePaneDelegate;
private MenuDef insertFloatMenu; private MenuDef insertFloatMenu;
private ReportFloatPane() { private ReportFloatPane() {
@ -37,12 +36,20 @@ public class ReportFloatPane extends JPanel {
return THIS; 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() { private void initComponent() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
UIToolbar topToolBar = new UIToolbar(); UIToolbar topToolBar = new UIToolbar();
topToolBar.setLayout(new BorderLayout()); topToolBar.setLayout(new BorderLayout());
insertFloatMenu = createInsertToolBar(); initInsertToolBar();
topToolBar.setPreferredSize(new Dimension(155,20)); topToolBar.setPreferredSize(new Dimension(155,20));
topToolBar.add(createButtonUI(), BorderLayout.CENTER); topToolBar.add(createButtonUI(), BorderLayout.CENTER);
topToolBar.setBorder(BorderFactory.createEmptyBorder(-1, -1, -1, -1)); topToolBar.setBorder(BorderFactory.createEmptyBorder(-1, -1, -1, -1));
@ -66,19 +73,14 @@ public class ReportFloatPane extends JPanel {
this.add(leftTopPane, BorderLayout.NORTH); this.add(leftTopPane, BorderLayout.NORTH);
} }
private MenuDef createInsertToolBar() { private void initInsertToolBar() {
MenuDef insertFloatMenu = new MenuDef(true); insertFloatMenu = new MenuDef(true);
insertFloatMenu.setName(KeySetUtils.INSERT_FLOAT.getMenuKeySetName()); insertFloatMenu.setName(KeySetUtils.INSERT_FLOAT.getMenuKeySetName());
insertFloatMenu.setTooltip(Inter.getLocText("FR-Designer_T_Insert_Float")); insertFloatMenu.setTooltip(Inter.getLocText("FR-Designer_T_Insert_Float"));
insertFloatMenu.setIconPath("com/fr/design/images/control/addPopup.png"); insertFloatMenu.setIconPath("com/fr/design/images/control/addPopup.png");
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
elementCasePaneDelegate = (ElementCasePaneDelegate) editingTemplate.getCurrentElementCasePane(); ElementCasePaneDelegate elementCasePaneDelegate = (ElementCasePaneDelegate) editingTemplate.getCurrentElementCasePane();
UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, elementCasePaneDelegate); refreshInsertFloatMenu(elementCasePaneDelegate);
for (int i = 0; i < actions.length; i++) {
insertFloatMenu.addShortCut(actions[i]);
}
return insertFloatMenu;
} }
private UIButton createButtonUI() { 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) { } else if (unitType == Constants.UNIT_INCH) {
this.setText(Inter.getLocText("FR-Designer_Unit_INCH")); this.setText(Inter.getLocText("FR-Designer_Unit_INCH"));
} else { } else {
this.setText(Inter.getLocText("FR-Designer_Unit_MM-mm")); this.setText(Inter.getLocText("FR-Designer_Unit_MM"));
} }
//ajust the heigt of unitLabel. //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() { public UILargeToolbar createLargeToolbar() {
UILargeToolbar largeToolbar = super.createLargeToolbar(); UILargeToolbar largeToolbar = super.createLargeToolbar();
largeToolbar.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 4)); largeToolbar.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 4));
JPanel templeJpanel = new JPanel() { largeToolbar.add(new JPanel() {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize(); Dimension dim = super.getPreferredSize();
dim.width = 1; dim.width = 1;
return dim; return dim;
} }
}; });
templeJpanel.setBackground(Color.WHITE);
largeToolbar.add(templeJpanel);
createRunButton(largeToolbar); createRunButton(largeToolbar);
largeToolbar.add(run); largeToolbar.add(run);
templeJpanel = new JPanel() { run.setBackground(UIConstants.TREE_BACKGROUND);
largeToolbar.add(new JPanel() {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize(); Dimension dim = super.getPreferredSize();
dim.width = GAP; dim.width = GAP;
return dim; return dim;
} }
}; });
templeJpanel.setBackground(Color.WHITE); largeToolbar.addSeparator(new Dimension(2, 42));
largeToolbar.add(templeJpanel);
largeToolbar.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), UIConstants.LINE_COLOR)); largeToolbar.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), UIConstants.LINE_COLOR));
return largeToolbar; 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; private CellBorderStyle border = null;
protected UIObserverListener uiObserverListener; protected UIObserverListener uiObserverListener;
private static final int TOOLTIP_INIT_DELAY = 1000; // 延迟 1s 显示提示文字 private static final int TOOLTIP_INIT_DELAY = 300; // 延迟 0.3s 显示提示文字
public UIButton() { public UIButton() {
this(StringUtils.EMPTY); 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) { public UIHeadGroup(String[] textArray) {
labelButtonList = new ArrayList<UIToggleButton>(textArray.length); labelButtonList = new ArrayList<UIToggleButton>(textArray.length);
this.setBackground(UIConstants.NORMAL_BACKGROUND); this.setBackground(UIConstants.TREE_BACKGROUND);
this.setLayout(new GridLayout(0, textArray.length, 1, 0)); this.setLayout(new GridLayout(0, textArray.length, 0, 0));
// this.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); // this.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
for (int i = 0; i < textArray.length; i++) { for (int i = 0; i < textArray.length; i++) {
final int index = 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 @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (isEnabled() && !isEventBannded) { 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) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
cellHasFocus = cellHasFocus && !this.isEnabled(); cellHasFocus = cellHasFocus && !this.isEnabled();
JLabel renderer =(JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); JLabel renderer =(JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
renderer.setForeground(Color.black); renderer.setOpaque(true);
list.setSelectionBackground(UIConstants.COMBOBOX_BTN_PRESS); list.setSelectionBackground(UIConstants.NORMAL_BLUE);
list.setSelectionForeground(Color.black); 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()); renderer.setText(" " + renderer.getText());
return renderer; return renderer;
} }

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

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

Loading…
Cancel
Save