Browse Source

Grid线颜色

master
hzzz 7 years ago
parent
commit
67cfaaa9d1
  1. 1
      designer/src/com/fr/design/mainframe/ElementCasePane.java
  2. 71
      designer/src/com/fr/grid/Grid.java
  3. 4
      designer/src/com/fr/grid/GridHeader.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()); grid.setDefaultFloatEditor(Image.class, new ImageFloatEditor());
DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager();
grid.setGridLineColor(designerEnvManager.getGridLineColor());
grid.setPaginationLineColor(designerEnvManager.getPaginationLineColor()); grid.setPaginationLineColor(designerEnvManager.getPaginationLineColor());
} }

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

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

@ -1,5 +1,7 @@
package com.fr.grid; package com.fr.grid;
import com.fr.design.constants.UIConstants;
import java.awt.*; import java.awt.*;
@ -7,7 +9,7 @@ public abstract class GridHeader<T> extends BaseGridComponent {
public final static int SIZE_ADJUST = 4; 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 selectedForeground = Color.black;
private Color selectedBackground = new Color(208, 240, 252); private Color selectedBackground = new Color(208, 240, 252);

Loading…
Cancel
Save