hzzz 8 years ago
parent
commit
76434782ba
  1. 9
      designer_base/src/com/fr/design/gui/autocomplete/AutoCompletePopupWindow.java
  2. 44
      designer_base/src/com/fr/design/gui/itabpane/UITabsHeaderIconPane.java
  3. 8
      designer_form/src/com/fr/design/mainframe/widget/editors/DataTableConfigPane.java

9
designer_base/src/com/fr/design/gui/autocomplete/AutoCompletePopupWindow.java

@ -41,6 +41,7 @@ import java.util.List;
class AutoCompletePopupWindow extends JWindow implements CaretListener, class AutoCompletePopupWindow extends JWindow implements CaretListener,
ListSelectionListener, MouseListener { ListSelectionListener, MouseListener {
private final static int DIS = 5;
/** /**
* The parent AutoCompletion instance. * The parent AutoCompletion instance.
*/ */
@ -388,14 +389,14 @@ class AutoCompletePopupWindow extends JWindow implements CaretListener,
// Try to position to the right first (LTR) // Try to position to the right first (LTR)
int x; int x;
if (ac.getTextComponentOrientation().isLeftToRight()) { if (ac.getTextComponentOrientation().isLeftToRight()) {
x = getX() + getWidth() + 5; x = getX() + getWidth() + DIS;
if (x + descWindow.getWidth() > screenBounds.x + screenBounds.width) { // doesn't fit if (x + descWindow.getWidth() > screenBounds.x + screenBounds.width) { // doesn't fit
x = getX() - 5 - descWindow.getWidth(); x = getX() - DIS - descWindow.getWidth();
} }
} else { // RTL } else { // RTL
x = getX() - 5 - descWindow.getWidth(); x = getX() - DIS - descWindow.getWidth();
if (x < screenBounds.x) { // Doesn't fit if (x < screenBounds.x) { // Doesn't fit
x = getX() + getWidth() + 5; x = getX() + getWidth() + DIS;
} }
} }

44
designer_base/src/com/fr/design/gui/itabpane/UITabsHeaderIconPane.java

@ -1,38 +1,22 @@
package com.fr.design.gui.itabpane; package com.fr.design.gui.itabpane;
import java.awt.BorderLayout; import com.fr.base.BaseUtils;
import java.awt.Color; import com.fr.design.constants.UIConstants;
import java.awt.Component; import com.fr.design.gui.core.UITabComponent;
import java.awt.Dimension; import com.fr.design.gui.ibutton.UITabButton;
import java.awt.GradientPaint; import com.fr.design.gui.ilable.UILabel;
import java.awt.Graphics2D; import com.fr.stable.StringUtils;
import java.awt.GridLayout;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import javax.swing.AbstractAction;
import javax.swing.ActionMap;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.InputMap;
import javax.swing.JComponent;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.KeyStroke;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.BaseUtils;
import com.fr.design.gui.core.UITabComponent;
import com.fr.design.gui.ibutton.UITabButton;
import com.fr.stable.StringUtils;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
@ -43,6 +27,7 @@ import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_M
*/ */
public class UITabsHeaderIconPane extends JPanel implements UITabComponent { public class UITabsHeaderIconPane extends JPanel implements UITabComponent {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final int DIS = 30;
private UILabel nameLabel; private UILabel nameLabel;
@ -160,11 +145,11 @@ public class UITabsHeaderIconPane extends JPanel implements UITabComponent {
int height = centerPane.getHeight(); int height = centerPane.getHeight();
int width = centerPane.getWidth(); int width = centerPane.getWidth();
int y = -height; int y = -height;
for (int i = 0; i <= height; i += 30) { for (int i = 0; i <= height; i += DIS) {
// 设置面板位置 // 设置面板位置
currentPanel.setBounds(0, i, width, height); currentPanel.setBounds(0, i, width, height);
panel.setBounds(0, y, width, height); panel.setBounds(0, y, width, height);
y += 30; y += DIS;
try { try {
Thread.sleep(3); Thread.sleep(3);
} catch (InterruptedException e) { } catch (InterruptedException e) {
@ -174,7 +159,6 @@ public class UITabsHeaderIconPane extends JPanel implements UITabComponent {
centerPane.remove(currentPanel);// 移除当前面板 centerPane.remove(currentPanel);// 移除当前面板
} }
panel.setBounds(0, 0, width, height); panel.setBounds(0, 0, width, height);
} }
}.start(); }.start();
break; break;

8
designer_form/src/com/fr/design/mainframe/widget/editors/DataTableConfigPane.java

@ -157,6 +157,8 @@ public class DataTableConfigPane extends JComponent implements PropertyChangeLis
} }
class MouseAdapterListener extends MouseAdapter { class MouseAdapterListener extends MouseAdapter {
private final static int DIS = 30;
private final static int SMALL_DIS = 3;
private JTable table; private JTable table;
int oldY = 0; int oldY = 0;
int newY = 0; int newY = 0;
@ -205,7 +207,7 @@ public class DataTableConfigPane extends JComponent implements PropertyChangeLis
height = height + table.getRowHeight(i); height = height + table.getRowHeight(i);
} }
if (height - e.getY() < 3) { if (height - e.getY() < SMALL_DIS) {
drag = true; drag = true;
table.setCursor(new Cursor(Cursor.N_RESIZE_CURSOR)); table.setCursor(new Cursor(Cursor.N_RESIZE_CURSOR));
} else { } else {
@ -223,8 +225,8 @@ public class DataTableConfigPane extends JComponent implements PropertyChangeLis
public void mouseDragged(MouseEvent e) { public void mouseDragged(MouseEvent e) {
if (drag) { if (drag) {
int value = oldHeight + e.getY() - oldY; int value = oldHeight + e.getY() - oldY;
if (value < 30) { if (value < DIS) {
table.setRowHeight(row, 30); table.setRowHeight(row, DIS);
} else { } else {
table.setRowHeight(row, oldHeight + e.getY() - oldY); table.setRowHeight(row, oldHeight + e.getY() - oldY);
} }

Loading…
Cancel
Save