diff --git a/designer/src/com/fr/poly/PolyDesignUI.java b/designer/src/com/fr/poly/PolyDesignUI.java index 8cc3583d8..b915e1ad8 100644 --- a/designer/src/com/fr/poly/PolyDesignUI.java +++ b/designer/src/com/fr/poly/PolyDesignUI.java @@ -220,18 +220,21 @@ public class PolyDesignUI extends ComponentUI { ArrayList dbcomponents = new ArrayList(); // richer:禁止双缓冲行为,否则会出现两个图像 ComponentUtils.disableBuffer(comp, dbcomponents); - if (comp instanceof ECBlockCreator) { - Graphics clipg = g.create((int) (x * time), (int) (y * time), (int) (width * time), (int) (height * time)); - comp.paint(clipg); - clipg.dispose(); - }else { - BufferedImage img = CoreGraphHelper.createBufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_INT_RGB); - Graphics2D g2d = img.createGraphics(); - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - comp.printAll(g2d); - g2d.dispose(); - g.drawImage(img, (int) (x * time), (int) (y * time), (int) (width * time), (int) (height * time),null); - } +// if (comp instanceof ECBlockCreator) { +// Graphics clipg = g.create((int) (x * time), (int) (y * time), (int) (width * time), (int) (height * time)); +// comp.paint(clipg); +// clipg.dispose(); +// }else { + 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); + comp.printAll(g2d); + g.drawImage(img, (int) (x * time), (int) (y * time), (int) (width * time), (int) (height * time),null); + + g2d.dispose(); + +// } ComponentUtils.resetBuffer(dbcomponents); } diff --git a/designer/src/com/fr/poly/creator/BlockCreator.java b/designer/src/com/fr/poly/creator/BlockCreator.java index 052e111a8..a5e9535c2 100644 --- a/designer/src/com/fr/poly/creator/BlockCreator.java +++ b/designer/src/com/fr/poly/creator/BlockCreator.java @@ -114,10 +114,12 @@ public abstract class BlockCreator extends JComponent i public Rectangle getEditorBounds() { Rectangle bounds = this.getBounds(); Dimension d = getEditor().getCornerSize(); - bounds.x -= d.width + designer.getHorizontalValue(); - bounds.y -= d.height + designer.getVerticalValue(); - bounds.width += d.width + PolyConstants.OPERATION_SIZE; - bounds.height += d.height + PolyConstants.OPERATION_SIZE; + //ECBlockCreator缩放的时候边框需要重新算下 + double times = this.designer.getResolution() / (double)resolution; + bounds.x -= d.width/times + designer.getHorizontalValue(); + 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; } diff --git a/designer/src/com/fr/poly/creator/BlockEditor.java b/designer/src/com/fr/poly/creator/BlockEditor.java index 12f142dce..636b134ed 100644 --- a/designer/src/com/fr/poly/creator/BlockEditor.java +++ b/designer/src/com/fr/poly/creator/BlockEditor.java @@ -3,17 +3,16 @@ */ package com.fr.poly.creator; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Rectangle; +import java.awt.*; import javax.swing.JComponent; +import javax.swing.plaf.ButtonUI; import com.fr.base.ScreenResolution; import com.fr.design.beans.location.Absorptionline; 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.general.ComparatorUtils; import com.fr.poly.PolyConstants; @@ -65,15 +64,15 @@ public abstract class BlockEditor editComponent = createEffective(); this.add(BlockEditorLayout.CENTER, editComponent); - this.addHeightTool = new UIButton(); + this.addHeightTool = new BlockControlButton(); this.add(BlockEditorLayout.LEFTBOTTOM, this.addHeightTool); this.addHeightTool.setPreferredSize(getAddHeigthPreferredSize()); - this.addWidthTool = new UIButton(); + this.addWidthTool = new BlockControlButton(); this.add(BlockEditorLayout.RIGHTTOP, this.addWidthTool); this.addWidthTool.setPreferredSize(getAddWidthPreferredSize()); - this.moveTool = new UIButton(); + this.moveTool = new BlockControlButton(); this.add(BlockEditorLayout.BOTTOMCORNER, this.moveTool); this.forbiddenWindow = new BlockForbiddenWindow(); @@ -204,5 +203,21 @@ public abstract class BlockEditor 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()); + } + } + }; + } + } } \ No newline at end of file diff --git a/designer/src/com/fr/poly/creator/ECBlockCreator.java b/designer/src/com/fr/poly/creator/ECBlockCreator.java index 3921bea39..3f46cee41 100644 --- a/designer/src/com/fr/poly/creator/ECBlockCreator.java +++ b/designer/src/com/fr/poly/creator/ECBlockCreator.java @@ -23,8 +23,6 @@ import com.fr.stable.unit.UnitRectangle; */ public class ECBlockCreator extends BlockCreator { private ECBlockEditor editor; - private static final int CREATOR_WIDTH = 20; - private static final int CREATOR_HEIGHT = 9; public ECBlockCreator() { @@ -69,12 +67,12 @@ public class ECBlockCreator extends BlockCreator { @Override public int getX(float time) { - return Math.round ((this.getX() - CREATOR_WIDTH) * time) + CREATOR_WIDTH; + return Math.round (this.getX() * time); } @Override public int getY(float time) { - return Math.round ((this.getY() - CREATOR_HEIGHT) * time) + CREATOR_HEIGHT; + return Math.round (this.getY() * time); } /** diff --git a/designer_base/src/com/fr/design/gui/ibutton/UIButton.java b/designer_base/src/com/fr/design/gui/ibutton/UIButton.java index 91602372d..1fb2ec70c 100644 --- a/designer_base/src/com/fr/design/gui/ibutton/UIButton.java +++ b/designer_base/src/com/fr/design/gui/ibutton/UIButton.java @@ -79,6 +79,7 @@ public class UIButton extends JButton implements UIObserver { setPressedIcon(pressed); setExtraPainted(false); setBackground(null); + setForeground(UIConstants.FONT_COLOR); setOpaque(false); initListener(); } diff --git a/designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java b/designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java index a93841ff3..4833597ee 100644 --- a/designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java +++ b/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); int mnemonicIndex = b.getDisplayedMnemonicIndex(); if (b.isEnabled()) { - g.setColor(UIConstants.FONT_COLOR); + g.setColor(b.getForeground()); } else { g.setColor(UIConstants.LINE_COLOR); } diff --git a/designer_base/src/com/fr/start/StartServer.java b/designer_base/src/com/fr/start/StartServer.java index ee06ede80..17e3c58d7 100644 --- a/designer_base/src/com/fr/start/StartServer.java +++ b/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.gui.itextarea.UITextArea; import com.fr.design.mainframe.DesignerContext; +import com.fr.env.RemoteEnv; import com.fr.env.SignIn; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; @@ -47,6 +48,10 @@ public class StartServer { * 找默认工作目录,不应该按照名字去找,而应该按照安装路径,因为默认工作目录的名字可能会改变。 */ public static void browserDemoURL() { + if (FRContext.getCurrentEnv() instanceof RemoteEnv) { + browser(FRContext.getCurrentEnv().getPath() + "?op=fs"); + return; + } if (ComparatorUtils.equals(StableUtils.getInstallHome(), ".")) {//august:供代码使用 String web = GeneralContext.getCurrentAppNameOfEnv(); browserURLWithLocalEnv("http://localhost:" + DesignerEnvManager.getEnvManager().getJettyServerPort() + "/" + web + "/" + ConfigManager.getProviderInstance().getServletMapping() diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index e53d7849c..0512a3d82 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/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.multilayer.MultiPieIndependentVanChartInterface; 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.radar.RadarIndependentVanChartInterface; import com.fr.plugin.chart.radar.VanChartRadarPlot; @@ -156,7 +157,9 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr @Override public void run() { - + + VanChartPhantomService.startPhantomService(); + initAllChartsDemoImage(allCharts); } }).start(); diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java index 4408e085b..85df10acc 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/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()); if(samePlotChange) { - mapPlot.setGeoUrl(GEOJSONHelper.getInstance().getDefaultJSONURL()); + mapPlot.setGeoUrl(GEOJSONHelper.getDefaultJSONURL()); mapDataTree.selectDefaultTreeNode(); selectTreePath = mapDataTree.getSelectionPath(); sourceComboBox.setSelectedItem(selectTreePath); diff --git a/designer_form/src/com/fr/design/designer/creator/DedicateLayoutContainer.java b/designer_form/src/com/fr/design/designer/creator/DedicateLayoutContainer.java index f223e5d8f..8c3cd743d 100644 --- a/designer_form/src/com/fr/design/designer/creator/DedicateLayoutContainer.java +++ b/designer_form/src/com/fr/design/designer/creator/DedicateLayoutContainer.java @@ -66,6 +66,15 @@ public abstract class DedicateLayoutContainer extends XLayoutContainer { 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返回其子组件 * diff --git a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java index 83f2b057f..d53bc04d5 100644 --- a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/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.FRContext; -import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icontainer.UIScrollPane; 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.utils.gui.GUICoreUtils; import com.fr.form.share.ShareLoader; import com.fr.form.ui.ElCaseBindInfo; import com.fr.general.FRLogger; @@ -196,10 +191,8 @@ public class FormWidgetDetailPane extends FormDockView{ resetPanel = new JPanel(); resetButton = new UIButton(Inter.getLocText("FR-Designer_Reset")); resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); - resetButton.set4ToolbarButton(); - resetButton.setOpaque(true); - resetButton.setBackground(new Color(184, 220, 242)); - resetButton.setForeground(Color.WHITE); + resetButton.setBackground(Color.white); + resetButton.setForeground(new Color(0x333334)); resetButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -210,9 +203,8 @@ public class FormWidgetDetailPane extends FormDockView{ }); deleteButton = new UIButton(Inter.getLocText("FR-Designer_Remove_Item")); - deleteButton.set4ToolbarButton(); - deleteButton.setOpaque(true); - deleteButton.setBackground(Color.red); + deleteButton.setBackground(Color.white); + deleteButton.setForeground(new Color(0xeb1d1f)); deleteButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { diff --git a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java index 14d3eb37a..636701f02 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java +++ b/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) { widgetPropertyPane.update(widget); xCreator.resetCreatorName(widget.getWidgetName()); + xCreator.resetVisible(widget.isVisible()); designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED); return; }