diff --git a/designer/src/com/fr/design/actions/file/export/AbstractExportAction.java b/designer/src/com/fr/design/actions/file/export/AbstractExportAction.java index 74e8fbdf3..13a836c92 100644 --- a/designer/src/com/fr/design/actions/file/export/AbstractExportAction.java +++ b/designer/src/com/fr/design/actions/file/export/AbstractExportAction.java @@ -72,7 +72,7 @@ public abstract class AbstractExportAction extends JWorkBookAction { } // Choose a file name.... - FILEChooserPane fileChooserPane = FILEChooserPane.getInstance(true, true); + FILEChooserPane fileChooserPane = FILEChooserPane.getInstance(false, true); fileChooserPane.setFILEFilter(this.getChooseFileFilter()); // 打开文件后输出文件名修改,eg:w.cpt.doc / w.svg.doc,去掉中间的后缀名~~ w.doc diff --git a/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java index 60f45450c..14e5fdc03 100644 --- a/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java +++ b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java @@ -97,7 +97,6 @@ public class CellWidgetPropertyPane extends BasicPane { TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow()); if (editCellElement == null) { editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); - tplEC.addCellElement(editCellElement); } this.cellElement = editCellElement; this.populate(editCellElement); diff --git a/designer/src/com/fr/design/mainframe/SheetNameTabPane.java b/designer/src/com/fr/design/mainframe/SheetNameTabPane.java index 173bd9cd4..8e63aa815 100644 --- a/designer/src/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer/src/com/fr/design/mainframe/SheetNameTabPane.java @@ -554,10 +554,12 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse for (int i = scrollIndex; i <= lastOneIndex; i++) { int textWidth = widthArray[i]; if (evtX >= textX && evtX < textX + textWidth) { - if (getSelectedIndex() != i) { + boolean needRefreshPropertiesPane = getSelectedIndex() != i; + setSelectedIndex(i); + if (needRefreshPropertiesPane) { HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane(); } - setSelectedIndex(i); + isBlank = false; reportComposite.setComposite(); if (isAuthorityEditing) { diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index b6826a861..951333895 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -82,7 +82,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane { JPanel downPane = new JPanel(new BorderLayout()); downPane.add(new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), HEAD_WDITH, HEAD_HEIGTH, seniorPane()), BorderLayout.NORTH); downPane.add(new UIExpandablePane(Inter.getLocText("FR-Designer_Pagination"), HEAD_WDITH, HEAD_HEIGTH, pagePane()), BorderLayout.CENTER); - JPanel contentPane = new JPanel(new BorderLayout(0, 10)); + JPanel contentPane = new JPanel(new BorderLayout(0, 0)); contentPane.add(new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), HEAD_WDITH, HEAD_HEIGTH, basicPane()), BorderLayout.NORTH); contentPane.add(downPane, BorderLayout.CENTER); initAllNames(); @@ -96,13 +96,14 @@ public class CellOtherSetPane extends AbstractCellAttrPane { autoHeightCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); autoWidthCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p}; + double[] rowSize = {p, p, p, p}; double[] columnSize = {p}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ new Component[]{null}, new Component[]{autoHeightCheckBox}, new Component[]{autoWidthCheckBox}, + new Component[]{null}, }; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE); diff --git a/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java b/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java index 961c88d10..6eac1c571 100644 --- a/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java +++ b/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java @@ -80,7 +80,6 @@ public class ConditionAttributesGroupPane extends UIListControlPane { editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow()); if (editCellElement == null) { editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); - tplEC.addCellElement(editCellElement); } SheetUtils.calculateDefaultParent(tplEC); // 不知道这行代码的作用,怕去掉之后会出问题,先放在这里 diff --git a/designer_base/src/com/fr/design/gui/style/BorderPane.java b/designer_base/src/com/fr/design/gui/style/BorderPane.java index 1390ee9cb..861df6aaa 100644 --- a/designer_base/src/com/fr/design/gui/style/BorderPane.java +++ b/designer_base/src/com/fr/design/gui/style/BorderPane.java @@ -8,6 +8,8 @@ import com.fr.base.BaseUtils; import com.fr.base.CellBorderStyle; import com.fr.base.Style; import com.fr.design.constants.LayoutConstants; +import com.fr.design.event.GlobalNameListener; +import com.fr.design.event.GlobalNameObserver; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.LineComboBox; @@ -16,6 +18,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.color.NewColorSelectBox; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.stable.Constants; import com.fr.stable.CoreConstants; @@ -24,12 +27,17 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.*; +import java.util.Arrays; +import java.util.HashSet; /** * @author zhou * @since 2012-5-28下午6:22:04 */ -public class BorderPane extends AbstractBasicStylePane { +public class BorderPane extends AbstractBasicStylePane implements GlobalNameObserver { + + private static final String[] BORDERARRAY = {"currentLineCombo", "currentLineColorPane", "outerToggleButton", "topToggleButton", + "leftToggleButton", "bottomToggleButton", "rightToggleButton", "innerToggleButton", "horizontalToggleButton", "verticalToggleButton"}; private boolean insideMode = false; private UIToggleButton topToggleButton; @@ -48,6 +56,7 @@ public class BorderPane extends AbstractBasicStylePane { private JPanel borderPanel; private JPanel backgroundPanel; private BackgroundPane backgroundPane; + private GlobalNameListener globalNameListener = null; public BorderPane() { this.initComponents(); @@ -55,7 +64,7 @@ public class BorderPane extends AbstractBasicStylePane { protected void initComponents() { initButtonsWithIcon(); - this.setLayout(new BorderLayout(0, 6)); + this.setLayout(new BorderLayout(0, 0)); JPanel externalPane = new JPanel(new GridLayout(0, 4)); externalPane.add(topToggleButton); externalPane.add(leftToggleButton); @@ -89,7 +98,7 @@ public class BorderPane extends AbstractBasicStylePane { backgroundPane = new BackgroundPane(); backgroundPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Background"), 280, 24, backgroundPane); this.add(backgroundPanel, BorderLayout.CENTER); - + initAllNames(); outerToggleButton.addChangeListener(outerToggleButtonChangeListener); innerToggleButton.addChangeListener(innerToggleButtonChangeListener); } @@ -125,6 +134,19 @@ public class BorderPane extends AbstractBasicStylePane { this.currentLineColorPane = new NewColorSelectBox(100); } + private void initAllNames() { + currentLineCombo.setGlobalName("currentLineCombo"); + currentLineColorPane.setGlobalName("currentLineColorPane"); + outerToggleButton.setGlobalName("outerToggleButton"); + topToggleButton.setGlobalName("topToggleButton"); + leftToggleButton.setGlobalName("leftToggleButton"); + bottomToggleButton.setGlobalName("bottomToggleButton"); + rightToggleButton.setGlobalName("rightToggleButton"); + innerToggleButton.setGlobalName("innerToggleButton"); + horizontalToggleButton.setGlobalName("horizontalToggleButton"); + verticalToggleButton.setGlobalName("verticalToggleButton"); + } + @Override public String title4PopupWindow() { return Inter.getLocText("FR-Designer_Cell"); @@ -179,10 +201,13 @@ public class BorderPane extends AbstractBasicStylePane { } CellBorderStyle cellBorderStyle = this.update(); - - style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(), - cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); - style = style.deriveBackground(backgroundPane.update()); + HashSet borderSet = new HashSet(Arrays.asList(BORDERARRAY)); + if (borderSet.contains(globalNameListener.getGlobalName())) { + style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(), + cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); + } else { + style = style.deriveBackground(backgroundPane.update()); + } return style; } @@ -204,4 +229,19 @@ public class BorderPane extends AbstractBasicStylePane { cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); return cellBorderStyle; } + + @Override + public void registerNameListener(GlobalNameListener listener) { + globalNameListener = listener; + } + + @Override + public boolean shouldResponseNameListener() { + return false; + } + + @Override + public void setGlobalName(String name) { + + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java index 347bed685..81a916637 100644 --- a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java @@ -91,7 +91,7 @@ public class JFormSliderPane extends JPanel { initShowValButton(); initUIRadioButton(); initPane(); - JPanel panel = new JPanel(new FlowLayout(1, 5, 0)); + JPanel panel = new JPanel(new FlowLayout(1, 0, 0)); panel.add(downButton); panel.add(slider); panel.add(upButton); @@ -392,14 +392,14 @@ public class JFormSliderPane extends JPanel { dialog = new FormPopupPane(upButton, dialogContentPanel); if (upButtonX == 0) { upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); } } else { if (upButtonX == 0) { upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); } else { - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); } } } diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index dd0e0f7d9..74745c0ed 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -94,7 +94,7 @@ public class JSliderPane extends JPanel { initShowValButton(); initUIRadioButton(); initPane(); - JPanel panel = new JPanel(new FlowLayout(1, 5, 0)); + JPanel panel = new JPanel(new FlowLayout(1, 0, 0)); panel.add(downButton); panel.add(slider); panel.add(upButton); @@ -399,14 +399,14 @@ public class JSliderPane extends JPanel { dialog = new PopupPane(upButton, dialogContentPanel); if (upButtonX == 0) { upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP * 2, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); } } else { if (upButtonX == 0) { upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP * 2, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); } else { - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP * 2, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); } } } diff --git a/designer_base/src/com/fr/design/style/color/NewColorSelectBox.java b/designer_base/src/com/fr/design/style/color/NewColorSelectBox.java index a895daefb..ce76fe72d 100644 --- a/designer_base/src/com/fr/design/style/color/NewColorSelectBox.java +++ b/designer_base/src/com/fr/design/style/color/NewColorSelectBox.java @@ -7,6 +7,8 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import com.fr.base.background.ColorBackground; +import com.fr.design.event.GlobalNameListener; +import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.style.AbstractSelectBox; @@ -14,12 +16,14 @@ import com.fr.design.style.AbstractSelectBox; /** * Color select pane. */ -public class NewColorSelectBox extends AbstractSelectBox implements UIObserver { +public class NewColorSelectBox extends AbstractSelectBox implements UIObserver, GlobalNameObserver { private static final long serialVersionUID = 2782150678943960557L; - + private Color color; private NewColorSelectPane colorPane = new NewColorSelectPane(); private UIObserverListener uiObserverListener; + private String newColorSelectBoxName = ""; + private GlobalNameListener globalNameListener = null; public NewColorSelectBox(int preferredWidth) { initBox(preferredWidth); @@ -34,6 +38,9 @@ public class NewColorSelectBox extends AbstractSelectBox implements UIObs if(uiObserverListener == null){ return; } + if (globalNameListener != null && shouldResponseNameListener()){ + globalNameListener.setGlobalName(newColorSelectBoxName); + } uiObserverListener.doChange(); } }); @@ -93,4 +100,19 @@ public class NewColorSelectBox extends AbstractSelectBox implements UIObs public boolean shouldResponseChangeListener() { return true; } + + @Override + public void registerNameListener(GlobalNameListener listener) { + globalNameListener = listener; + } + + @Override + public boolean shouldResponseNameListener() { + return true; + } + + @Override + public void setGlobalName(String name) { + newColorSelectBoxName = name; + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/file/FILEChooserPane.java b/designer_base/src/com/fr/file/FILEChooserPane.java index cdc0c2c0f..02c92f646 100644 --- a/designer_base/src/com/fr/file/FILEChooserPane.java +++ b/designer_base/src/com/fr/file/FILEChooserPane.java @@ -16,6 +16,7 @@ import com.fr.design.gui.itextfield.UIAutoCompletionField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.JTemplate; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.filetree.FileNode; @@ -475,7 +476,7 @@ public class FILEChooserPane extends BasicPane { this.suffix = suffix; - dialog = showWindow((Window) parent, false); + dialog = showWindow(parent instanceof DesignerFrame ? (Window) parent : SwingUtilities.getWindowAncestor(parent), false); JPanel contentPane = (JPanel) dialog.getContentPane(); contentPane.setLayout(FRGUIPaneFactory.createM_BorderLayout()); contentPane.add(this, BorderLayout.CENTER);