Browse Source

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

master
plough 7 years ago
parent
commit
b986cf0385
  1. 5
      designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java
  2. 2
      designer/src/com/fr/poly/PolyDesignUI.java
  3. 3
      designer/src/com/fr/poly/PolyDesigner.java
  4. 9
      designer/src/com/fr/poly/PolyUtils.java
  5. 8
      designer/src/com/fr/poly/creator/ECBlockCreator.java
  6. 2
      designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java
  7. 2
      designer/src/com/fr/quickeditor/CellQuickEditor.java
  8. 66
      designer/src/com/fr/start/ReportSplashPane.java
  9. 3
      designer_base/src/com/fr/design/constants/UIConstants.java
  10. 17
      designer_base/src/com/fr/design/foldablepane/HeaderPane.java
  11. 3
      designer_base/src/com/fr/design/gui/UILookAndFeel.java
  12. 2
      designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java
  13. 25
      designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java
  14. 2
      designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java
  15. 51
      designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java
  16. 4
      designer_base/src/com/fr/design/gui/itoolbar/UIToolBarUI.java
  17. 14
      designer_base/src/com/fr/design/utils/gui/GUIPaintUtils.java
  18. 116
      designer_base/src/com/fr/design/widget/component/UIComboBoxNoArrow.java
  19. 10
      designer_base/src/com/fr/start/SplashPane.java
  20. 2
      designer_base/src/com/fr/start/SplashWindow.java
  21. 8
      designer_form/src/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java
  22. 11
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  23. 5
      designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java

5
designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java

