Browse Source

Merge pull request #840 in DESIGN/design from ~XIAOXIA/design:feature/10.0 to feature/10.0

* commit '4c3cdd0723c4ab486cd159fcc1bf5177cf70ff9b':
  REPORT-14835 设计器界面调整
research/10.0
xiaoxia 6 years ago
parent
commit
5e1f15ba70
  1. 4
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  2. 32
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionDialog.java
  3. 21
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java

4
designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

@ -34,8 +34,10 @@ public class VcsHelper {
: WorkContext.getCurrent().getConnection().getUserName(); : WorkContext.getCurrent().getConnection().getUserName();
public final static Color TABLE_SELECT_BACKGROUND = new Color(0xD8F2FD); public final static Color TABLE_SELECT_BACKGROUND = new Color(0xD8F2FD);
public final static Color COPY_VERSION_BTN_COLOR = new Color(0x419BF9);
public final static EmptyBorder EMPTY_BORDER = new EmptyBorder(5, 10, 0, 10);
public final static EmptyBorder EMPTY_BORDER = new EmptyBorder(10, 10, 0, 10);
public final static EmptyBorder EMPTY_BORDER_BOTTOM = new EmptyBorder(10, 10, 10, 10); public final static EmptyBorder EMPTY_BORDER_BOTTOM = new EmptyBorder(10, 10, 10, 10);

32
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionDialog.java

@ -7,6 +7,7 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.vcs.common.VcsHelper;
import com.fr.report.entity.VcsEntity; import com.fr.report.entity.VcsEntity;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
@ -17,6 +18,7 @@ import javax.swing.Box;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame; import java.awt.Frame;
import java.awt.Window; import java.awt.Window;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -24,14 +26,12 @@ import java.awt.event.ActionListener;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import static com.fr.design.mainframe.vcs.common.VcsHelper.EMPTY_BORDER;
import static com.fr.design.mainframe.vcs.common.VcsHelper.EMPTY_BORDER_BOTTOM;
public class FileVersionDialog extends UIDialog { public class FileVersionDialog extends UIDialog {
public static final long DELAY = 24 * 60 * 60 * 1000; public static final long DELAY = 24 * 60 * 60 * 1000;
private UIButton okBtn = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); private UIButton okBtn;
private UIButton cancelBtn = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Utils_Design_Action_Cancel")); private UIButton cancelBtn;
private DateEditor dateEditor; private DateEditor dateEditor;
private UITextField textField; private UITextField textField;
@ -39,23 +39,25 @@ public class FileVersionDialog extends UIDialog {
public FileVersionDialog(Frame frame) { public FileVersionDialog(Frame frame) {
super(frame); super(frame);
setUndecorated(true); setUndecorated(true);
setModal(true);
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
Box upBox = Box.createHorizontalBox(); Box upBox = Box.createHorizontalBox();
upBox.setBorder(EMPTY_BORDER_BOTTOM); upBox.setBorder(VcsHelper.EMPTY_BORDER);
upBox.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_buildTime"))); upBox.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_buildTime") + " "));
upBox.add(Box.createHorizontalGlue()); upBox.add(Box.createHorizontalGlue());
dateEditor = new DateEditor(new Date(), true, StringUtils.EMPTY, UIDatePicker.STYLE_CN_DATE1); dateEditor = new DateEditor(new Date(), true, StringUtils.EMPTY, UIDatePicker.STYLE_CN_DATE1);
upBox.add(dateEditor); upBox.add(dateEditor);
Box downBox = Box.createHorizontalBox(); Box downBox = Box.createHorizontalBox();
downBox.setBorder(EMPTY_BORDER_BOTTOM); downBox.setBorder(VcsHelper.EMPTY_BORDER);
downBox.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_CommitMsg"))); downBox.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_CommitMsg") + " "));
textField = new UITextField(); textField = new UITextField();
downBox.add(textField); downBox.add(textField);
Box box2 = Box.createHorizontalBox(); JPanel buttonPane = new JPanel(new FlowLayout(FlowLayout.RIGHT));
box2.add(Box.createHorizontalGlue()); okBtn = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK"));
box2.setBorder(EMPTY_BORDER); cancelBtn = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Design_Action_Cancel"));
box2.add(okBtn); buttonPane.setBorder(VcsHelper.EMPTY_BORDER);
box2.add(cancelBtn); buttonPane.add(okBtn);
buttonPane.add(cancelBtn);
okBtn.addActionListener(new ActionListener() { okBtn.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -74,9 +76,9 @@ public class FileVersionDialog extends UIDialog {
}); });
panel.add(upBox, BorderLayout.NORTH); panel.add(upBox, BorderLayout.NORTH);
panel.add(downBox, BorderLayout.CENTER); panel.add(downBox, BorderLayout.CENTER);
panel.add(box2, BorderLayout.SOUTH); panel.add(buttonPane, BorderLayout.SOUTH);
add(panel); add(panel);
setSize(new Dimension(220, 100)); setSize(new Dimension(230, 105));
centerWindow(this); centerWindow(this);
} }

