MoMeak 7 years ago
parent
commit
c5a782d639
  1. 19
      designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java
  2. 13
      designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java
  3. 4
      designer/src/com/fr/design/mainframe/cell/settingpane/style/PredefinedStylePane.java
  4. 8
      designer_base/src/com/fr/design/foldablepane/HeaderPane.java
  5. 4
      designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java

19
designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java

@ -32,35 +32,22 @@ import java.util.List;
* @since 2012-5-8下午12:18:53
*/
public class CellElementEditPane extends BasicPane {
private static int TIME_GAP = 80;
private static final int LEFT_BORDER = -5;
private static final int RIGHT_BORDER = 5;
private List<AbstractCellAttrPane> paneList;
private TemplateCellElement cellelement;
private ElementCasePane ePane;
private UIHeadGroup tabsHeaderIconPane;
private boolean isEditing;
private int PaneListIndex;
private CardLayout card;
private JPanel center;
private JPanel downTitle;
private JPanel title;
private UILabel titlename;
private TitleChangeListener titleChangeListener = null;
private CellAttributeProvider cellAttributeProvider = null;
public static void main(String[] args){
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
content.add(new CellElementEditPane(), BorderLayout.CENTER);
GUICoreUtils.centerWindow(jf);
jf.setSize(290, 400);
jf.setVisible(true);
}
public CellElementEditPane() {
setLayout(new BorderLayout());
initPaneList();
@ -89,7 +76,7 @@ public class CellElementEditPane extends BasicPane {
downTitle = new JPanel();
downTitle.setLayout(new BorderLayout());
downTitle.add(tabsHeaderIconPane, BorderLayout.NORTH);
center.setBorder(BorderFactory.createEmptyBorder(0, -5, 0, 5));
center.setBorder(BorderFactory.createEmptyBorder(0, LEFT_BORDER, 0, RIGHT_BORDER));
downTitle.add(center, BorderLayout.CENTER);
this.add(downTitle, BorderLayout.CENTER);

13
designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java

@ -62,18 +62,6 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
return layoutPane();
}
public static void main(String[] args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
content.add(new CellExpandAttrPane().layoutPane(), BorderLayout.CENTER);
GUICoreUtils.centerWindow(jf);
jf.setSize(290, 400);
jf.setVisible(true);
}
private void initAllNames() {
expandDirectionButton.setGlobalName(Inter.getLocText("FR-Designer_ExpandD_Expand_Direction"));
leftFatherPane.setGlobalName(Inter.getLocText("FR-Designer_LeftParent"));
@ -166,6 +154,7 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
default: {
horizontalExpandableCheckBox.setSelected(false);
verticalExpandableCheckBox.setSelected(false);
break;
}
}

4
designer/src/com/fr/design/mainframe/cell/settingpane/style/PredefinedStylePane.java

@ -23,6 +23,8 @@ import java.util.Iterator;
public class PredefinedStylePane extends FurtherBasicBeanPane<NameStyle> implements DesignerBean {
private static final int LEFT_BORDER = 10;
private static final int RIGHT_BORDER = 10;
private DefaultListModel defaultListModel;
private JList styleList;
private ChangeListener changeListener;
@ -65,7 +67,7 @@ public class PredefinedStylePane extends FurtherBasicBeanPane<NameStyle> impleme
styleList.setCellRenderer(render);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(styleList, BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(0 ,10, 0, 10));
this.setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, RIGHT_BORDER));
styleList.addMouseListener(new MouseAdapter() {
@Override

8
designer_base/src/com/fr/design/foldablepane/HeaderPane.java

@ -14,13 +14,14 @@ public class HeaderPane extends JPanel {
private static final int TITLE_X = 5;
private static final int LEFT_X = 16;
private static final int LEFT_Y = 6;
private static final int NORMAL_FONTSIZE = 12;
private int headWidth;
private int headHeight;
private Color bgColor;
private boolean isShow;
private String title;
private Image image;
private int fontSize = 12;
private int fontSize;
public void setShow(boolean isShow) {
this.isShow = isShow;
@ -58,10 +59,8 @@ public class HeaderPane extends JPanel {
g2d.setColor(UIConstants.COMPONENT_BACKGROUND_COLOR);
headWidth = this.getWidth();
g2d.fillRect(0, 0, headWidth, headHeight);
// g2d.drawImage(UIConstants.DRAG_BAR, 0, 0, headWidth, headHeight, null);
g2d.setFont(new Font("SimSun", 0, fontSize));
g2d.setPaint(bgColor);
// g2d.drawString(this.title, fontSize/2, headHeight-fontSize/3);
g2d.drawString(this.title, TITLE_X, headHeight - fontSize / 2 - 1);
int leftWdith = headWidth - LEFT_X;
if (this.isShow) {
@ -71,8 +70,6 @@ public class HeaderPane extends JPanel {
image = UIConstants.DRAG_LEFT_NORMAL_SMALL;
g2d.drawImage(image, leftWdith, LEFT_Y, null);
}
return panelImage;
}
@ -96,6 +93,7 @@ public class HeaderPane extends JPanel {
this(bgColor);
this.title = title;
this.headHeight = headHeight;
this.fontSize = NORMAL_FONTSIZE;
}
public static void main(String[] args) {

4
designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java

@ -10,6 +10,8 @@ import java.awt.event.MouseEvent;
* Created by MoMeak on 2017/7/5.
*/
public class UIExpandablePane extends JPanel {
private static final int LEFT_BORDER = 5;
private static final long serialVersionUID = 1L;
private HeaderPane headerPanel;
private JPanel contentPanel;
@ -41,7 +43,7 @@ public class UIExpandablePane extends JPanel {
headerPanel = new HeaderPane(color, title, headHeight);
headerPanel.addMouseListener(new PanelAction());
contentPanel.setBorder(BorderFactory.createEmptyBorder(0 ,5, 0, 0));
contentPanel.setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, 0));
this.add(headerPanel, BorderLayout.NORTH);
this.add(contentPanel, BorderLayout.CENTER);
setOpaque(false);

Loading…
Cancel
Save