@ -10,6 +10,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.DateValuePane; import com.fr.design.widget.component.DateValuePane;
import com.fr.design.widget.component.UIComboBoxNoArrow;
import com.fr.form.ui.DateEditor; import com.fr.form.ui.DateEditor;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -92,8 +93,8 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private JPanel createFormatHead(){ private JPanel createFormatHead(){
String[] dateArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.DATE); String[] dateArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.DATE);
String[] timeArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.TIME); String[] timeArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.TIME);
final UIComboBox dateFormatComboBox = new UIComboBox(dateArray); final UIComboBox dateFormatComboBox = new UIComboBoxNoArrow(dateArray);
final UIComboBox timeFormatComboBox = new UIComboBox(timeArray); final UIComboBox timeFormatComboBox = new UIComboBoxNoArrow(timeArray);
dateFormatComboBox.addActionListener(new ActionListener(){ dateFormatComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){ public void actionPerformed(ActionEvent e){
refreshPreviewLabel(); refreshPreviewLabel();

2
designer/src/com/fr/poly/PolyDesignUI.java

@ -106,7 +106,7 @@ public class PolyDesignUI extends ComponentUI {
BlockCreator creator = addedData.getAddedAt(i); BlockCreator creator = addedData.getAddedAt(i);
// richer:如果当前这个组件正在编辑,那么他是完全被他的编辑器所遮挡的,不需要画出来 // richer:如果当前这个组件正在编辑,那么他是完全被他的编辑器所遮挡的,不需要画出来
if (creator == designer.getSelection()) { if (creator == designer.getSelection()) {
paintPositionLine(g, Math.round(creator.getX() * time), Math.round(creator.getY() * time), paintPositionLine(g, Math.round(creator.getX(time)), Math.round(creator.getY(time)),
Math.round(designer.getHorizontalValue()*time), Math.round(designer.getVerticalValue()*time)); Math.round(designer.getHorizontalValue()*time), Math.round(designer.getVerticalValue()*time));
if (creator.getEditor().isDragging()) { if (creator.getEditor().isDragging()) {
creator.getEditor().paintAbsorptionline(g); creator.getEditor().paintAbsorptionline(g);

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

@ -272,7 +272,6 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
this.time = (float) resolution / ScreenResolution.getScreenResolution(); this.time = (float) resolution / ScreenResolution.getScreenResolution();
resetEditorComponentBounds(); resetEditorComponentBounds();
LayoutUtils.layoutRootContainer(this);
g.setColor(Color.black); g.setColor(Color.black);
GraphHelper.drawLine(g, 0, 0, this.getWidth(), 0); GraphHelper.drawLine(g, 0, 0, this.getWidth(), 0);
GraphHelper.drawLine(g, 0, 0, 0, this.getHeight()); GraphHelper.drawLine(g, 0, 0, 0, this.getHeight());
@ -281,7 +280,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
private void resetEditorComponentBounds() { private void resetEditorComponentBounds() {
if (selection != null) { if (selection != null) {
selection.setResolution(this.resolution); selection.setResolution(ScreenResolution.getScreenResolution());
selection.getEditor().setBounds((int) (selection.getEditorBounds().x * time), (int) (selection.getEditorBounds().y * time), selection.getEditor().setBounds((int) (selection.getEditorBounds().x * time), (int) (selection.getEditorBounds().y * time),
(int) (selection.getEditorBounds().width * time), (int) (selection.getEditorBounds().height * time)); (int) (selection.getEditorBounds().width * time), (int) (selection.getEditorBounds().height * time));
LayoutUtils.layoutRootContainer(this); LayoutUtils.layoutRootContainer(this);

9
designer/src/com/fr/poly/PolyUtils.java

@ -115,10 +115,11 @@ public class PolyUtils {
AddedData addedData = designer.getAddedData(); AddedData addedData = designer.getAddedData();
for (int count = addedData.getAddedCount() - 1; count >= 0; count--) { for (int count = addedData.getAddedCount() - 1; count >= 0; count--) {
BlockCreator creator = addedData.getAddedAt(count); BlockCreator creator = addedData.getAddedAt(count);
int cx = creator.getX(); float times = (float) designer.getResolution()/ScreenResolution.getScreenResolution();
int cy = creator.getY(); int cx = (int) (creator.getX() * times);
int cw = creator.getWidth(); int cy = (int) (creator.getY() * times);
int ch = creator.getHeight(); int cw = (int) (creator.getWidth() * times);
int ch = (int) (creator.getHeight() * times);
if (x >= cx && x <= (cx + cw)) { if (x >= cx && x <= (cx + cw)) {
if(y >= cy && y <= (cy + ch)) { if(y >= cy && y <= (cy + ch)) {
return creator; return creator;

8
designer/src/com/fr/poly/creator/ECBlockCreator.java

@ -23,8 +23,8 @@ import com.fr.stable.unit.UnitRectangle;
*/ */
public class ECBlockCreator extends BlockCreator<PolyECBlock> { public class ECBlockCreator extends BlockCreator<PolyECBlock> {
private ECBlockEditor editor; private ECBlockEditor editor;
private static final int CREATOR_WIDTH = 30; private static final int CREATOR_WIDTH = 20;
private static final int CREATOR_HEIGHT = 19; private static final int CREATOR_HEIGHT = 9;
public ECBlockCreator() { public ECBlockCreator() {
@ -69,12 +69,12 @@ public class ECBlockCreator extends BlockCreator<PolyECBlock> {
@Override @Override
public int getX(float time) { public int getX(float time) {
return (int) ((this.getX() - CREATOR_WIDTH) * time) + CREATOR_WIDTH; return Math.round ((this.getX() - CREATOR_WIDTH) * time) + CREATOR_WIDTH;
} }
@Override @Override
public int getY(float time) { public int getY(float time) {
return (int) ((this.getY() - CREATOR_HEIGHT) * time) + CREATOR_HEIGHT; return Math.round ((this.getY() - CREATOR_HEIGHT) * time) + CREATOR_HEIGHT;
} }
/** /**

2
designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java

@ -15,6 +15,7 @@ import com.fr.design.beans.location.Absorptionline;
import com.fr.design.beans.location.MoveUtils; import com.fr.design.beans.location.MoveUtils;
import com.fr.design.beans.location.MoveUtils.RectangleDesigner; import com.fr.design.beans.location.MoveUtils.RectangleDesigner;
import com.fr.design.beans.location.MoveUtils.RectangleIterator; import com.fr.design.beans.location.MoveUtils.RectangleIterator;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.poly.PolyDesigner; import com.fr.poly.PolyDesigner;
import com.fr.poly.PolyDesigner.SelectionType; import com.fr.poly.PolyDesigner.SelectionType;
@ -101,6 +102,7 @@ public class BottomCornerMouseHanlder extends MouseInputAdapter {
dragStart.y -= pressed.y; dragStart.y -= pressed.y;
TemplateBlock block = editor.getValue(); TemplateBlock block = editor.getValue();
resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution();
Rectangle bounds = block.getBounds().toRectangle(resolution); Rectangle bounds = block.getBounds().toRectangle(resolution);
Point resultPoint = MoveUtils.sorption(bounds.x + dragStart.x < 0 ? 0 : bounds.x + dragStart.x, bounds.y Point resultPoint = MoveUtils.sorption(bounds.x + dragStart.x < 0 ? 0 : bounds.x + dragStart.x, bounds.y
+ dragStart.y < 0 ? 0 : bounds.y + dragStart.y, bounds.width, bounds.height, rectDesigner, false); + dragStart.y < 0 ? 0 : bounds.y + dragStart.y, bounds.width, bounds.height, rectDesigner, false);

2
designer/src/com/fr/quickeditor/CellQuickEditor.java

@ -235,6 +235,8 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
cellInsertActions = ActionFactory.createCellInsertAction(ElementCasePane.class, tc); cellInsertActions = ActionFactory.createCellInsertAction(ElementCasePane.class, tc);
selectedIndex = comboBox.getSelectedIndex(); selectedIndex = comboBox.getSelectedIndex();
comboBox.setPopupVisible(false);
comboBox.repaint();
cellInsertActions[selectedIndex].actionPerformed(e); cellInsertActions[selectedIndex].actionPerformed(e);
comboBox.setSelectedIndex(currentSelectedIndex); comboBox.setSelectedIndex(currentSelectedIndex);
} }

66
designer/src/com/fr/start/ReportSplashPane.java

@ -1,8 +1,7 @@
/**
*
*/
package com.fr.start; package com.fr.start;
import com.bulenkov.iconloader.IconLoader;
import com.bulenkov.iconloader.util.JBUI;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
@ -10,8 +9,6 @@ import com.fr.design.mainframe.bbs.BBSConstants;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.ModuleContext; import com.fr.general.ModuleContext;
import com.fr.stable.Constants;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.module.ModuleAdapter; import com.fr.stable.module.ModuleAdapter;
@ -19,9 +16,6 @@ import com.fr.stable.module.ModuleListener;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.font.FontRenderContext;
import java.awt.font.LineMetrics;
import java.awt.image.BufferedImage;
import java.util.Locale; import java.util.Locale;
import java.util.Random; import java.util.Random;
import java.util.TimerTask; import java.util.TimerTask;
@ -36,12 +30,14 @@ public class ReportSplashPane extends SplashPane {
private static final String SPLASH_MAC_CN = "splash_chinese_mac.png"; private static final String SPLASH_MAC_CN = "splash_chinese_mac.png";
private static final String SPLASH_MAC_EN = "splash_english_mac.png"; private static final String SPLASH_MAC_EN = "splash_english_mac.png";
private static final Color MODULE_COLOR = new Color(230, 230, 230); private static float JBUI_INIT_SCALE = JBUI.scale(1f);
private static final int MODULE_INFO_X = 25;
private static final int MODULE_INFO_Y = 270;
private static final Color THANK_COLOR = new Color(72, 216, 249); private static final Color MODULE_COLOR = new Color(255, 255, 255);
private static final int THANK_INFO_X = 460; private static final int MODULE_INFO_X = uiScale(54);
private static final int MODULE_INFO_Y = uiScale(340);
private static final Color THANK_COLOR = new Color(255, 255, 255, (int) (0.4 * 255 + 0.5));
private static final int THANK_INFO_Y = uiScale(382);
private static final String GUEST = getRandomUser(); private static final String GUEST = getRandomUser();
@ -52,6 +48,14 @@ public class ReportSplashPane extends SplashPane {
private String[] loading = new String[]{"..", "....", "......"}; private String[] loading = new String[]{"..", "....", "......"};
private java.util.Timer timer = new java.util.Timer(); private java.util.Timer timer = new java.util.Timer();
private static float uiScale(float f) {
return f * JBUI_INIT_SCALE;
}
private static int uiScale(int i) {
return (int) (i * JBUI_INIT_SCALE);
}
public ReportSplashPane() { public ReportSplashPane() {
init(); init();
} }
@ -80,52 +84,34 @@ public class ReportSplashPane extends SplashPane {
} }
protected void paintComponent(Graphics g) { protected void paintComponent(Graphics g) {
super.paintComponent(g); Icon icon = IconLoader.getIcon(StableUtils.pathJoin(OEM_PATH, getImageName()));
Graphics2D g2d = (Graphics2D) g; icon.paintIcon(null, g, 0, 0);
Image image = getSplashImage(); paintShowText((Graphics2D) g);
ImageIcon imageIcon = new ImageIcon(image);
GraphHelper.paintImage(g2d, imageIcon.getIconWidth(), imageIcon.getIconHeight(), image, Constants.IMAGE_DEFAULT, Constants.NULL, Constants.CENTER, -1, -1);
} }
public void setShowText(String text) { public void setShowText(String text) {
this.showText = text; this.showText = text;
} }
public BufferedImage getSplashImage() { public Image getSplashImage() {
// p:初始化splashImage,其中画了字符. Icon icon = IconLoader.getIcon(StableUtils.pathJoin(OEM_PATH, getImageName()));
Image image = createSplashBackground(); return ((ImageIcon) IconLoader.getIconSnapshot(icon)).getImage();
BufferedImage splashBuffedImage = CoreGraphHelper.toBufferedImage(image);
Graphics2D splashG2d = splashBuffedImage.createGraphics();
splashG2d.setPaint(new Color(230, 230, 230));
splashG2d.setFont(new Font("Dialog", Font.PLAIN, 11));
//绘制需要显示的文本
paintShowText(splashG2d);
return splashBuffedImage;
} }
private void paintShowText(Graphics2D splashG2d) { private void paintShowText(Graphics2D splashG2d) {
FontRenderContext fontRenderContext = splashG2d.getFontRenderContext(); GraphHelper.applyRenderingHints(splashG2d);
LineMetrics fm = splashG2d.getFont().getLineMetrics("",
fontRenderContext);
double leading = fm.getLeading();
double ascent = fm.getAscent();
double height = fm.getHeight();
splashG2d.setPaint(MODULE_COLOR); splashG2d.setPaint(MODULE_COLOR);
splashG2d.setFont(new Font("Dialog", Font.PLAIN, 12)); splashG2d.setFont(new Font("Dialog", Font.PLAIN, 12));
//加载模块信息 //加载模块信息
double y = MODULE_INFO_Y + height + leading + ascent; GraphHelper.drawString(splashG2d, showText, MODULE_INFO_X, MODULE_INFO_Y);
GraphHelper.drawString(splashG2d, showText, MODULE_INFO_X, y);
//每次随机感谢一位论坛用户 //每次随机感谢一位论坛用户
if (shouldShowThanks()) { if (shouldShowThanks()) {
splashG2d.setPaint(THANK_COLOR); splashG2d.setPaint(THANK_COLOR);
String content = Inter.getLocText("FR-Designer_Thanks-To") + GUEST; String content = Inter.getLocText("FR-Designer_Thanks-To") + GUEST;
GraphHelper.drawString(splashG2d, content, THANK_INFO_X, y); GraphHelper.drawString(splashG2d, content, MODULE_INFO_X, THANK_INFO_Y);
} }
} }

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

@ -64,6 +64,9 @@ public interface UIConstants {
Constants.LINE_MEDIUM_DASH_DOT_DOT, //medium dash-dot-dot border Constants.LINE_MEDIUM_DASH_DOT_DOT, //medium dash-dot-dot border
Constants.LINE_SLANTED_DASH_DOT, //slanted dash-dot border Constants.LINE_SLANTED_DASH_DOT, //slanted dash-dot border
}; };
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);
public static final Color LINE_COLOR = new Color(153, 153, 153); public static final Color LINE_COLOR = new Color(153, 153, 153);
public static final Color FONT_COLOR = new Color(51, 51, 51); public static final Color FONT_COLOR = new Color(51, 51, 51);
public static final Color LIGHT_BLUE = new Color(182, 217, 253); public static final Color LIGHT_BLUE = new Color(182, 217, 253);

17
designer_base/src/com/fr/design/foldablepane/HeaderPane.java

@ -1,5 +1,6 @@
package com.fr.design.foldablepane; package com.fr.design.foldablepane;
import com.fr.base.GraphHelper;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxUtilities; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxUtilities;
@ -53,6 +54,7 @@ public class HeaderPane extends JPanel {
RenderingHints.VALUE_ANTIALIAS_ON); RenderingHints.VALUE_ANTIALIAS_ON);
BufferedImage panelImage = createPanelImage(); BufferedImage panelImage = createPanelImage();
g2d.drawImage(panelImage, null, 0, 0); g2d.drawImage(panelImage, null, 0, 0);
GraphHelper.drawString(g2d, this.title, TITLE_X, headHeight - fontSize / 2 - 1);
} }
private BufferedImage createPanelImage() { private BufferedImage createPanelImage() {
@ -67,7 +69,6 @@ public class HeaderPane extends JPanel {
if (desktopHints != null) { if (desktopHints != null) {
g2d.setRenderingHints(desktopHints); g2d.setRenderingHints(desktopHints);
} }
g2d.drawString(this.title, TITLE_X, headHeight - fontSize / 2 - 1);
int leftWdith = headWidth - LEFT_X; int leftWdith = headWidth - LEFT_X;
if (this.isShow) { if (this.isShow) {
image = UIConstants.DRAG_DOWN_SELECTED_SMALL; image = UIConstants.DRAG_DOWN_SELECTED_SMALL;
@ -103,13 +104,13 @@ public class HeaderPane extends JPanel {
} }
public static void main(String[] args) { public static void main(String[] args) {
// JFrame mainFrame = new JFrame("UI Demo - Gloomyfish"); JFrame mainFrame = new JFrame("UI Demo - Gloomyfish");
// mainFrame.getContentPane().setLayout(new BorderLayout()); mainFrame.getContentPane().setLayout(new BorderLayout());
// mainFrame.getContentPane().add(new HeaderPane(Color.black, "基本", 24), BorderLayout.CENTER); mainFrame.getContentPane().add(new HeaderPane(Color.black, "基本", 24), BorderLayout.CENTER);
// mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// mainFrame.pack(); mainFrame.pack();
// mainFrame.setSize(300, 400); mainFrame.setSize(300, 400);
// mainFrame.setVisible(true); mainFrame.setVisible(true);
} }
} }

3
designer_base/src/com/fr/design/gui/UILookAndFeel.java

@ -1,6 +1,5 @@
package com.fr.design.gui; package com.fr.design.gui;
import com.fr.base.BaseUtils;
import com.fr.design.gui.borders.*; import com.fr.design.gui.borders.*;
import com.fr.design.gui.frpane.UIBasicOptionPaneUI; import com.fr.design.gui.frpane.UIBasicOptionPaneUI;
import com.fr.design.gui.ibutton.UIBasicButtonUI; import com.fr.design.gui.ibutton.UIBasicButtonUI;
@ -110,8 +109,6 @@ public class UILookAndFeel extends MetalLookAndFeel {
table.put("RadioButtonMenuItem.border", border); table.put("RadioButtonMenuItem.border", border);
table.put("ToolTip.border", new BorderUIResource(new UIToolTipBorder(true))); table.put("ToolTip.border", new BorderUIResource(new UIToolTipBorder(true)));
table.put("ToolTip.borderInactive", new BorderUIResource(new UIToolTipBorder(false))); table.put("ToolTip.borderInactive", new BorderUIResource(new UIToolTipBorder(false)));
table.put("Tree.expandedIcon", BaseUtils.readIcon("/com/fr/design/images/tree/open.png"));
table.put("Tree.collapsedIcon", BaseUtils.readIcon("/com/fr/design/images/tree/close.png"));
table.put("PopupMenu.border", new UIPopupMenuBorder()); table.put("PopupMenu.border", new UIPopupMenuBorder());
table.put("PopupMenu.foreground", new ColorUIResource(255, 0, 0)); table.put("PopupMenu.foreground", new ColorUIResource(255, 0, 0));
table.put("SplitPane.dividerSize", new Integer(7)); table.put("SplitPane.dividerSize", new Integer(7));

2
designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java

@ -6,6 +6,7 @@ import com.fr.base.chart.BasePlot;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane; import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane; import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane; import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane;
@ -87,6 +88,7 @@ public abstract class UIListControlPane extends UIControlPane {
protected void initLeftPane(JPanel leftPane) { protected void initLeftPane(JPanel leftPane) {
nameableList = createJNameList(); nameableList = createJNameList();
nameableList.setName(LIST_NAME); nameableList.setName(LIST_NAME);
nameableList.setSelectionBackground(UIConstants.ATTRIBUTE_PRESS);
leftPane.add(new UIScrollPane(nameableList), BorderLayout.CENTER); leftPane.add(new UIScrollPane(nameableList), BorderLayout.CENTER);

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

@ -1,27 +1,16 @@
package com.fr.design.gui.ibutton; package com.fr.design.gui.ibutton;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import javax.swing.plaf.basic.BasicButtonUI;
import javax.swing.plaf.basic.BasicHTML;
import javax.swing.text.View;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.StringUtils;
import sun.swing.SwingUtilities2; import sun.swing.SwingUtilities2;
import com.fr.stable.StringUtils; import javax.swing.*;
import com.fr.design.utils.gui.GUIPaintUtils; import javax.swing.plaf.basic.BasicButtonUI;
import javax.swing.plaf.basic.BasicHTML;
import javax.swing.text.View;
import java.awt.*;
public class UIButtonUI extends BasicButtonUI { public class UIButtonUI extends BasicButtonUI {

2
designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java

@ -27,7 +27,7 @@ public class UIComboBoxRenderer extends DefaultListCellRenderer {
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.setForeground(Color.black);
list.setSelectionBackground(UIConstants.FLESH_BLUE); list.setSelectionBackground(UIConstants.COMBOBOX_BTN_PRESS);
list.setSelectionForeground(Color.black); list.setSelectionForeground(Color.black);
renderer.setText(" " + renderer.getText()); renderer.setText(" " + renderer.getText());
return renderer; return renderer;

51
designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java

@ -1,29 +1,23 @@
package com.fr.design.gui.icombobox; package com.fr.design.gui.icombobox;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.*;
import javax.swing.plaf.basic.BasicComboBoxUI;
import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.basic.ComboPopup;
import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import sun.swing.DefaultLookup;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import sun.swing.DefaultLookup;
import javax.swing.*;
import javax.swing.plaf.ButtonUI;
import javax.swing.plaf.basic.BasicComboBoxUI;
import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
@ -46,6 +40,27 @@ public class UIComboBoxUI extends BasicComboBoxUI implements MouseListener {
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return false; return false;
} }
@Override
public ButtonUI getUI() {
return new UIButtonUI() {
@Override
protected boolean isPressed(AbstractButton b) {
return model.isArmed() && model.isPressed();
}
@Override
protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) {
if (isPressed(b) && b.isPressedPainted()) {
GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), UIConstants.COMBOBOX_BTN_PRESS);
} else if (isRollOver(b)) {
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.COMBOBOX_BTN_ROLLOVER);
} else if (b.isNormalPainted()) {
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.COMBOBOX_BTN_NORMAL);
}
}
};
}
}; };
((UIButton) arrowButton).setRoundBorder(true, Constants.LEFT); ((UIButton) arrowButton).setRoundBorder(true, Constants.LEFT);
arrowButton.addMouseListener(this); arrowButton.addMouseListener(this);

4
designer_base/src/com/fr/design/gui/itoolbar/UIToolBarUI.java

@ -25,6 +25,8 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIToolButtonBorder; import com.fr.design.gui.ibutton.UIToolButtonBorder;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import static com.fr.design.utils.ThemeUtils.BACK_COLOR;
public class UIToolBarUI extends MetalToolBarUI { public class UIToolBarUI extends MetalToolBarUI {
public static final String IS_TOOL_BAR_BUTTON_KEY = "JToolBar.isToolbarButton"; public static final String IS_TOOL_BAR_BUTTON_KEY = "JToolBar.isToolbarButton";
public static final int FLOATABLE_GRIP_SIZE = 8; public static final int FLOATABLE_GRIP_SIZE = 8;
@ -89,7 +91,7 @@ public class UIToolBarUI extends MetalToolBarUI {
*/ */
public void paint(Graphics g, JComponent c) { public void paint(Graphics g, JComponent c) {
Graphics2D g2 = (Graphics2D) g; Graphics2D g2 = (Graphics2D) g;
g2.setColor(UIConstants.TOOLBARUI_BACKGROUND); g2.setColor(BACK_COLOR);
g2.fillRect(0, 0, c.getWidth(), c.getHeight()); g2.fillRect(0, 0, c.getWidth(), c.getHeight());
} }

14
designer_base/src/com/fr/design/utils/gui/GUIPaintUtils.java

@ -49,6 +49,7 @@ public class GUIPaintUtils {
/** /**
* 正常状态填充 * 正常状态填充
*
* @param g2d 图形对象 * @param g2d 图形对象
* @param x x坐标 * @param x x坐标
* @param y y坐标 * @param y y坐标
@ -60,12 +61,16 @@ public class GUIPaintUtils {
* @param isPressedPainted 是否按压画 * @param isPressedPainted 是否按压画
*/ */
public static final void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) { public static final void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) {
fillNormal(g2d, x, y, width, height, isRound, rectDirection, isAuthorityEdited, isPressedPainted, UIConstants.ATTRIBUTE_NORMAL);
}
public static final void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted, Color color) {
GradientPaint gp; GradientPaint gp;
if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) { if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.AUTHORITY_DARK_BLUE); gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.AUTHORITY_DARK_BLUE);
} else if (isPressedPainted) { } else if (isPressedPainted) {
gp = new GradientPaint(1, 1, UIConstants.ATTRIBUTE_NORMAL, 1, height - 1, UIConstants.ATTRIBUTE_NORMAL); gp = new GradientPaint(1, 1, color, 1, height - 1, color);
}else{ } else {
gp = new GradientPaint(1, 1, UIConstants.SHADOW_GREY, 1, height - 1, UIConstants.SHADOW_GREY); gp = new GradientPaint(1, 1, UIConstants.SHADOW_GREY, 1, height - 1, UIConstants.SHADOW_GREY);
} }
@ -74,6 +79,7 @@ public class GUIPaintUtils {
/** /**
* 鼠标悬停状态填充 * 鼠标悬停状态填充
*
* @param g2d 图形对象 * @param g2d 图形对象
* @param x x坐标 * @param x x坐标
* @param y y坐标 * @param y y坐标
@ -104,6 +110,7 @@ public class GUIPaintUtils {
/** /**
* 按压状态填充 * 按压状态填充
*
* @param g2d 图形对象 * @param g2d 图形对象
* @param x x坐标 * @param x x坐标
* @param y y坐标 * @param y y坐标
@ -112,7 +119,6 @@ public class GUIPaintUtils {
* @param isRound 是否圆角 * @param isRound 是否圆角
* @param rectDirection 矩形方向 * @param rectDirection 矩形方向
* @param isAuthorityEdited 是否权限编辑 * @param isAuthorityEdited 是否权限编辑
*
*/ */
public static final void fillPressed(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited) { public static final void fillPressed(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited) {
fillPressed(g2d, x, y, width, height, isRound, rectDirection, isAuthorityEdited, null); fillPressed(g2d, x, y, width, height, isRound, rectDirection, isAuthorityEdited, null);
@ -147,8 +153,10 @@ public class GUIPaintUtils {
g2d.setColor(oldColor); g2d.setColor(oldColor);
} }
/** /**
* 自定义画笔填充 * 自定义画笔填充
*
* @param g2d 图形对象 * @param g2d 图形对象
* @param x x坐标 * @param x x坐标
* @param y y坐标 * @param y y坐标

116
designer_base/src/com/fr/design/widget/component/UIComboBoxNoArrow.java

@ -0,0 +1,116 @@
package com.fr.design.widget.component;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxEditor;
import com.fr.stable.StringUtils;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.plaf.basic.BasicComboBoxUI;
import java.awt.*;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
/**
* Created by kerry on 2017/9/14.
*/
public class UIComboBoxNoArrow extends UIComboBox {
public UIComboBoxNoArrow(Object[] items) {
super(items);
init();
}
public UIComboBoxNoArrow() {
}
public void init() {
this.setEditable(true);
this.setEditor(new ComboBoxNoArrowEditor(this));
this.setUI(new ComboBoxNoArrowUI());
}
public class ComboBoxNoArrowUI extends BasicComboBoxUI {
@Override
protected UIButton createArrowButton() {
arrowButton = new UIButton(UIConstants.ARROW_DOWN_ICON) {
@Override
public boolean shouldResponseChangeListener() {
return false;
}
@Override
public Insets getInsets() {
return new Insets(0, 0, 0, 0);
}
};
squareButton = false;
arrowButton.setPreferredSize(new Dimension(0, 0));
arrowButton.setVisible(false);
return (UIButton) arrowButton;
}
}
public class ComboBoxNoArrowEditor extends UIComboBoxEditor implements DocumentListener {
private volatile boolean setting = false;
private UIComboBoxNoArrow comboBox;
private Object item;
public ComboBoxNoArrowEditor(UIComboBoxNoArrow comboBox) {
super();
this.comboBox = comboBox;
textField.getDocument().addDocumentListener(this);
textField.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
changeHandler();
}
@Override
public void focusLost(FocusEvent e) {
}
});
}
public void setItem(Object item) {
this.item = item;
this.setting = true;
textField.setText((item == null) ? StringUtils.EMPTY : item.toString());
this.setting = false;
}
public Object getItem() {
return this.item;
}
public void insertUpdate(DocumentEvent e) {
changeHandler();
}
public void removeUpdate(DocumentEvent e) {
changeHandler();
}
public void changedUpdate(DocumentEvent e) {
changeHandler();
}
protected void changeHandler() {
if (setting) {
return;
}
comboBox.setPopupVisible(true);
this.item = textField.getText();
this.getEditorComponent().requestFocus();
}
}
}

10
designer_base/src/com/fr/start/SplashPane.java

@ -6,7 +6,6 @@ package com.fr.start;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -19,18 +18,16 @@ import com.fr.stable.CoreGraphHelper;
/** /**
* @author neil * @author neil
*
* @date: 2015-3-13-上午10:20:43 * @date: 2015-3-13-上午10:20:43
*/ */
public class SplashPane extends JPanel{ public class SplashPane extends JPanel {
/** /**
* 获取已经绘制完毕的启动画面 * 获取已经绘制完毕的启动画面
* *
* @return 绘制完毕的启动画面 * @return 绘制完毕的启动画面
*
*/ */
public BufferedImage getSplashImage() { public Image getSplashImage() {
Image image = createSplashBackground(); Image image = createSplashBackground();
return CoreGraphHelper.toBufferedImage(image); return CoreGraphHelper.toBufferedImage(image);
} }
@ -47,7 +44,6 @@ public class SplashPane extends JPanel{
* 设置在启动过程中, 动态改变的文本, 当前启动的模块信息 * 设置在启动过程中, 动态改变的文本, 当前启动的模块信息
* *
* @param text 指定的文本 * @param text 指定的文本
*
*/ */
public void setShowText(String text) { public void setShowText(String text) {
@ -57,7 +53,6 @@ public class SplashPane extends JPanel{
* 创建启动画面的背景图片 * 创建启动画面的背景图片
* *
* @return 背景图片 * @return 背景图片
*
*/ */
public Image createSplashBackground() { public Image createSplashBackground() {
if (GeneralContext.isChineseEnv()) { if (GeneralContext.isChineseEnv()) {
@ -69,7 +64,6 @@ public class SplashPane extends JPanel{
/** /**
* 窗口关闭后取消定时获取模块信息的timer * 窗口关闭后取消定时获取模块信息的timer
*
*/ */
public void releaseTimer() { public void releaseTimer() {

2
designer_base/src/com/fr/start/SplashWindow.java

@ -14,6 +14,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
import com.sun.awt.AWTUtilities;
public class SplashWindow extends JFrame { public class SplashWindow extends JFrame {
@ -45,6 +46,7 @@ public class SplashWindow extends JFrame {
this.setAlwaysOnTop(false); this.setAlwaysOnTop(false);
this.setUndecorated(true); this.setUndecorated(true);
AWTUtilities.setWindowOpaque(this, false);
//使窗体背景透明 //使窗体背景透明
if (OperatingSystem.isWindows()) { if (OperatingSystem.isWindows()) {

8
designer_form/src/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java

@ -149,4 +149,12 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
return false; return false;
} }
/**
* data属性改变触发其他操作
*
*/
public void firePropertyChange(){
initStyle();
}
} }

11
designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -8,7 +8,6 @@ import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.widget.DataModify; import com.fr.design.widget.DataModify;
import com.fr.design.widget.Operator; import com.fr.design.widget.Operator;
@ -152,8 +151,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
private void initDefinePane() { private void initDefinePane() {
currentEditorDefinePane = null; currentEditorDefinePane = null;
boolean dedicateLayout = xCreator.acceptType(XWScaleLayout.class) && xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator() || xCreator.acceptType(XWTitleLayout.class); XCreator creator = getXCreatorDedicated();
XCreator creator = dedicateLayout ? (XCreator) xCreator.getComponent(0) : xCreator;
FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, creator.toData(), new Operator() { FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, creator.toData(), new Operator() {
@Override @Override
public void did(DataCreatorUI ui, String cardName) { public void did(DataCreatorUI ui, String cardName) {
@ -168,6 +166,10 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
currentEditorDefinePane = definePane; currentEditorDefinePane = definePane;
} }
private XCreator getXCreatorDedicated(){
boolean dedicateLayout = xCreator.acceptType(XWScaleLayout.class) && xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator() || xCreator.acceptType(XWTitleLayout.class);
return dedicateLayout ? (XCreator) xCreator.getComponent(0) : xCreator;
}
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
@ -217,7 +219,8 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
} }
public void fireValueChanged() { public void fireValueChanged() {
xCreator.firePropertyChange(); XCreator creator = getXCreatorDedicated();
creator.firePropertyChange();
designer.fireTargetModified(); designer.fireTargetModified();
designer.refreshDesignerUI(); designer.refreshDesignerUI();
} }

5
designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java

@ -11,6 +11,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.DateValuePane; import com.fr.design.widget.component.DateValuePane;
import com.fr.design.widget.component.UIComboBoxNoArrow;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.DateEditor; import com.fr.form.ui.DateEditor;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
@ -101,8 +102,8 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private JPanel createFormatHead(){ private JPanel createFormatHead(){
String[] dateArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.DATE); String[] dateArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.DATE);
String[] timeArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.TIME); String[] timeArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.TIME);
final UIComboBox dateFormatComboBox = new UIComboBox(dateArray); final UIComboBox dateFormatComboBox = new UIComboBoxNoArrow(dateArray);
final UIComboBox timeFormatComboBox = new UIComboBox(timeArray); final UIComboBox timeFormatComboBox = new UIComboBoxNoArrow(timeArray);
dateFormatComboBox.addActionListener(new ActionListener(){ dateFormatComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){ public void actionPerformed(ActionEvent e){
refreshPreviewLabel(); refreshPreviewLabel();

Loading…
Cancel
Save