21
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java

@ -33,7 +33,7 @@ public class FileVersionRowPanel extends JPanel {
private VcsEntity vcsEntity; private VcsEntity vcsEntity;
private UILabel versionLabel = new UILabel(); private UILabel versionLabel = new UILabel();
private UILabel usernameLabel = new UILabel(StringUtils.EMPTY, VcsHelper.VCS_USER_PNG, SwingConstants.LEFT); private UILabel usernameLabel = new UILabel(StringUtils.EMPTY, VcsHelper.VCS_USER_PNG, SwingConstants.LEFT);
private UITextPane timeAndMsgLabel = new UITextPane(); private UITextPane msgLabel = new UITextPane();
private UILabel timeLabel = new UILabel(); private UILabel timeLabel = new UILabel();
private EditFileVersionDialog editDialog; private EditFileVersionDialog editDialog;
@ -49,12 +49,12 @@ public class FileVersionRowPanel extends JPanel {
// msg // msg
timeAndMsgLabel.setBorder(VcsHelper.EMPTY_BORDER); msgLabel.setBorder(VcsHelper.EMPTY_BORDER);
timeAndMsgLabel.setOpaque(false); msgLabel.setOpaque(false);
timeAndMsgLabel.setBackground(new Color(0, 0, 0, 0)); msgLabel.setBackground(new Color(0, 0, 0, 0));
timeAndMsgLabel.setEditable(false); msgLabel.setEditable(false);
// confirm + delete // confirm + delete + edit
UIButton confirmBtn = new UIButton(VcsHelper.VCS_REVERT); UIButton confirmBtn = new UIButton(VcsHelper.VCS_REVERT);
confirmBtn.set4ToolbarButton(); confirmBtn.set4ToolbarButton();
confirmBtn.setToolTipText(Toolkit.i18nText("Fine-Design_Vcs_Revert")); confirmBtn.setToolTipText(Toolkit.i18nText("Fine-Design_Vcs_Revert"));
@ -108,9 +108,10 @@ public class FileVersionRowPanel extends JPanel {
downPane.add(usernameLabel); downPane.add(usernameLabel);
downPane.setBorder(VcsHelper.EMPTY_BORDER_BOTTOM); downPane.setBorder(VcsHelper.EMPTY_BORDER_BOTTOM);
downPane.add(Box.createHorizontalGlue()); downPane.add(Box.createHorizontalGlue());
timeLabel.setForeground(VcsHelper.COPY_VERSION_BTN_COLOR);
downPane.add(timeLabel); downPane.add(timeLabel);
add(upPane, BorderLayout.NORTH); add(upPane, BorderLayout.NORTH);
add(timeAndMsgLabel, BorderLayout.CENTER); add(msgLabel, BorderLayout.CENTER);
add(downPane, BorderLayout.SOUTH); add(downPane, BorderLayout.SOUTH);
} }
@ -126,11 +127,11 @@ public class FileVersionRowPanel extends JPanel {
this.vcsEntity = fileVersion; this.vcsEntity = fileVersion;
versionLabel.setText(String.format("V.%s", fileVersion.getVersion())); versionLabel.setText(String.format("V.%s", fileVersion.getVersion()));
usernameLabel.setText(fileVersion.getUsername()); usernameLabel.setText(fileVersion.getUsername());
timeAndMsgLabel.setText(StringUtils.EMPTY); msgLabel.setText(StringUtils.EMPTY);
timeLabel.setText(timeStr(fileVersion.getTime())); timeLabel.setText(timeStr(fileVersion.getTime()));
try { try {
StyledDocument doc = timeAndMsgLabel.getStyledDocument(); StyledDocument doc = msgLabel.getStyledDocument();
Style style = timeAndMsgLabel.getLogicalStyle(); Style style = msgLabel.getLogicalStyle();
StyleConstants.setForeground(style, Color.BLACK); StyleConstants.setForeground(style, Color.BLACK);
doc.insertString(doc.getLength(), " " + fileVersion.getCommitMsg(), style); doc.insertString(doc.getLength(), " " + fileVersion.getCommitMsg(), style);
} catch (BadLocationException e) { } catch (BadLocationException e) {

Loading…
Cancel
Save