Browse Source

Merge branch 'release/9.0' of http://cloud.finedevelop.com:2015/scm/ba/design into release/9.0

master
daniel 7 years ago
parent
commit
9849903df8
  1. 27
      designer/src/com/fr/poly/PolyDesignUI.java
  2. 10
      designer/src/com/fr/poly/creator/BlockCreator.java
  3. 33
      designer/src/com/fr/poly/creator/BlockEditor.java
  4. 6
      designer/src/com/fr/poly/creator/ECBlockCreator.java
  5. 1
      designer_base/src/com/fr/design/gui/ibutton/UIButton.java
  6. 2
      designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java
  7. 5
      designer_base/src/com/fr/start/StartServer.java
  8. 3
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  9. 2
      designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java
  10. 9
      designer_form/src/com/fr/design/designer/creator/DedicateLayoutContainer.java
  11. 16
      designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java
  12. 1
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

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

@ -220,18 +220,21 @@ public class PolyDesignUI extends ComponentUI {
ArrayList<JComponent> dbcomponents = new ArrayList<JComponent>(); ArrayList<JComponent> dbcomponents = new ArrayList<JComponent>();
// richer:禁止双缓冲行为,否则会出现两个图像 // richer:禁止双缓冲行为,否则会出现两个图像
ComponentUtils.disableBuffer(comp, dbcomponents); ComponentUtils.disableBuffer(comp, dbcomponents);
if (comp instanceof ECBlockCreator) { // if (comp instanceof ECBlockCreator) {
Graphics clipg = g.create((int) (x * time), (int) (y * time), (int) (width * time), (int) (height * time)); // Graphics clipg = g.create((int) (x * time), (int) (y * time), (int) (width * time), (int) (height * time));
comp.paint(clipg); // comp.paint(clipg);
clipg.dispose(); // clipg.dispose();
}else { // }else {
BufferedImage img = CoreGraphHelper.createBufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_INT_RGB); BufferedImage img = CoreGraphHelper.createBufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D g2d = img.createGraphics();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); Graphics2D g2d = img.createGraphics();
comp.printAll(g2d); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.dispose(); comp.printAll(g2d);
g.drawImage(img, (int) (x * time), (int) (y * time), (int) (width * time), (int) (height * time),null); g.drawImage(img, (int) (x * time), (int) (y * time), (int) (width * time), (int) (height * time),null);
}
g2d.dispose();
// }
ComponentUtils.resetBuffer(dbcomponents); ComponentUtils.resetBuffer(dbcomponents);
} }

10
designer/src/com/fr/poly/creator/BlockCreator.java

@ -114,10 +114,12 @@ public abstract class BlockCreator<T extends TemplateBlock> extends JComponent i
public Rectangle getEditorBounds() { public Rectangle getEditorBounds() {
Rectangle bounds = this.getBounds(); Rectangle bounds = this.getBounds();
Dimension d = getEditor().getCornerSize(); Dimension d = getEditor().getCornerSize();
bounds.x -= d.width + designer.getHorizontalValue(); //ECBlockCreator缩放的时候边框需要重新算下
bounds.y -= d.height + designer.getVerticalValue(); double times = this.designer.getResolution() / (double)resolution;
bounds.width += d.width + PolyConstants.OPERATION_SIZE; bounds.x -= d.width/times + designer.getHorizontalValue();
bounds.height += d.height + PolyConstants.OPERATION_SIZE; bounds.y -= d.height/times + designer.getVerticalValue();
bounds.width += Math.ceil(d.width/times + PolyConstants.OPERATION_SIZE/times);
bounds.height += Math.ceil(d.height/times + PolyConstants.OPERATION_SIZE/times);
return bounds; return bounds;
} }

33
designer/src/com/fr/poly/creator/BlockEditor.java

