Browse Source
* commit '3d9b545131a5561eb5f92e3525f71c5c591761c8': REPORT-8354 9.0之前开发的功能与bug patch到10.0master
superman
7 years ago
60 changed files with 1598 additions and 553 deletions
@ -1 +1,36 @@
|
||||
package com.fr.design.icon;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date: 12-12-18
* Time: 上午9:42
* 用于保存所有图标路径的类
*/
public class IconPathConstants {
private IconPathConstants() {
}
public static final String ADD_POPMENU_ICON_PATH = "/com/fr/design/images/control/addPopup.png";
public static final String DS_ICON_PATH = "/com/fr/design/images/data/datasource.png";
public static final String CLASS_TD_ICON_PATH = "/com/fr/design/images/data/source/classTableData.png";
public static final String EMB_TD_ICON_PATH = "/com/fr/design/images/data/dataTable.png";
public static final String DS_RELATION_TD_ICON_PATH = "/com/fr/design/images/data/multi.png";
public static final String FILE_TD_ICON_PATH = "/com/fr/design/images/data/file.png";
public static final String DS_TREE_TD_ICON_PATH = "/com/fr/design/images/data/tree.png";
public static final String DS_QUERY_ICON_PATH = "/com/fr/design/images/data/database.png";
public static final String PREVIEW_ICON_PATH = "/com/fr/design/images/m_file/preview.png";
public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png";
public static final String TD_EL_SHARE_HELP_ICON_PATH = "/com/fr/design/images/control/help_open.png";
public static final String TD_EL_SHARE_CLOSE_ICON_PATH = "/com/fr/design/images/control/help_close.png";
public static final String TD_REMOVE_ICON_PATH = "/com/fr/design/images/control/tab/remove.png";
public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png";
public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png";
public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png";
public static final String XMLA_ICON_PATH = "/com/fr/design/images/data/cube.png";
public static final String FORBID_ICON_PATH = "/com/fr/web/images/form/forbid.png";
} |
||||
package com.fr.design.icon; |
||||
|
||||
/** |
||||
* Created by IntelliJ IDEA. |
||||
* Author : Richer |
||||
* Version: 6.5.6 |
||||
* Date: 12-12-18 |
||||
* Time: 上午9:42 |
||||
* 用于保存所有图标路径的类 |
||||
*/ |
||||
public class IconPathConstants { |
||||
private IconPathConstants() { |
||||
|
||||
} |
||||
|
||||
public static final String ADD_POPMENU_ICON_PATH = "/com/fr/design/images/control/addPopup.png"; |
||||
|
||||
public static final String DS_ICON_PATH = "/com/fr/design/images/data/datasource.png"; |
||||
public static final String CLASS_TD_ICON_PATH = "/com/fr/design/images/data/source/classTableData.png"; |
||||
public static final String EMB_TD_ICON_PATH = "/com/fr/design/images/data/dataTable.png"; |
||||
public static final String DS_RELATION_TD_ICON_PATH = "/com/fr/design/images/data/multi.png"; |
||||
public static final String FILE_TD_ICON_PATH = "/com/fr/design/images/data/file.png"; |
||||
public static final String DS_TREE_TD_ICON_PATH = "/com/fr/design/images/data/tree.png"; |
||||
public static final String DS_QUERY_ICON_PATH = "/com/fr/design/images/data/database.png"; |
||||
public static final String PREVIEW_ICON_PATH = "/com/fr/design/images/m_file/preview.png"; |
||||
public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png"; |
||||
public static final String TD_EL_SHARE_HELP_ICON_PATH = "/com/fr/design/images/control/help_open.png"; |
||||
public static final String TD_EL_SHARE_CLOSE_ICON_PATH = "/com/fr/design/images/control/help_close.png"; |
||||
public static final String TD_REMOVE_ICON_PATH = "/com/fr/design/images/control/tab/remove.png"; |
||||
public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png"; |
||||
public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png"; |
||||
public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png"; |
||||
public static final String XMLA_ICON_PATH = "/com/fr/design/images/data/cube.png"; |
||||
public static final String FORBID_ICON_PATH = "/com/fr/web/images/form/forbid.png"; |
||||
public static final String EDIT_ICON_PATH = "/com/fr/design/images/control/newEdit.png"; |
||||
} |
After Width: | Height: | Size: 314 B |
@ -0,0 +1,18 @@
|
||||
package com.fr.design.mainframe.widget.accessibles; |
||||
|
||||
import com.fr.design.style.background.BackgroundButtonPane; |
||||
import com.fr.design.style.background.BackgroundCardSwitchButtonPane; |
||||
|
||||
/** |
||||
* @author kerry |
||||
* @date 2018/1/29 |
||||
*/ |
||||
public class AccessibleTabBackgroundEditor extends AccessibleImgBackgroundEditor { |
||||
public AccessibleTabBackgroundEditor() { |
||||
super(); |
||||
} |
||||
@Override |
||||
protected BackgroundButtonPane initBackgroundPane(){ |
||||
return new BackgroundCardSwitchButtonPane(); |
||||
} |
||||
} |
@ -0,0 +1,40 @@
|
||||
package com.fr.design.mainframe.widget.accessibles; |
||||
|
||||
import com.fr.base.background.ColorBackground; |
||||
import com.fr.design.dialog.BasicDialog; |
||||
import com.fr.design.dialog.DialogActionAdapter; |
||||
import com.fr.design.mainframe.widget.wrappers.BackgroundWrapper; |
||||
import com.fr.design.style.background.BackgroundTabPane; |
||||
import com.fr.general.Background; |
||||
|
||||
import javax.swing.SwingUtilities; |
||||
import java.awt.Dimension; |
||||
|
||||
/** |
||||
* @author kerry |
||||
* @date 2018/1/17 |
||||
*/ |
||||
public class AccessibleTabPaneBackgroundEditor extends UneditableAccessibleEditor { |
||||
private BackgroundTabPane choosePane; |
||||
|
||||
public AccessibleTabPaneBackgroundEditor() { |
||||
super(new BackgroundWrapper()); |
||||
} |
||||
|
||||
@Override |
||||
protected void showEditorPane() { |
||||
choosePane = new BackgroundTabPane(); |
||||
choosePane.setPreferredSize(new Dimension(600, 400)); |
||||
BasicDialog dlg = choosePane.showWindow(SwingUtilities.getWindowAncestor(this)); |
||||
dlg.addDialogActionListener(new DialogActionAdapter() { |
||||
|
||||
@Override |
||||
public void doOk() { |
||||
setValue(choosePane.update()); |
||||
fireStateChanged(); |
||||
} |
||||
}); |
||||
choosePane.populate(getValue() instanceof Background ? (Background) getValue() : new ColorBackground()); |
||||
dlg.setVisible(true); |
||||
} |
||||
} |
@ -0,0 +1,95 @@
|
||||
package com.fr.design.style.background; |
||||
|
||||
import com.fr.base.background.ColorBackground; |
||||
import com.fr.base.background.GradientBackground; |
||||
import com.fr.base.background.ImageBackground; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.style.background.gradient.GradientBackgroundPane; |
||||
import com.fr.design.style.background.impl.ColorBackgroundPane; |
||||
import com.fr.design.style.background.impl.ImageBackgroundPane; |
||||
import com.fr.design.style.background.impl.NullBackgroundPane; |
||||
import com.fr.general.Background; |
||||
import com.fr.general.Inter; |
||||
|
||||
import java.util.LinkedHashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author kerry |
||||
* @date 2018/1/29 |
||||
*/ |
||||
public class BackgroundCardSwitchButtonPane extends BackgroundButtonPane { |
||||
|
||||
private static Map<Class<? extends Background>, BackgroundUIWrapper> cardSwitchButton = new LinkedHashMap<>(); |
||||
|
||||
static { |
||||
registerCardSwitchBtnBackground(cardSwitchButton); |
||||
} |
||||
|
||||
|
||||
private static void registerCardSwitchBtnBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) { |
||||
map.put(ColorBackground.class, BackgroundUIWrapper.create() |
||||
.setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color"))); |
||||
map.put(ImageBackground.class, BackgroundUIWrapper.create() |
||||
.setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image"))); |
||||
map.put(GradientBackground.class, BackgroundUIWrapper.create() |
||||
.setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Gradient_Color"))); |
||||
|
||||
} |
||||
|
||||
public BackgroundCardSwitchButtonPane() { |
||||
super(); |
||||
} |
||||
|
||||
@Override |
||||
protected void initTabPane() { |
||||
int index = 0; |
||||
for (Class<? extends Background> key : cardSwitchButton.keySet()) { |
||||
BackgroundUIWrapper wrapper = cardSwitchButton.get(key); |
||||
wrapper.setIndex(index++); |
||||
tabbedPane.addTab(Inter.getLocText(wrapper.getTitle()), FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane()); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
protected BackgroundUIWrapper getBackgroundUIWrapper(Background background) { |
||||
return cardSwitchButton.get(background == null ? null : background.getClass()); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
protected BackgroundDetailPane getTabItemPane(Background background, int index) { |
||||
BackgroundDetailPane quickPane = cacheMap.get(index); |
||||
if (quickPane == null) { |
||||
BackgroundUIWrapper uiWrapper = getBackgroundUIWrapper(background); |
||||
quickPane = BackgroundFactory.createByWrapper(uiWrapper); |
||||
quickPane.addChangeListener(backgroundChangeListener); |
||||
cacheMap.put(index, quickPane); |
||||
} |
||||
tabbedPane.setComponentAt(index, quickPane); |
||||
tabbedPane.setSelectedIndex(index); |
||||
return quickPane; |
||||
} |
||||
|
||||
@Override |
||||
protected BackgroundDetailPane getTabItemPaneByIndex(int index) { |
||||
BackgroundDetailPane quickPane = cacheMap.get(index); |
||||
if (quickPane == null) { |
||||
quickPane = createDetailPaneByIndex(index); |
||||
tabbedPane.setComponentAt(index, quickPane); |
||||
cacheMap.put(index, quickPane); |
||||
quickPane.addChangeListener(backgroundChangeListener); |
||||
} |
||||
return quickPane; |
||||
} |
||||
|
||||
public BackgroundDetailPane createDetailPaneByIndex(int index) { |
||||
for (BackgroundUIWrapper wrapper : cardSwitchButton.values()) { |
||||
if (wrapper.getIndex() == index) { |
||||
return BackgroundFactory.createByWrapper(wrapper); |
||||
} |
||||
} |
||||
return new NullBackgroundPane(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,88 @@
|
||||
package com.fr.design.style.background; |
||||
|
||||
import com.fr.base.background.ColorBackground; |
||||
import com.fr.base.background.GradientBackground; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.style.background.gradient.GradientBackgroundPane; |
||||
import com.fr.design.style.background.impl.ColorBackgroundPane; |
||||
import com.fr.design.style.background.impl.NullBackgroundPane; |
||||
import com.fr.general.Background; |
||||
import com.fr.general.Inter; |
||||
|
||||
import java.util.LinkedHashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author kerry |
||||
* @date 2018/1/17 |
||||
*/ |
||||
public class BackgroundTabPane extends BackgroundPane { |
||||
|
||||
private static Map<Class<? extends Background>, BackgroundUIWrapper> tabpane = new LinkedHashMap<>(); |
||||
|
||||
static { |
||||
registerTabpaneBackground(tabpane); |
||||
} |
||||
|
||||
|
||||
private static void registerTabpaneBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) { |
||||
map.put(null, BackgroundUIWrapper.create() |
||||
.setType(NullBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Null"))); |
||||
map.put(ColorBackground.class, BackgroundUIWrapper.create() |
||||
.setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color"))); |
||||
map.put(GradientBackground.class, BackgroundUIWrapper.create() |
||||
.setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Gradient_Color"))); |
||||
|
||||
} |
||||
|
||||
public BackgroundTabPane() { |
||||
super(); |
||||
} |
||||
|
||||
protected void initTabPane() { |
||||
int index = 0; |
||||
for (Class<? extends Background> key : tabpane.keySet()) { |
||||
BackgroundUIWrapper wrapper = tabpane.get(key); |
||||
wrapper.setIndex(index++); |
||||
tabbedPane.addTab(Inter.getLocText(wrapper.getTitle()), FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane()); |
||||
} |
||||
} |
||||
|
||||
protected BackgroundUIWrapper getBackgroundUIWrapper(Background background) { |
||||
return tabpane.get(background == null ? null : background.getClass()); |
||||
} |
||||
|
||||
protected BackgroundDetailPane getTabItemPane(Background background, int index) { |
||||
BackgroundDetailPane quickPane = cacheMap.get(index); |
||||
if (quickPane == null) { |
||||
BackgroundUIWrapper uiWrapper = getBackgroundUIWrapper(background); |
||||
quickPane = BackgroundFactory.createByWrapper(uiWrapper); |
||||
quickPane.addChangeListener(backgroundChangeListener); |
||||
cacheMap.put(index, quickPane); |
||||
} |
||||
tabbedPane.setComponentAt(index, quickPane); |
||||
tabbedPane.setSelectedIndex(index); |
||||
return quickPane; |
||||
} |
||||
|
||||
protected BackgroundDetailPane getTabItemPaneByIndex(int index) { |
||||
BackgroundDetailPane quickPane = cacheMap.get(index); |
||||
if (quickPane == null) { |
||||
quickPane = createDetailPaneByIndex(index); |
||||
tabbedPane.setComponentAt(index, quickPane); |
||||
cacheMap.put(index, quickPane); |
||||
quickPane.addChangeListener(backgroundChangeListener); |
||||
} |
||||
return quickPane; |
||||
} |
||||
|
||||
public BackgroundDetailPane createDetailPaneByIndex(int index) { |
||||
for (BackgroundUIWrapper wrapper : tabpane.values()) { |
||||
if (wrapper.getIndex() == index) { |
||||
return BackgroundFactory.createByWrapper(wrapper); |
||||
} |
||||
} |
||||
return new NullBackgroundPane(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,62 @@
|
||||
package com.fr.design.designer.beans.adapters.layout; |
||||
|
||||
import com.fr.design.designer.creator.XCreator; |
||||
import com.fr.design.designer.creator.XLayoutContainer; |
||||
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; |
||||
import com.fr.design.form.layout.FRBorderLayout; |
||||
import com.fr.general.ComparatorUtils; |
||||
import com.fr.general.Inter; |
||||
|
||||
import javax.swing.JOptionPane; |
||||
import java.awt.BorderLayout; |
||||
import java.awt.Rectangle; |
||||
|
||||
/** |
||||
* cardMainBorderLayout适配器 |
||||
* |
||||
* @author kerry |
||||
* @date 2019/1/4 |
||||
*/ |
||||
public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter { |
||||
|
||||
public FRCardMainBorderLayoutAdapter(XLayoutContainer container) { |
||||
super(container); |
||||
} |
||||
|
||||
/** |
||||
* CardMainBorderLayout的title部分不能超出layout边界 |
||||
* |
||||
* @param creator 组件 |
||||
*/ |
||||
@Override |
||||
public void fix(XCreator creator) { |
||||
if (creator.acceptType(XWCardTagLayout.class)) { |
||||
creator = (XCreator) creator.getParent(); |
||||
} |
||||
boolean beyondBounds = calculateBeyondBounds(creator); |
||||
if (!beyondBounds) { |
||||
super.fix(creator); |
||||
} |
||||
} |
||||
|
||||
private boolean calculateBeyondBounds(XCreator creator) { |
||||
FRBorderLayout layout = (FRBorderLayout) container.getFRLayout(); |
||||
Object constraints = layout.getConstraints(creator); |
||||
Rectangle rectangle = creator.getBounds(); |
||||
//不能超出控件边界
|
||||
if (ComparatorUtils.equals(constraints, BorderLayout.NORTH) || ComparatorUtils.equals(constraints, BorderLayout.SOUTH)) { |
||||
int containerHeight = container.getHeight(); |
||||
if (rectangle.height > containerHeight) { |
||||
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Beyond_Tablayout_Bounds")); |
||||
return true; |
||||
} |
||||
} else if (ComparatorUtils.equals(constraints, BorderLayout.EAST) || ComparatorUtils.equals(constraints, BorderLayout.WEST)) { |
||||
int containerWidth = container.getWidth(); |
||||
if (rectangle.width > containerWidth) { |
||||
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Beyond_Tablayout_Bounds")); |
||||
return true; |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
} |
Loading…
Reference in new issue