Browse Source

format

master
hzzz 7 years ago
parent
commit
e2ad022e9c
  1. 29
      designer_base/src/com/fr/design/gui/ispinner/UISpinner.java
  2. 4
      designer_base/src/com/fr/design/gui/itextfield/UINumberField.java

29
designer_base/src/com/fr/design/gui/ispinner/UISpinner.java

@ -1,17 +1,5 @@
package com.fr.design.gui.ispinner; package com.fr.design.gui.ispinner;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.RoundRectangle2D;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.JTextComponent;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.GlobalNameObserver;
@ -21,9 +9,19 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itextfield.UITextFieldUI; import com.fr.design.gui.itextfield.UITextFieldUI;
import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.JTextComponent;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.RoundRectangle2D;
public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver { public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver {
@ -70,6 +68,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
/** /**
* 给组件分别加上FocusListener * 给组件分别加上FocusListener
*
* @param focusListener 监听事件 * @param focusListener 监听事件
*/ */
public void addUISpinnerFocusListenner(FocusListener focusListener) { public void addUISpinnerFocusListenner(FocusListener focusListener) {
@ -140,6 +139,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
/** /**
* 增加 a <code>ChangeListener</code> to the listener list. * 增加 a <code>ChangeListener</code> to the listener list.
*
* @param l 监听事件 * @param l 监听事件
*/ */
public void addChangeListener(ChangeListener l) { public void addChangeListener(ChangeListener l) {
@ -148,6 +148,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
/** /**
* 移除 a <code>ChangeListener</code> from the listener list. * 移除 a <code>ChangeListener</code> from the listener list.
*
* @param l 监听事件 * @param l 监听事件
*/ */
public void removeChangeListener(ChangeListener l) { public void removeChangeListener(ChangeListener l) {
@ -256,6 +257,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
/** /**
* 给组件登记一个观察者监听事件 * 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件 * @param listener 观察者监听事件
*/ */
public void registerChangeListener(UIObserverListener listener) { public void registerChangeListener(UIObserverListener listener) {
@ -331,6 +333,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
/** /**
* 程序入口 测试 * 程序入口 测试
*
* @param args 参数 * @param args 参数
*/ */
public static void main(String... args) { public static void main(String... args) {

4
designer_base/src/com/fr/design/gui/itextfield/UINumberField.java

@ -123,8 +123,7 @@ public class UINumberField extends UITextField {
/** /**
* Set property integer. * Set property integer.
* *
* @param integer * @param integer New value of property integer.
* New value of property integer.
*/ */
public void setInteger(boolean integer) { public void setInteger(boolean integer) {
if (integer) { if (integer) {
@ -153,6 +152,7 @@ public class UINumberField extends UITextField {
class NumberDocument extends PlainDocument { class NumberDocument extends PlainDocument {
public NumberDocument() { public NumberDocument() {
} }
public boolean checkString(int offset, String s, String str) { public boolean checkString(int offset, String s, String str) {
return (ComparatorUtils.equals(s, "F") return (ComparatorUtils.equals(s, "F")
|| ComparatorUtils.equals(s, "f") || ComparatorUtils.equals(s, "f")

Loading…
Cancel
Save