@ -3,17 +3,16 @@
*/ */
package com.fr.poly.creator; package com.fr.poly.creator;
import java.awt.Color; import java.awt.*;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.plaf.ButtonUI;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.design.beans.location.Absorptionline; import com.fr.design.beans.location.Absorptionline;
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.utils.gui.GUIPaintUtils;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.poly.PolyConstants; import com.fr.poly.PolyConstants;
@ -65,15 +64,15 @@ public abstract class BlockEditor<T extends JComponent,U extends TemplateBlock>
editComponent = createEffective(); editComponent = createEffective();
this.add(BlockEditorLayout.CENTER, editComponent); this.add(BlockEditorLayout.CENTER, editComponent);
this.addHeightTool = new UIButton(); this.addHeightTool = new BlockControlButton();
this.add(BlockEditorLayout.LEFTBOTTOM, this.addHeightTool); this.add(BlockEditorLayout.LEFTBOTTOM, this.addHeightTool);
this.addHeightTool.setPreferredSize(getAddHeigthPreferredSize()); this.addHeightTool.setPreferredSize(getAddHeigthPreferredSize());
this.addWidthTool = new UIButton(); this.addWidthTool = new BlockControlButton();
this.add(BlockEditorLayout.RIGHTTOP, this.addWidthTool); this.add(BlockEditorLayout.RIGHTTOP, this.addWidthTool);
this.addWidthTool.setPreferredSize(getAddWidthPreferredSize()); this.addWidthTool.setPreferredSize(getAddWidthPreferredSize());
this.moveTool = new UIButton(); this.moveTool = new BlockControlButton();
this.add(BlockEditorLayout.BOTTOMCORNER, this.moveTool); this.add(BlockEditorLayout.BOTTOMCORNER, this.moveTool);
this.forbiddenWindow = new BlockForbiddenWindow(); this.forbiddenWindow = new BlockForbiddenWindow();
@ -204,5 +203,21 @@ public abstract class BlockEditor<T extends JComponent,U extends TemplateBlock>
return new Dimension(); return new Dimension();
} }
private class BlockControlButton extends UIButton {
@Override
public ButtonUI getUI() {
return new UIButtonUI() {
// 调换 normal 和 rollover 状态的填充色
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));
} else if (isRollOver(b)) {
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
} else if (b.isNormalPainted()) {
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
}
}
};
}
}
} }

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

