@ -0,0 +1,146 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.base.FRContext; |
||||
import com.fr.design.dialog.BasicDialog; |
||||
import com.fr.design.dialog.BasicPane; |
||||
import com.fr.design.dialog.DialogActionAdapter; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.present.CellWriteAttrPane; |
||||
import com.fr.design.widget.WidgetPane; |
||||
import com.fr.form.ui.NoneWidget; |
||||
import com.fr.form.ui.Widget; |
||||
import com.fr.general.FRLogger; |
||||
import com.fr.general.Inter; |
||||
import com.fr.grid.selection.CellSelection; |
||||
import com.fr.grid.selection.Selection; |
||||
import com.fr.privilege.finegrain.WidgetPrivilegeControl; |
||||
import com.fr.report.cell.DefaultTemplateCellElement; |
||||
import com.fr.report.cell.TemplateCellElement; |
||||
import com.fr.report.elementcase.TemplateElementCase; |
||||
|
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Created by ibm on 2017/7/20. |
||||
*/ |
||||
public class CellWidgetPropertyPane extends BasicPane { |
||||
|
||||
private static CellWidgetPropertyPane singleton; |
||||
|
||||
private TemplateCellElement cellElement; |
||||
private WidgetPane cellEditorDefPane; |
||||
|
||||
public static CellWidgetPropertyPane getInstance(){ |
||||
if (singleton == null) { |
||||
singleton = new CellWidgetPropertyPane(); |
||||
} |
||||
return singleton; |
||||
} |
||||
|
||||
public CellWidgetPropertyPane() { |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
// this.addAttributeChangeListener(listener);
|
||||
// cellEditorDefPane = new WidgetPane(elementCasePane);
|
||||
} |
||||
|
||||
public void clear (){ |
||||
singleton = null; |
||||
} |
||||
|
||||
public WidgetPane getCellEditorDefPane() { |
||||
return cellEditorDefPane; |
||||
} |
||||
|
||||
public void setCellEditorDefPane(WidgetPane cellEditorDefPane) { |
||||
this.cellEditorDefPane = cellEditorDefPane; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return Inter.getLocText("FR-Designer-Widget_Settings"); |
||||
} |
||||
|
||||
public void populate(TemplateCellElement cellElement) { |
||||
if (cellElement == null) {// 利用默认的CellElement.
|
||||
cellElement = new DefaultTemplateCellElement(0, 0, null); |
||||
} |
||||
|
||||
Widget cellWidget = cellElement.getWidget(); |
||||
|
||||
if(cellWidget == null){ |
||||
return; |
||||
} |
||||
|
||||
// 这里进行克隆的原因是为了保留原始的Widget以便和新的Widget做比较来判断是否发生了改变
|
||||
if (cellWidget != null) { |
||||
try { |
||||
cellWidget = (Widget) cellWidget.clone(); |
||||
} catch (CloneNotSupportedException e) { |
||||
FRContext.getLogger().error(e.getMessage(), e); |
||||
} |
||||
} |
||||
cellEditorDefPane.populate(cellWidget); |
||||
|
||||
} |
||||
|
||||
|
||||
public void populate(ElementCasePane ePane) { |
||||
|
||||
|
||||
cellEditorDefPane = new WidgetPane(ePane); |
||||
this.add(cellEditorDefPane, BorderLayout.CENTER); |
||||
|
||||
CellSelection cs = (CellSelection) ePane.getSelection(); |
||||
final TemplateElementCase tplEC = ePane.getEditingElementCase(); |
||||
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); |
||||
} |
||||
|
||||
public void update() { |
||||
if (cellElement == null) {// 利用默认的CellElement.
|
||||
return; |
||||
} |
||||
|
||||
Widget cellWidget = this.cellEditorDefPane.update(); |
||||
// p:最后把这个cellEditorDef设置到CellGUIAttr.
|
||||
if (cellWidget instanceof NoneWidget) { |
||||
cellElement.setWidget(null); |
||||
} else { |
||||
if (cellElement.getWidget() != null) { |
||||
cellWidget = upDateWidgetAuthority(cellElement, cellWidget); |
||||
} |
||||
cellElement.setWidget(cellWidget); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
private Widget upDateWidgetAuthority(TemplateCellElement cellElement, Widget newWidget) { |
||||
try { |
||||
Widget oldWidget = (Widget) cellElement.getWidget().clone(); |
||||
if (newWidget.getClass() == oldWidget.getClass()) { |
||||
newWidget.setWidgetPrivilegeControl((WidgetPrivilegeControl) oldWidget.getWidgetPrivilegeControl().clone()); |
||||
} |
||||
} catch (Exception e) { |
||||
FRLogger.getLogger().error(e.getMessage()); |
||||
} |
||||
return newWidget; |
||||
} |
||||
|
||||
@Override |
||||
/** |
||||
*检测是否有效 |
||||
*/ |
||||
public void checkValid() throws Exception { |
||||
this.cellEditorDefPane.checkValid(); |
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -1 +1 @@
|
||||
package com.fr.design.widget.ui;
import com.fr.base.GraphHelper;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.CustomWriteAbleRepeatEditor;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Author : Shockway
* Date: 13-9-18
* Time: 下午2:17
*/
public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> {
private UICheckBox customDataCheckBox;
private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30;
private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30;
public CustomWritableRepeatEditorPane() {
this.initComponents();
}
@Override
protected JPanel setThirdContentPane() {
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false);
this.customDataCheckBox.setPreferredSize(
new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5));
JPanel otherContentPane = this.setForthContentPane();
if (otherContentPane != null) {
contentPane.add(otherContentPane,BorderLayout.CENTER);
}
return contentPane;
}
protected abstract JPanel setForthContentPane();
protected void populateSubWritableRepeatEditorBean(T e) {
this.customDataCheckBox.setSelected(e.isCustomData());
populateSubCustomWritableRepeatEditorBean(e);
}
protected abstract void populateSubCustomWritableRepeatEditorBean(T e);
protected T updateSubWritableRepeatEditorBean() {
T e = updateSubCustomWritableRepeatEditorBean();
e.setCustomData(this.customDataCheckBox.isSelected());
return e;
}
protected abstract T updateSubCustomWritableRepeatEditorBean();
} |
||||
package com.fr.design.widget.ui;
import com.fr.base.GraphHelper;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.CustomWriteAbleRepeatEditor;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Author : Shockway
* Date: 13-9-18
* Time: 下午2:17
*/
public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> {
private UICheckBox customDataCheckBox;
private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30;
private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30;
public CustomWritableRepeatEditorPane() {
this.initComponents();
}
@Override
protected JPanel setThirdContentPane() {
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false);
this.customDataCheckBox.setPreferredSize(
new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT));
JPanel otherContentPane = this.setForthContentPane();
if (otherContentPane != null) {
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5));
}
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5));
JPanel otherContentPane = this.setForthContentPane();
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5));
if (otherContentPane != null) {
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5));
contentPane.add(otherContentPane,BorderLayout.CENTER);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5));
}
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5));
return contentPane;
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5));
} return otherContentPane;
}
protected abstract JPanel setForthContentPane();
protected void populateSubWritableRepeatEditorBean(T e) {
this.customDataCheckBox.setSelected(e.isCustomData());
populateSubCustomWritableRepeatEditorBean(e);
}
protected abstract void populateSubCustomWritableRepeatEditorBean(T e);
protected T updateSubWritableRepeatEditorBean() {
T e = updateSubCustomWritableRepeatEditorBean();
e.setCustomData(this.customDataCheckBox.isSelected());
return e;
}
protected abstract T updateSubCustomWritableRepeatEditorBean();
} |
@ -0,0 +1,62 @@
|
||||
package com.fr.design.gui.controlpane; |
||||
|
||||
import java.lang.reflect.Constructor; |
||||
import java.lang.reflect.InvocationTargetException; |
||||
import com.fr.design.beans.BasicBeanPane; |
||||
|
||||
/** |
||||
* Created by plough on 2017/8/1. |
||||
*/ |
||||
public abstract class ObjectUIControlPane extends UIListControlPane { |
||||
private Object object; |
||||
|
||||
public ObjectUIControlPane() { |
||||
this(null); |
||||
} |
||||
|
||||
public ObjectUIControlPane(Object object) { |
||||
super(); |
||||
this.object = object; |
||||
} |
||||
|
||||
@Override |
||||
protected BasicBeanPane createPaneByCreators(NameableCreator creator) { |
||||
try { |
||||
if (object == null) { |
||||
return super.createPaneByCreators(creator); |
||||
} else if (object.getClass().isArray()) { |
||||
return creator.getUpdatePane().getConstructor(object.getClass()).newInstance(object); |
||||
} else { |
||||
Constructor<? extends BasicBeanPane> constructor = getConstructor(creator.getUpdatePane(), object.getClass()); |
||||
return constructor == null ? super.createPaneByCreators(creator) : constructor.newInstance(object); |
||||
} |
||||
} catch (Exception e) { |
||||
throw new RuntimeException(e); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 传进BasicBeanPane的构造函数的参数,可能是 |
||||
* |
||||
* @param clazz |
||||
* @param cls |
||||
* @return |
||||
*/ |
||||
private Constructor<? extends BasicBeanPane> getConstructor(Class<? extends BasicBeanPane> clazz, Class<?> cls) { |
||||
Constructor<? extends BasicBeanPane> constructor = null; |
||||
try { |
||||
constructor = clazz.getConstructor(cls); |
||||
} catch (SecurityException e) { |
||||
} catch (NoSuchMethodException e) { |
||||
} |
||||
if (constructor != null) { |
||||
return constructor; |
||||
} else { |
||||
if (cls.getName() == Object.class.getName()) { |
||||
return null; |
||||
} |
||||
return getConstructor(clazz, cls.getSuperclass()); |
||||
} |
||||
} |
||||
|
||||
} |
After Width: | Height: | Size: 315 B |
After Width: | Height: | Size: 308 B |
After Width: | Height: | Size: 219 B |
After Width: | Height: | Size: 198 B |
After Width: | Height: | Size: 344 B |
After Width: | Height: | Size: 232 B |
After Width: | Height: | Size: 221 B |
After Width: | Height: | Size: 197 B |
After Width: | Height: | Size: 326 B |
After Width: | Height: | Size: 235 B |
After Width: | Height: | Size: 118 B |
After Width: | Height: | Size: 166 B |
@ -1 +1,85 @@
|
||||
package com.fr.design.mainframe;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Author : daisy
* Date: 13-9-12
* Time: 下午6:21
*/
public abstract class AuthorityEditPane extends JPanel {
protected static final int TOP_GAP = 11;
protected static final int LEFT_GAP = 8;
protected static final int ALIGNMENT_GAP = -3;
protected UILabel type = null;
protected UILabel name = null;
protected JPanel checkPane = null;
private TargetComponent target;
public AuthorityEditPane(TargetComponent target) {
this.target = target;
setLayout(new BorderLayout());
type = new UILabel();
name = new UILabel();
checkPane = new JPanel();
checkPane.setLayout(new BorderLayout());
this.add(layoutText(), BorderLayout.WEST);
this.add(layoutPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0));
}
private JPanel layoutText() {
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Type") + ":", SwingConstants.RIGHT)},
new Component[]{new UILabel(Inter.getLocText("WF-Name") + ":", SwingConstants.RIGHT)},
new Component[]{new UILabel(Inter.getLocText("DashBoard-Potence") + ":", SwingConstants.RIGHT)},
};
double[] rowSize = {p, p, p};
double[] columnSize = {p};
int[][] rowCount = {{1}, {1}, {1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
}
private JPanel layoutPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{type},
new Component[]{name},
new Component[]{checkPane},
};
double[] rowSize = {p, p, p};
double[] columnSize = {f};
int[][] rowCount = {{1}, {1}, {1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
}
/**
* 更新权限编辑面板的具体内容:类型、名称、权限面板
*/
public void populateDetials() {
populateType();
populateName();
checkPane.removeAll();
populateCheckPane();
checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0));
}
public abstract void populateType();
public abstract void populateName();
public abstract JPanel populateCheckPane();
} |
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.design.constants.LayoutConstants; |
||||
import com.fr.design.designer.TargetComponent; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.layout.TableLayout; |
||||
import com.fr.design.layout.TableLayoutHelper; |
||||
import com.fr.general.Inter; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Author : daisy |
||||
* Date: 13-9-12 |
||||
* Time: 下午6:21 |
||||
*/ |
||||
public abstract class AuthorityEditPane extends JPanel { |
||||
protected static final int TOP_GAP = 11; |
||||
protected static final int LEFT_GAP = 4; |
||||
protected static final int RIGHT_GAP = 10; |
||||
protected static final int ALIGNMENT_GAP = -3; |
||||
protected static final int LEFT_CHECKPANE = 3; |
||||
|
||||
protected UILabel type = null; |
||||
protected UILabel name = null; |
||||
protected JPanel checkPane = null; |
||||
private TargetComponent target; |
||||
private JPanel typePane; |
||||
private JPanel namePane; |
||||
|
||||
public AuthorityEditPane(TargetComponent target) { |
||||
this.target = target; |
||||
setLayout(new BorderLayout()); |
||||
type = new UILabel(); |
||||
typePane = new JPanel(new BorderLayout()); |
||||
typePane.add(type, BorderLayout.CENTER); |
||||
type.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); |
||||
typePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); |
||||
name = new UILabel(); |
||||
namePane = new JPanel(new BorderLayout()); |
||||
namePane.add(name, BorderLayout.CENTER); |
||||
name.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); |
||||
namePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); |
||||
checkPane = new JPanel(); |
||||
checkPane.setLayout(new BorderLayout()); |
||||
// this.add(layoutText(), BorderLayout.WEST);
|
||||
// this.add(layoutPane(), BorderLayout.CENTER);
|
||||
this.add(centerPane(), BorderLayout.NORTH); |
||||
this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP)); |
||||
} |
||||
|
||||
private JPanel centerPane() { |
||||
double f = TableLayout.FILL; |
||||
double p = TableLayout.PREFERRED; |
||||
double[] rowSize = {p, p, p}; |
||||
double[] columnSize = {p, f}; |
||||
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; |
||||
Component[][] components = new Component[][]{ |
||||
new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), typePane}, |
||||
new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), namePane}, |
||||
new Component[]{checkPane, null}, |
||||
}; |
||||
|
||||
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); |
||||
} |
||||
|
||||
/** |
||||
* 更新权限编辑面板的具体内容:类型、名称、权限面板 |
||||
*/ |
||||
public void populateDetials() { |
||||
populateType(); |
||||
populateName(); |
||||
checkPane.removeAll(); |
||||
populateCheckPane(); |
||||
checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); |
||||
} |
||||
|
||||
public abstract void populateType(); |
||||
|
||||
public abstract void populateName(); |
||||
|
||||
public abstract JPanel populateCheckPane(); |
||||
|
||||
} |
@ -1 +1,49 @@
|
||||
package com.fr.design.mainframe;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Author : daisy
* Date: 13-9-12
* Time: 下午6:14
*/
public class AuthorityPropertyPane extends JPanel {
private static final int TITLE_HEIGHT = 19;
private AuthorityEditPane authorityEditPane = null;
public AuthorityPropertyPane(TargetComponent t) {
this.setLayout(new BorderLayout());
this.setBorder(null);
UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) {
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT);
}
};
authorityTitle.setHorizontalAlignment(SwingConstants.CENTER);
authorityTitle.setVerticalAlignment(SwingConstants.CENTER);
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.add(authorityTitle, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR));
this.add(northPane, BorderLayout.NORTH);
authorityEditPane = t.createAuthorityEditPane();
UIScrollPane scrollPane = new UIScrollPane(authorityEditPane);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
this.add(scrollPane, BorderLayout.CENTER);
}
public void populate() {
authorityEditPane.populateDetials();
}
} |
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.design.constants.UIConstants; |
||||
import com.fr.design.designer.TargetComponent; |
||||
import com.fr.design.gui.icontainer.UIScrollPane; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.general.Inter; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Author : daisy |
||||
* Date: 13-9-12 |
||||
* Time: 下午6:14 |
||||
*/ |
||||
public class AuthorityPropertyPane extends JPanel { |
||||
private static final int TITLE_HEIGHT = 19; |
||||
private AuthorityEditPane authorityEditPane = null; |
||||
|
||||
public AuthorityPropertyPane(TargetComponent t) { |
||||
this.setLayout(new BorderLayout()); |
||||
this.setBorder(null); |
||||
UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { |
||||
@Override |
||||
public Dimension getPreferredSize() { |
||||
return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); |
||||
} |
||||
}; |
||||
authorityTitle.setHorizontalAlignment(SwingConstants.CENTER); |
||||
authorityTitle.setVerticalAlignment(SwingConstants.CENTER); |
||||
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
northPane.add(authorityTitle, BorderLayout.CENTER); |
||||
northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); |
||||
// this.add(northPane, BorderLayout.NORTH);
|
||||
authorityEditPane = t.createAuthorityEditPane(); |
||||
UIScrollPane scrollPane = new UIScrollPane(authorityEditPane); |
||||
scrollPane.setBorder(null); |
||||
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
||||
this.add(scrollPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
public void populate() { |
||||
authorityEditPane.populateDetials(); |
||||
} |
||||
|
||||
|
||||
} |
@ -1 +1,62 @@
|
||||
package com.fr.design.mainframe;
import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Author : daisy
* Date: 13-9-22
* Time: 上午10:05
*/
public class NoSupportAuthorityEdit extends AuthorityEditPane {
private static final int TITLE_HEIGHT = 19;
public NoSupportAuthorityEdit() {
super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate());
this.setLayout(new BorderLayout());
this.setBorder(null);
UILabel title = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) {
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT);
}
};
title.setHorizontalAlignment(SwingConstants.CENTER);
title.setVerticalAlignment(SwingConstants.CENTER);
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.add(title, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR));
this.add(northPane, BorderLayout.NORTH);
this.add(createTextPane(), BorderLayout.CENTER);
}
private JPanel createTextPane() {
JPanel panel = new JPanel(new BorderLayout());
UILabel uiLabel = new UILabel(Inter.getLocText("not_support_authority_edit"));
uiLabel.setHorizontalAlignment(SwingConstants.CENTER);
uiLabel.setVerticalAlignment(SwingConstants.CENTER);
panel.add(uiLabel, BorderLayout.CENTER);
return panel;
}
@Override
public void populateType() {
}
@Override
public void populateName() {
}
@Override
public JPanel populateCheckPane() {
return null;
}
} |
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.design.constants.UIConstants; |
||||
import com.fr.design.file.HistoryTemplateListPane; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.general.Inter; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Author : daisy |
||||
* Date: 13-9-22 |
||||
* Time: 上午10:05 |
||||
*/ |
||||
public class NoSupportAuthorityEdit extends AuthorityEditPane { |
||||
|
||||
private static final int TITLE_HEIGHT = 19; |
||||
|
||||
public NoSupportAuthorityEdit() { |
||||
super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); |
||||
this.setLayout(new BorderLayout()); |
||||
this.setBorder(null); |
||||
UILabel title = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { |
||||
@Override |
||||
public Dimension getPreferredSize() { |
||||
return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); |
||||
} |
||||
}; |
||||
title.setHorizontalAlignment(SwingConstants.CENTER); |
||||
title.setVerticalAlignment(SwingConstants.CENTER); |
||||
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
northPane.add(title, BorderLayout.CENTER); |
||||
northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); |
||||
// this.add(northPane, BorderLayout.NORTH);
|
||||
this.add(createTextPane(), BorderLayout.CENTER); |
||||
} |
||||
|
||||
|
||||
private JPanel createTextPane() { |
||||
JPanel panel = new JPanel(new BorderLayout()); |
||||
UILabel uiLabel = new UILabel(Inter.getLocText("not_support_authority_edit")); |
||||
uiLabel.setHorizontalAlignment(SwingConstants.CENTER); |
||||
uiLabel.setVerticalAlignment(SwingConstants.CENTER); |
||||
panel.add(uiLabel, BorderLayout.CENTER); |
||||
return panel; |
||||
} |
||||
|
||||
@Override |
||||
public void populateType() { |
||||
} |
||||
|
||||
@Override |
||||
public void populateName() { |
||||
} |
||||
|
||||
@Override |
||||
public JPanel populateCheckPane() { |
||||
return null; |
||||
} |
||||
} |