Browse Source

代码格式化

master
MoMeak 7 years ago
parent
commit
9024ca56b8
  1. 24
      designer/src/com/fr/design/mainframe/ReportComponentComposite.java
  2. 55
      designer/src/com/fr/poly/PolyDesigner.java
  3. 14
      designer_base/src/com/fr/design/mainframe/JFormSliderPane.java
  4. 20
      designer_base/src/com/fr/design/mainframe/JSliderPane.java

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

@ -1,17 +1,5 @@
package com.fr.design.mainframe;
import java.awt.BorderLayout;
import java.awt.event.*;
import java.util.ArrayList;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import com.fr.base.FRContext;
import com.fr.base.ScreenResolution;
import com.fr.design.designer.EditingState;
@ -23,9 +11,15 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter;
import com.fr.grid.Grid;
import com.fr.main.impl.WorkBook;
import com.fr.poly.PolyArea;
import com.fr.report.report.TemplateReport;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
/**
* 整个报表编辑区域 包括滚动条中间的grid或者聚合块下面的sheetTab
*
@ -56,7 +50,6 @@ public class ReportComponentComposite extends JComponent {
/**
* Constructor with workbook..
*
*/
public ReportComponentComposite(JWorkBook jwb) {
setFocusable(true);
@ -80,12 +73,14 @@ public class ReportComponentComposite extends JComponent {
public void keyTyped(KeyEvent e) {
}
@Override
public void keyPressed(KeyEvent e) {
if (e.isControlDown()) {
isCtrl = true;
}
}
@Override
public void keyReleased(KeyEvent e) {
isCtrl = false;
@ -169,7 +164,6 @@ public class ReportComponentComposite extends JComponent {
* 移除选中状态
*
* @date 2015-2-5-上午11:41:44
*
*/
public void removeSelection() {
if (centerCardPane.editingComponet instanceof WorkSheetDesigner) {

55
designer/src/com/fr/poly/PolyDesigner.java

@ -3,20 +3,6 @@
*/
package com.fr.poly;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.List;
import javax.swing.AbstractAction;
import javax.swing.ActionMap;
import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
@ -47,11 +33,7 @@ import com.fr.design.utils.gui.LayoutUtils;
import com.fr.general.ComparatorUtils;
import com.fr.grid.selection.Selection;
import com.fr.poly.actions.DeleteBlockAction;
import com.fr.poly.creator.BlockCreator;
import com.fr.poly.creator.BlockEditor;
import com.fr.poly.creator.ECBlockCreator;
import com.fr.poly.creator.ECBlockEditor;
import com.fr.poly.creator.PolyElementCasePane;
import com.fr.poly.creator.*;
import com.fr.poly.hanlder.DataEditingListener;
import com.fr.poly.hanlder.PolyDesignerDropTarget;
import com.fr.poly.model.AddedData;
@ -61,13 +43,21 @@ import com.fr.report.block.Block;
import com.fr.report.poly.PolyWorkSheet;
import com.fr.report.poly.TemplateBlock;
import com.fr.stable.ArrayUtils;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StringUtils;
import com.fr.stable.unit.FU;
import com.fr.stable.unit.OLDPIX;
import com.fr.stable.unit.UNIT;
import com.fr.stable.unit.UnitRectangle;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
/**
* @author richer
* @since 6.5.3 聚合报表的设计块不包括底部和右边的滚动条以及左边和上边的像素标识条
@ -85,6 +75,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
public static enum SelectionType {
NONE, INNER, BLOCK
}
public JComponent polyArea;
private SelectionType selectedtype = SelectionType.NONE;
private AddingData addingData;
@ -171,12 +162,14 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
public void keyTyped(KeyEvent e) {
}
@Override
public void keyPressed(KeyEvent e) {
if (e.isControlDown()) {
isCtrl = true;
}
}
@Override
public void keyReleased(KeyEvent e) {
isCtrl = false;
@ -209,6 +202,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 是否含有聚和报表块
*
* @param targetComponent 目标组件
* @return 是则返回true
*/
@ -249,6 +243,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 增加组件
*
* @param currentEditor 组件
*/
public void addEditor(BlockEditor currentEditor) {
@ -257,6 +252,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 移除组件
*
* @param currentEditor 组件
*/
public void removeEditor(BlockEditor currentEditor) {
@ -265,6 +261,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 权限编辑状态
*
* @return 权限编辑面板
*/
public AuthorityEditPane createAuthorityEditPane() {
@ -300,6 +297,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 增加组件
*
* @param creator 组件
*/
public void addBlockCreator(BlockCreator creator) {
@ -386,6 +384,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 选中的是否是报表块
*
* @return 是则返回true
*/
public boolean isSelectedECBolck() {
@ -410,7 +409,6 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
}
/**
* @return
*/
@ -461,6 +459,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 黏贴
*
* @return 黏贴成功返回true
*/
public boolean paste() {
@ -520,6 +519,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 删除
*
* @return 删除成功返回true
*/
public boolean delete() {
@ -559,6 +559,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 剪切
*
* @return 剪切成功返回true
*/
public boolean cut() {
@ -569,6 +570,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 移动
*
* @param x 横坐标
* @param y 纵坐标
*/
@ -687,6 +689,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 开始编辑
*
* @param blockName 聚合块名称
*/
public void startEditing(String blockName) {
@ -919,6 +922,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 是否选中聚合块本身
*
* @return 是则返回true
*/
public boolean isChooseBlock() {
@ -967,6 +971,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 计算滚动条的值和max
*
* @param oldmax 之前最大值
* @param max 当前最大值
* @param newValue 当前value
@ -983,7 +988,6 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
* 获取当前聚合报表区域左上角x坐标
*
* @return 当前聚合报表区域左上角x坐标
*
*/
public double getAreaLocationX() {
return polyArea.getLocationOnScreen().getX();
@ -993,7 +997,6 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
* 获取当前聚合报表区域左上角y坐标
*
* @return 当前聚合报表区域左上角y坐标
*
*/
public double getAreaLocationY() {
return polyArea.getLocationOnScreen().getY();
@ -1003,9 +1006,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
* 检测指定块是否与其他的块有重叠区域
*
* @param creator 指定的块编辑器
*
* @return 是否与其他的块有重叠区域
*
*/
public boolean intersectsAllBlock(BlockCreator creator) {
return intersectsAllBlock(creator.getValue());
@ -1015,9 +1016,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
* 检测指定块是否与其他的块有重叠区域
*
* @param block 指定的块
*
* @return 是否与其他的块有重叠区域
*
*/
public boolean intersectsAllBlock(TemplateBlock block) {
UnitRectangle rec = block.getBounds();
@ -1030,9 +1029,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
*
* @param rec 指定的块区域
* @param blockName 指定的块名称
*
* @return 是否与其他的块有重叠区域
*
*/
public boolean intersectsAllBlock(UnitRectangle rec, String blockName) {
PolyWorkSheet worksheet = this.getTarget();

14
designer_base/src/com/fr/design/mainframe/JFormSliderPane.java

@ -16,9 +16,11 @@ import javax.swing.*;
import javax.swing.border.MatteBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.basic.BasicSliderUI;
import java.awt.*;
import java.awt.event.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.math.BigDecimal;
/**
@ -197,8 +199,7 @@ public class JFormSliderPane extends JPanel {
//定义一个监听器,用于监听所有滑动条
ChangeListener listener = new ChangeListener()
{
ChangeListener listener = new ChangeListener() {
public void stateChanged(ChangeEvent event) {
//取出滑动条的值,并在文本中显示出来
if (!isButtonOrIsTxt) {
@ -288,7 +289,6 @@ public class JFormSliderPane extends JPanel {
};
private void getTimes(int value) {
if (value == HALF_HUNDRED) {
times = HUNDRED;
@ -326,8 +326,7 @@ public class JFormSliderPane extends JPanel {
}
}
public static void main(String[] args)
{
public static void main(String[] args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
@ -349,6 +348,7 @@ class FormPopupPane extends JPopupMenu {
private static final int UPLABEL_WIDTH = 300;
private JComponent centerPane;
private UILabel upLabel;
FormPopupPane(UIButton b, JPanel dialogContentPanel) {
contentPane = new JPanel(new BorderLayout());
centerPane = new JPanel(new BorderLayout());

20
designer_base/src/com/fr/design/mainframe/JSliderPane.java

@ -18,7 +18,10 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.basic.BasicSliderUI;
import java.awt.*;
import java.awt.event.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.math.BigDecimal;
/**
@ -196,8 +199,7 @@ public class JSliderPane extends JPanel {
//定义一个监听器,用于监听所有滑动条
ChangeListener listener = new ChangeListener()
{
ChangeListener listener = new ChangeListener() {
public void stateChanged(ChangeEvent event) {
//取出滑动条的值,并在文本中显示出来
if (!isButtonOrIsTxt) {
@ -287,7 +289,6 @@ public class JSliderPane extends JPanel {
};
private void getTimes(int value) {
if (value == HALF_HUNDRED) {
times = HUNDRED;
@ -325,8 +326,7 @@ public class JSliderPane extends JPanel {
}
}
public static void main(String[] args)
{
public static void main(String[] args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
@ -362,8 +362,7 @@ class JSliderPaneUI extends BasicSliderUI {
if (slider.getOrientation() == JSlider.VERTICAL) {
size.width = VERTICAL_WIDTH;
size.height = VERTICAL_HEIGHT;
}
else {
} else {
size.width = VERTICAL_WIDTH;
size.height = VERTICAL_HEIGHT;
}
@ -379,8 +378,7 @@ class JSliderPaneUI extends BasicSliderUI {
g.translate(knobBounds.x, knobBounds.y);
if (slider.isEnabled()) {
g.setColor(slider.getBackground());
}
else {
} else {
g.setColor(slider.getBackground().darker());
}
g.setColor(Color.darkGray);
@ -416,6 +414,7 @@ class PopupPane extends JPopupMenu {
private static final int UPLABEL_WIDTH = 300;
private JComponent centerPane;
private UILabel upLabel;
PopupPane(UIButton b, JPanel dialogContentPanel) {
contentPane = new JPanel(new BorderLayout());
centerPane = new JPanel(new BorderLayout());
@ -434,5 +433,4 @@ class PopupPane extends JPopupMenu {
}
}
Loading…
Cancel
Save