forked from fanruan/design
Browse Source
* commit 'bfb5abfc0db3684895511452123d9c991a8ae0e4': 改一下label 继承 下actionlabel rt REPORT-14835 过滤逻辑修改 修改editor rt REPORT-14835 日期控件自定义bugfix/10.0
neil
6 years ago
6 changed files with 111 additions and 11 deletions
@ -0,0 +1,37 @@
|
||||
package com.fr.design.mainframe.vcs.ui; |
||||
|
||||
import com.fr.design.editor.editor.DateEditor; |
||||
import com.fr.log.FineLoggerFactory; |
||||
|
||||
import java.text.ParseException; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* Created by XiaXiang on 2019/5/14. |
||||
*/ |
||||
public class VcsDateEditor extends DateEditor { |
||||
private Date tempValue; |
||||
|
||||
public VcsDateEditor(Date value, boolean format, String name, int dateFormat) { |
||||
super(value, format, name, dateFormat); |
||||
this.tempValue = value; |
||||
} |
||||
|
||||
@Override |
||||
public Date getValue() { |
||||
if (tempValue == null) { |
||||
return null; |
||||
} |
||||
return super.getValue(); |
||||
} |
||||
|
||||
@Override |
||||
public void setValue(Date value) { |
||||
this.tempValue = value; |
||||
try { |
||||
getUiDatePicker().setSelectedDate(value); |
||||
} catch (ParseException parseException) { |
||||
FineLoggerFactory.getLogger().error(parseException.getMessage(), parseException); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,32 @@
|
||||
package com.fr.design.mainframe.vcs.ui; |
||||
|
||||
|
||||
import com.fr.design.gui.ilable.ActionLabel; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
|
||||
import java.awt.Color; |
||||
import java.awt.Graphics; |
||||
|
||||
/** |
||||
* Created by XiaXiang on 2019/5/15. |
||||
*/ |
||||
public class VcsLabel extends ActionLabel { |
||||
|
||||
|
||||
public VcsLabel(String text, Color color) { |
||||
super(text); |
||||
this.setForeground(color); |
||||
} |
||||
|
||||
public void paintComponent(Graphics g) { |
||||
if (ui != null) { |
||||
Graphics scratchGraphics = (g == null) ? null : g.create(); |
||||
try { |
||||
ui.update(scratchGraphics, this); |
||||
} |
||||
finally { |
||||
scratchGraphics.dispose(); |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue