Browse Source

Merge pull request #1207 in BA/design from ~XIAOXIA/design:release/9.0 to release/9.0

* commit 'b86851405b41058ea432711be68016eb36a1c343':
  RT
  rt
  rt
  REPORT-4492 alphafine 文档预览界面有多余的边框线
master
superman 7 years ago
parent
commit
502623d534
  1. 2
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  2. 29
      designer/src/com/fr/design/mainframe/alphafine/preview/DocumentPreviewPane.java
  3. 4
      designer_base/src/com/fr/design/gui/itextarea/UITextArea.java
  4. 2
      designer_base/src/com/fr/design/gui/itextarea/UITextAreaUI.java

2
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -684,7 +684,7 @@ public class AlphaFineDialog extends UIDialog {
} else { } else {
try { try {
Thread.sleep(10); Thread.sleep(10);
doSearch(searchTextField.getText()); doSearch(searchTextField.getText().toLowerCase());
} catch (InterruptedException e1) { } catch (InterruptedException e1) {
FRLogger.getLogger().error(e1.getMessage()); FRLogger.getLogger().error(e1.getMessage());
} }

29
designer/src/com/fr/design/mainframe/alphafine/preview/DocumentPreviewPane.java

@ -3,7 +3,6 @@ package com.fr.design.mainframe.alphafine.preview;
import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -16,30 +15,18 @@ public class DocumentPreviewPane extends JPanel {
public DocumentPreviewPane(String title, String summary) { public DocumentPreviewPane(String title, String summary) {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBackground(Color.WHITE); this.setBackground(Color.WHITE);
this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT));
UITextArea titleArea = new UITextArea(title); UITextArea titleArea = new UITextArea(title);
UITextArea contentArea = new UITextArea(summary); titleArea.setBorder(null);
titleArea.setOpaque(false); titleArea.setEditable(false);
contentArea.setOpaque(false);
titleArea.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
titleArea.setForeground(AlphaFineConstants.BLUE); titleArea.setForeground(AlphaFineConstants.BLUE);
contentArea.setForeground(AlphaFineConstants.BLACK);
titleArea.setPreferredSize(new Dimension(360, 30));
titleArea.setFont(AlphaFineConstants.LARGE_FONT); titleArea.setFont(AlphaFineConstants.LARGE_FONT);
contentArea.setFont(AlphaFineConstants.MEDIUM_FONT);
add(titleArea, BorderLayout.NORTH); add(titleArea, BorderLayout.NORTH);
UITextArea contentArea = new UITextArea(summary);
contentArea.setEditable(false);
contentArea.setBorder(null);
contentArea.setForeground(AlphaFineConstants.BLACK);
contentArea.setFont(AlphaFineConstants.MEDIUM_FONT);
add(contentArea, BorderLayout.CENTER); add(contentArea, BorderLayout.CENTER);
} }
public static void main(String[] args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(null);
content.add(new DocumentPreviewPane("test", "ababababaabbababab"));
GUICoreUtils.centerWindow(jf);
jf.setSize(400, 400);
jf.setVisible(true);
}
} }

4
designer_base/src/com/fr/design/gui/itextarea/UITextArea.java

@ -100,7 +100,9 @@ public class UITextArea extends JTextArea implements UIObserver {
@Override @Override
protected void paintBorder(Graphics g) { protected void paintBorder(Graphics g) {
getUI().paintBorder((Graphics2D) g, getWidth(), getHeight(), true, Constants.NULL); if (getBorder() != null) {
getUI().paintBorder((Graphics2D) g, getWidth(), getHeight(), true, Constants.NULL);
}
} }
@Override @Override

2
designer_base/src/com/fr/design/gui/itextarea/UITextAreaUI.java

@ -32,7 +32,7 @@ public class UITextAreaUI extends BasicTextAreaUI {
} }
public void paintBorder(Graphics2D g2d, int width, int height, boolean isRound, int rectDirection) { public void paintBorder(Graphics2D g2d, int width, int height, boolean isRound, int rectDirection) {
if (isRollOver && textField.isEnabled()) { if (isRollOver && textField.isEnabled() && ((UITextArea)textField).isEditable()) {
g2d.setColor(UIConstants.TEXT_FILED_BORDER_SELECTED); g2d.setColor(UIConstants.TEXT_FILED_BORDER_SELECTED);
g2d.drawRect(0, 0, width - 1, height - 1); g2d.drawRect(0, 0, width - 1, height - 1);
} else { } else {

Loading…
Cancel
Save