Browse Source

Merge pull request #1267 in BA/design from ~HZZZ/design:REPORT-3410 to release/9.0

* commit '963d3e46da65e4f633221502707157ceaf2890df':
  tmp
  数值调整控件按钮颜色
  Grid线颜色
  参数栏标尺颜色
  小洞洞
  新建模板按钮背景色
  toolbar border
master
superman 7 years ago
parent
commit
815fcbdc99
  1. 1
      designer/src/com/fr/design/mainframe/ElementCasePane.java
  2. 59
      designer/src/com/fr/grid/Grid.java
  3. 4
      designer/src/com/fr/grid/GridHeader.java
  4. 3
      designer_base/src/com/fr/design/constants/UIConstants.java
  5. 3
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  6. 2
      designer_base/src/com/fr/design/file/MutilTempalteTabPane.java
  7. 3
      designer_base/src/com/fr/design/file/NewTemplatePane.java
  8. 2
      designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java
  9. 42
      designer_base/src/com/fr/design/gui/ispinner/UISpinner.java
  10. 9
      designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

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

@ -390,7 +390,6 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
grid.setDefaultFloatEditor(Image.class, new ImageFloatEditor());
DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager();
grid.setGridLineColor(designerEnvManager.getGridLineColor());
grid.setPaginationLineColor(designerEnvManager.getPaginationLineColor());
}

59
designer/src/com/fr/grid/Grid.java

