|
|
@ -1,10 +1,7 @@ |
|
|
|
package com.fr.design.gui.date; |
|
|
|
package com.fr.design.gui.date; |
|
|
|
|
|
|
|
|
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
import com.fine.theme.light.ui.FineComboBoxUI; |
|
|
|
import com.fine.theme.utils.FineUIStyle; |
|
|
|
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBoxUI; |
|
|
|
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
@ -13,6 +10,7 @@ import com.fr.stable.StringUtils; |
|
|
|
import com.fr.design.carton.FeedbackToolboxDialog; |
|
|
|
import com.fr.design.carton.FeedbackToolboxDialog; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
|
|
|
import javax.swing.JButton; |
|
|
|
import javax.swing.JComboBox; |
|
|
|
import javax.swing.JComboBox; |
|
|
|
import javax.swing.JFrame; |
|
|
|
import javax.swing.JFrame; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
@ -26,6 +24,7 @@ import javax.swing.plaf.basic.ComboPopup; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.Cursor; |
|
|
|
import java.awt.Cursor; |
|
|
|
import java.awt.LayoutManager; |
|
|
|
import java.awt.LayoutManager; |
|
|
|
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
import java.io.Serializable; |
|
|
|
import java.io.Serializable; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.ParseException; |
|
|
@ -292,40 +291,44 @@ public class UIDatePicker extends UIComboBox implements Serializable { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected ComboBoxUI getUIComboBoxUI() { |
|
|
|
protected ComboBoxUI getUIComboBoxUI() { |
|
|
|
return new UIComboBoxUI() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new FineComboBoxUI() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected UIButton createArrowButton() { |
|
|
|
protected JButton createArrowButton() { |
|
|
|
arrowButton = new UIButton(new LazyIcon("down_arrow")) { |
|
|
|
JButton button = super.createArrowButton(); |
|
|
|
public boolean shouldResponseChangeListener() { |
|
|
|
button.addMouseListener(getPopupMouseAdapter()); |
|
|
|
return false; |
|
|
|
return button; |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
arrowButton.addMouseListener(this); |
|
|
|
|
|
|
|
comboBox.addMouseListener(this); |
|
|
|
|
|
|
|
FineUIStyle.setStyle(arrowButton, FineUIStyle.PLAIN_BUTTON); |
|
|
|
|
|
|
|
return (UIButton) arrowButton; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected ComboPopup createPopup() { |
|
|
|
protected ComboPopup createPopup() { |
|
|
|
return new DatePopup(comboBox); |
|
|
|
return new DatePopup(comboBox); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
protected void installListeners() { |
|
|
|
if (UIDatePicker.this.isPopupVisible()) { |
|
|
|
super.installListeners(); |
|
|
|
willHide = true; |
|
|
|
comboBox.addMouseListener(getPopupMouseAdapter()); |
|
|
|
UIDatePicker.this.hidePopup(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
willHide = false; |
|
|
|
MouseAdapter getPopupMouseAdapter() { |
|
|
|
UIDatePicker.this.showPopup(); |
|
|
|
return new MouseAdapter() { |
|
|
|
} |
|
|
|
@Override |
|
|
|
|
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
|
|
|
|
if (UIDatePicker.this.isPopupVisible()) { |
|
|
|
|
|
|
|
willHide = true; |
|
|
|
|
|
|
|
UIDatePicker.this.hidePopup(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
willHide = false; |
|
|
|
|
|
|
|
UIDatePicker.this.showPopup(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//设置dataFormat
|
|
|
|
//设置dataFormat
|
|
|
|
public void setDateFormat(SimpleDateFormat format){ |
|
|
|
public void setDateFormat(SimpleDateFormat format){ |
|
|
|
this.dateFormat = format; |
|
|
|
this.dateFormat = format; |
|
|
|