Browse Source

Merge pull request #1276 in BA/design from ~HZZZ/design:release/9.0 to release/9.0

* commit '66cebb04cb0161bf388be0c61aa0d9ae38bfb9bb':
  tmp
  图标白色
  图标白色
  箭头图标 & tab颜色间距
  预览按钮回退 & 下拉框回退
master
superman 7 years ago
parent
commit
22fa66f036
  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. 14
      designer/src/com/fr/start/Designer.java
  7. 4
      designer_base/src/com/fr/design/gui/ibutton/UIHeadGroup.java
  8. 2
      designer_base/src/com/fr/design/gui/ibutton/UIToggleButton.java
  9. 13
      designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java
  10. BIN
      designer_base/src/com/fr/design/images/buttonicon/leftNormal.png
  11. BIN
      designer_base/src/com/fr/design/images/m_format/cellstyle/bold_white.png
  12. BIN
      designer_base/src/com/fr/design/images/m_format/cellstyle/h_center_normal_white.png
  13. BIN
      designer_base/src/com/fr/design/images/m_format/cellstyle/h_left_normal_white.png
  14. BIN
      designer_base/src/com/fr/design/images/m_format/cellstyle/h_right_normal_white.png
  15. BIN
      designer_base/src/com/fr/design/images/m_format/cellstyle/italic_white.png
  16. BIN
      designer_base/src/com/fr/design/images/m_format/cellstyle/underline_white.png

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})}
); );
} }

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;
} }

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;
} }

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

Loading…
Cancel
Save