@ -10,7 +10,6 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.fun.GridUIProcessor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.templateinfo.TemplateInfoCollector;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.grid.event.CellEditorEvent;
@ -36,7 +35,6 @@ import javax.swing.plaf.ComponentUI;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.geom.Point2D;
import java.util.Date;
import java.util.Hashtable;
import java.util.Iterator;
@ -57,7 +55,7 @@ public class Grid extends BaseGridComponent {
transient private TemplateCellElement editingCellElement;
private boolean showGridLine = true;
private Color gridLineColor = new Color(0xf0f0f3); // line color.
private Color gridLineColor = UIConstants.RULER_LINE_COLOR; // line color.
private boolean isShowPaginateLine = true;
private Color paginationLineColor = Color.RED; // line color of paper
@ -148,9 +146,7 @@ public class Grid extends BaseGridComponent {
/**
* 应用界面设置
*
*
* @date 2014-12-21-下午6:32:43
*
*/
public void updateUI() {
GridUIProcessor localGridUIProcessor = ExtraDesignClassManager.getInstance().getSingle(GridUIProcessor.MARK_STRING, new DefaultGridUIProcessor());
@ -163,10 +159,7 @@ public class Grid extends BaseGridComponent {
* 是否显示格子线
*
* @return 是否显示格子线
*
*
* @date 2014-12-21-下午6:32:13
*
*/
public boolean isShowGridLine() {
return showGridLine;
@ -213,10 +206,7 @@ public class Grid extends BaseGridComponent {
* 是否显示分页线
*
* @return 是否显示分页线
*
*
* @date 2014-12-21-下午6:31:45
*
*/
public boolean isShowPaginateLine() {
return isShowPaginateLine;
@ -256,10 +246,7 @@ public class Grid extends BaseGridComponent {
* 是否显示垂直冻结线
*
* @return 是否显示垂直冻结线
*
*
* @date 2014-12-21-下午6:29:35
*
*/
public boolean isShowVerticalFrozenLine() {
return isShowVerticalFrozenLine;
@ -298,10 +285,7 @@ public class Grid extends BaseGridComponent {
* 是否显示水平冻结线
*
* @return 是否显示水平冻结线
*
*
* @date 2014-12-21-下午6:29:35
*
*/
public boolean isShowHorizontalFrozenLine() {
return isShowHorizontalFrozenLine;
@ -380,10 +364,7 @@ public class Grid extends BaseGridComponent {
* 组件是否可以被编辑
*
* @return 组件是否可以被编辑
*
*
* @date 2014-12-21-下午6:29:09
*
*/
public boolean isEditable() {
return editable;
@ -504,10 +485,7 @@ public class Grid extends BaseGridComponent {
* 是否处于编辑状态
*
* @return 是否处于编辑状态
*
*
* @date 2014-12-21-下午6:28:45
*
*/
public boolean isEditing() {
return this.editorComponent != null;
@ -517,10 +495,7 @@ public class Grid extends BaseGridComponent {
* 当前编辑对象是否为单元格
*
* @return 当前编辑对象是否为单元格
*
*
* @date 2014-12-21-下午6:28:18
*
*/
public boolean isCellEditing() {
return this.isEditing() && cellEditor != null && notShowingTableSelectPane;
@ -537,10 +512,7 @@ public class Grid extends BaseGridComponent {
* 是否处于智能选择单元格阶段
*
* @return 是否处于智能选择单元格阶段
*
*
* @date 2014-12-21-下午6:27:36
*
*/
public boolean IsNotShowingTableSelectPane() {
return this.notShowingTableSelectPane;
@ -550,10 +522,7 @@ public class Grid extends BaseGridComponent {
* 当前是否在编辑悬浮元素
*
* @return 是否在编辑悬浮元素
*
*
* @date 2014-12-21-下午6:26:46
*
*/
public boolean isFloatEditing() {
return this.isEditing() && floatEditor != null;
@ -802,9 +771,7 @@ public class Grid extends BaseGridComponent {
/**
* 开始单元格编辑
*
*
* @date 2014-12-21-下午6:25:17
*
*/
public void startEditing() {
this.startEditing(false);
@ -814,10 +781,7 @@ public class Grid extends BaseGridComponent {
* 开始单元格编辑
*
* @param byKeyEvent 是否为键盘触发
*
*
* @date 2014-12-21-下午6:25:17
*
*/
protected void startEditing(boolean byKeyEvent) {
ElementCasePane reportPane = this.getElementCasePane();
@ -873,12 +837,8 @@ public class Grid extends BaseGridComponent {
* @param row
* @param cellTypeClass 单元格类型
* @param byKeyEvent 是否为键盘触发
*
* @return 编辑是否成功
*
*
* @date 2014-12-21-下午6:25:17
*
*/
public boolean startCellEditingAt_DEC(int column, int row, Class cellTypeClass, boolean byKeyEvent) {
if (this.isEditing()) {
@ -956,9 +916,7 @@ public class Grid extends BaseGridComponent {
/**
* 停止编辑状态
*
*
* @date 2014-12-21-下午6:24:54
*
*/
public void stopEditing() {
// 首先判断是哪种类型的编辑.
@ -1172,9 +1130,7 @@ public class Grid extends BaseGridComponent {
/**
* 取消编辑状态
*
*
* @date 2014-12-21-下午6:24:34
*
*/
public void cancelEditing() {
if (this.isEditing()) {
@ -1186,9 +1142,7 @@ public class Grid extends BaseGridComponent {
/**
* 移除选中组件
*
*
* @date 2014-12-21-下午6:24:16
*
*/
public void removeEditor() {
if (this.isCellEditing()) {
@ -1201,9 +1155,7 @@ public class Grid extends BaseGridComponent {
/**
* 移除单元格组件
*
*
* @date 2014-12-21-下午6:24:00
*
*/
public void removeCellEditor() {
CellEditor cellEditor = getCellEditor();
@ -1235,9 +1187,7 @@ public class Grid extends BaseGridComponent {
/**
* 移除悬浮元素组件
*
*
* @date 2014-12-21-下午6:23:38
*
*/
public void removeFloatEditor() {
FloatEditor floatEditor = getFloatEditor();
@ -1294,10 +1244,7 @@ public class Grid extends BaseGridComponent {
*
* @param evtX x坐标
* @param evtY y坐标
*
*
* @date 2014-12-21-下午6:22:56
*
*/
public void doMousePress(double evtX, double evtY) {
dispatchEvent(new MouseEvent(this, MouseEvent.MOUSE_PRESSED, System.currentTimeMillis(), 0, (int) evtX, (int) evtY, 1, false));
@ -1308,12 +1255,8 @@ public class Grid extends BaseGridComponent {
*
* @param report 当前格子报表
* @param oldRectangle 之前的选中区域
*
* @return 插入的区域
*
*
* @date 2014-12-21-下午6:22:21
*
*/
public Rectangle caculateIntersectsUnion(ElementCase report, Rectangle oldRectangle) {
Rectangle newRectangle = new Rectangle(oldRectangle);

4
designer/src/com/fr/grid/GridHeader.java

@ -1,5 +1,7 @@
package com.fr.grid;
import com.fr.design.constants.UIConstants;
import java.awt.*;
@ -7,7 +9,7 @@ public abstract class GridHeader<T> extends BaseGridComponent {
public final static int SIZE_ADJUST = 4;
//属性
private Color separatorLineColor = new Color(172, 168, 153); //separator lines
private Color separatorLineColor = UIConstants.RULER_LINE_COLOR; //separator lines
private Color selectedForeground = Color.black;
private Color selectedBackground = new Color(208, 240, 252);

3
designer_base/src/com/fr/design/constants/UIConstants.java

@ -64,6 +64,7 @@ public interface UIConstants {
Constants.LINE_MEDIUM_DASH_DOT_DOT, //medium dash-dot-dot border
Constants.LINE_SLANTED_DASH_DOT, //slanted dash-dot border
};
public static final Color TOOLBAR_BORDER_COLOR = new Color(0xD9DADD);
public static final Color COMBOBOX_BTN_NORMAL = new Color(0xD9DADD);
public static final Color COMBOBOX_BTN_ROLLOVER = new Color(0xC8C9CD);
public static final Color COMBOBOX_BTN_PRESS = new Color(0xD8F2FD);
@ -102,7 +103,7 @@ public interface UIConstants {
public static final Color SELECTED_BACKGROUND = new Color(0xdeedfe);
public static final Color SELECTED_BORDER_LINE_COLOR = new Color(0x3384f0);
public static final Color DEFAULT_BG_RULER = new Color(0xffffff);
public static final Color RULER_LINE_COLOR = new Color(0xababab);
public static final Color RULER_LINE_COLOR = new Color(0xD9DADD);
public static final Color RULER_SCALE_COLOR = new Color(0x4e504f);
public static final Color PROPERTY_PANE_BACKGROUND = new Color(0xdadadd);
public static final Color SPLIT_LINE = new Color(201, 198, 184);

3
designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java

@ -6,6 +6,7 @@ import com.fr.data.TableDataSource;
import com.fr.design.DesignModelAdapter;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.BasicTableDataTreePane;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.tabledata.StoreProcedureWorkerListener;
@ -111,6 +112,8 @@ public class TableDataTreePane extends BasicTableDataTreePane {
ToolBarDef toolbarDef = new ToolBarDef();
toolbarDef.addShortCut(addMenuDef, SeparatorDef.DEFAULT, editAction, removeAction, SeparatorDef.DEFAULT, previewTableDataAction, connectionTableAction);
UIToolbar toolBar = ToolBarDef.createJToolBar();
toolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR));
toolBar.setBorderPainted(true);
toolbarDef.updateToolBar(toolBar);
JPanel toolbarPane = FRGUIPaneFactory.createBorderLayout_S_Pane();

2
designer_base/src/com/fr/design/file/MutilTempalteTabPane.java

@ -373,7 +373,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
private void paintDefaultBackground(Graphics2D g2d) {
//画默认背景
g2d.setPaint(new GradientPaint(1, 1, new Color(217, 218, 221), 1, getHeight() - 1, new Color(217, 218, 221)));
g2d.fillRect(getX(), getY(), getWidth(), getHeight());
g2d.fillRect(0, 0, getWidth(), getHeight());
}

3
designer_base/src/com/fr/design/file/NewTemplatePane.java

@ -10,6 +10,7 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
/**
* Author : daisy
@ -45,6 +46,8 @@ public abstract class NewTemplatePane extends JComponent implements MouseListene
public void paintComponent(Graphics g) {
super.paintComponent(g);
g2d = (Graphics2D) g;
g2d.setColor(UIConstants.COMBOBOX_BTN_NORMAL);
g2d.fill(new Rectangle2D.Double(0, 0, getWidth(),getHeight()));
int sheetIconY = (getHeight() - newWorkBookIconMode.getIconHeight()) / 2;
newWorkBookIconMode.paintIcon(this, g2d, newIconStartX, sheetIconY);
// paintUnderLine(g2d);

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

@ -160,7 +160,7 @@ public class UIButtonUI extends BasicButtonUI {
paintModelIcon(model, icon, g, c);
}
private void paintModelIcon(ButtonModel model, Icon icon, Graphics g, JComponent c) {
protected void paintModelIcon(ButtonModel model, Icon icon, Graphics g, JComponent c) {
if (model.isPressed() && model.isArmed()) {
icon.paintIcon(c, g, iconRec.x + getTextShiftOffset(),
iconRec.y + getTextShiftOffset());

42
designer_base/src/com/fr/design/gui/ispinner/UISpinner.java

@ -6,8 +6,9 @@ import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
@ -16,6 +17,7 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.plaf.ButtonUI;
import java.awt.*;
import java.awt.event.*;
@ -164,6 +166,34 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
}
}
private class ButtionUI extends UIButtonUI {
private boolean isNormalPaint = true;
@Override
protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) {
if (isPressed(b) && b.isPressedPainted()) {
isNormalPaint = false;
Color pressColor = UIConstants.COMBOBOX_BTN_PRESS;
GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), pressColor);
} else if (isRollOver(b)) {
isNormalPaint = false;
Color hoverColor = UIConstants.COMBOBOX_BTN_ROLLOVER;
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), hoverColor);
} else if (b.isNormalPainted()) {
isNormalPaint = true;
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
}
}
@Override
protected void paintModelIcon(ButtonModel model, Icon icon, Graphics g, JComponent c) {
if (isNormalPaint) {
g.setColor(UIConstants.COMBOBOX_BTN_NORMAL);
g.fillRect(0, 0, c.getWidth(), c.getHeight());
}
super.paintModelIcon(model, icon, g, c);
}
}
private void initComponents() {
textField = initNumberField();
@ -174,12 +204,22 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
public boolean shouldResponseChangeListener() {
return false;
}
@Override
public ButtonUI getUI() {
return new ButtionUI();
}
};
preButton.setRoundBorder(true, Constants.LEFT);
nextButton = new UIButton(UIConstants.ARROW_DOWN_ICON) {
public boolean shouldResponseChangeListener() {
return false;
}
@Override
public ButtonUI getUI() {
return new ButtionUI();
}
};
nextButton.setRoundBorder(true, Constants.LEFT);
setLayout(new BorderLayout());

9
designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -79,10 +79,13 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
private DesignerFrameFileDealerPane() {
setLayout(new BorderLayout());
toolBar = ToolBarDef.createJToolBar();
toolBar.setBorder(BorderFactory.createEmptyBorder(3, 0, 4, 0));
toolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR));
toolBar.setBorderPainted(true);
JPanel tooBarPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
tooBarPane.add(toolBar, BorderLayout.CENTER);
JPanel parent = new JPanel(new BorderLayout());
parent.add(toolBar, BorderLayout.CENTER);
parent.setBorder(BorderFactory.createEmptyBorder(3, 0, 4, 0));
tooBarPane.add(parent, BorderLayout.CENTER);
tooBarPane.add(new UIMenuHighLight(), BorderLayout.SOUTH);
add(tooBarPane, BorderLayout.NORTH);

Loading…
Cancel
Save