@ -23,8 +23,6 @@ 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 = 20;
private static final int CREATOR_HEIGHT = 9;
public ECBlockCreator() { public ECBlockCreator() {
@ -69,12 +67,12 @@ public class ECBlockCreator extends BlockCreator<PolyECBlock> {
@Override @Override
public int getX(float time) { public int getX(float time) {
return Math.round ((this.getX() - CREATOR_WIDTH) * time) + CREATOR_WIDTH; return Math.round (this.getX() * time);
} }
@Override @Override
public int getY(float time) { public int getY(float time) {
return Math.round ((this.getY() - CREATOR_HEIGHT) * time) + CREATOR_HEIGHT; return Math.round (this.getY() * time);
} }
/** /**

1
designer_base/src/com/fr/design/gui/ibutton/UIButton.java

@ -79,6 +79,7 @@ public class UIButton extends JButton implements UIObserver {
setPressedIcon(pressed); setPressedIcon(pressed);
setExtraPainted(false); setExtraPainted(false);
setBackground(null); setBackground(null);
setForeground(UIConstants.FONT_COLOR);
setOpaque(false); setOpaque(false);
initListener(); initListener();
} }

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

@ -80,7 +80,7 @@ public class UIButtonUI extends BasicButtonUI {
FontMetrics fm = SwingUtilities2.getFontMetrics(b, g); FontMetrics fm = SwingUtilities2.getFontMetrics(b, g);
int mnemonicIndex = b.getDisplayedMnemonicIndex(); int mnemonicIndex = b.getDisplayedMnemonicIndex();
if (b.isEnabled()) { if (b.isEnabled()) {
g.setColor(UIConstants.FONT_COLOR); g.setColor(b.getForeground());
} else { } else {
g.setColor(UIConstants.LINE_COLOR); g.setColor(UIConstants.LINE_COLOR);
} }

5
designer_base/src/com/fr/start/StartServer.java

@ -10,6 +10,7 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.TemplateTreePane; import com.fr.design.file.TemplateTreePane;
import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.env.RemoteEnv;
import com.fr.env.SignIn; import com.fr.env.SignIn;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
@ -47,6 +48,10 @@ public class StartServer {
* 找默认工作目录不应该按照名字去找而应该按照安装路径因为默认工作目录的名字可能会改变 * 找默认工作目录不应该按照名字去找而应该按照安装路径因为默认工作目录的名字可能会改变
*/ */
public static void browserDemoURL() { public static void browserDemoURL() {
if (FRContext.getCurrentEnv() instanceof RemoteEnv) {
browser(FRContext.getCurrentEnv().getPath() + "?op=fs");
return;
}
if (ComparatorUtils.equals(StableUtils.getInstallHome(), ".")) {//august:供代码使用 if (ComparatorUtils.equals(StableUtils.getInstallHome(), ".")) {//august:供代码使用
String web = GeneralContext.getCurrentAppNameOfEnv(); String web = GeneralContext.getCurrentAppNameOfEnv();
browserURLWithLocalEnv("http://localhost:" + DesignerEnvManager.getEnvManager().getJettyServerPort() + "/" + web + "/" + ConfigManager.getProviderInstance().getServletMapping() browserURLWithLocalEnv("http://localhost:" + DesignerEnvManager.getEnvManager().getJettyServerPort() + "/" + web + "/" + ConfigManager.getProviderInstance().getServletMapping()

3
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -69,6 +69,7 @@ import com.fr.plugin.chart.map.MapIndependentVanChartInterface;
import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.multilayer.MultiPieIndependentVanChartInterface; import com.fr.plugin.chart.multilayer.MultiPieIndependentVanChartInterface;
import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot; import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot;
import com.fr.plugin.chart.phantom.VanChartPhantomService;
import com.fr.plugin.chart.pie.PieIndependentVanChartInterface; import com.fr.plugin.chart.pie.PieIndependentVanChartInterface;
import com.fr.plugin.chart.radar.RadarIndependentVanChartInterface; import com.fr.plugin.chart.radar.RadarIndependentVanChartInterface;
import com.fr.plugin.chart.radar.VanChartRadarPlot; import com.fr.plugin.chart.radar.VanChartRadarPlot;
@ -157,6 +158,8 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
@Override @Override
public void run() { public void run() {
VanChartPhantomService.startPhantomService();
initAllChartsDemoImage(allCharts); initAllChartsDemoImage(allCharts);
} }
}).start(); }).start();

2
designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java

@ -564,7 +564,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
mapDataTree.changeRootNode(this.getRootNode()); mapDataTree.changeRootNode(this.getRootNode());
if(samePlotChange) { if(samePlotChange) {
mapPlot.setGeoUrl(GEOJSONHelper.getInstance().getDefaultJSONURL()); mapPlot.setGeoUrl(GEOJSONHelper.getDefaultJSONURL());
mapDataTree.selectDefaultTreeNode(); mapDataTree.selectDefaultTreeNode();
selectTreePath = mapDataTree.getSelectionPath(); selectTreePath = mapDataTree.getSelectionPath();
sourceComboBox.setSelectedItem(selectTreePath); sourceComboBox.setSelectedItem(selectTreePath);

9
designer_form/src/com/fr/design/designer/creator/DedicateLayoutContainer.java

@ -66,6 +66,15 @@ public abstract class DedicateLayoutContainer extends XLayoutContainer {
child.toData().setWidgetName(name); child.toData().setWidgetName(name);
} }
/**
* 重置组件的可见性
* @param visible 可见性
*/
public void resetVisible(boolean visible){
super.resetVisible(visible);
XCreator child = getXCreator(XWScaleLayout.INDEX);
child.toData().setVisible(visible);
}
/** /**
* 返回对应属性表的组件scale和title返回其子组件 * 返回对应属性表的组件scale和title返回其子组件
* *

16
designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -2,17 +2,12 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.icon.IconPathConstants;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.share.ShareLoader; import com.fr.form.share.ShareLoader;
import com.fr.form.ui.ElCaseBindInfo; import com.fr.form.ui.ElCaseBindInfo;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
@ -196,10 +191,8 @@ public class FormWidgetDetailPane extends FormDockView{
resetPanel = new JPanel(); resetPanel = new JPanel();
resetButton = new UIButton(Inter.getLocText("FR-Designer_Reset")); resetButton = new UIButton(Inter.getLocText("FR-Designer_Reset"));
resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
resetButton.set4ToolbarButton(); resetButton.setBackground(Color.white);
resetButton.setOpaque(true); resetButton.setForeground(new Color(0x333334));
resetButton.setBackground(new Color(184, 220, 242));
resetButton.setForeground(Color.WHITE);
resetButton.addActionListener(new ActionListener() { resetButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -210,9 +203,8 @@ public class FormWidgetDetailPane extends FormDockView{
}); });
deleteButton = new UIButton(Inter.getLocText("FR-Designer_Remove_Item")); deleteButton = new UIButton(Inter.getLocText("FR-Designer_Remove_Item"));
deleteButton.set4ToolbarButton(); deleteButton.setBackground(Color.white);
deleteButton.setOpaque(true); deleteButton.setForeground(new Color(0xeb1d1f));
deleteButton.setBackground(Color.red);
deleteButton.addActionListener(new ActionListener() { deleteButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

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

@ -213,6 +213,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Basic")) && widgetPropertyPane != null) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Basic")) && widgetPropertyPane != null) {
widgetPropertyPane.update(widget); widgetPropertyPane.update(widget);
xCreator.resetCreatorName(widget.getWidgetName()); xCreator.resetCreatorName(widget.getWidgetName());
xCreator.resetVisible(widget.isVisible());
designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED); designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED);
return; return;
} }

Loading…
Cancel
Save