本文整理汇总了Java中org.jdesktop.beansbinding.Converter类的典型用法代码示例。如果您正苦于以下问题:Java Converter类的具体用法?Java Converter怎么用?Java Converter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Converter类属于org.jdesktop.beansbinding包,在下文中一共展示了Converter类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindSelection
import org.jdesktop.beansbinding.Converter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void bindSelection(Object... components) {
painterDemos.setCellRenderer(new DefaultTreeRenderer(
DisplayValues.DISPLAY_INFO_DESCRIPTION));
Converter<?, ?> painterConverter = new DisplayInfoConverter<Painter>();
BindingGroup group = new BindingGroup();
for (int i = 0; i < components.length; i++) {
BeanProperty p = BeanProperty.create(
i == 0 ? "backgroundPainter" : "painter");
Binding b = Bindings.createAutoBinding(READ,
painterDemos, BeanProperty.create("selectedElement_UNWRAP_NODE"),
components[i], p);
b.setConverter(painterConverter);
group.addBinding(b);
}
group.bind();
}
示例2: getConverterClass
import org.jdesktop.beansbinding.Converter; //导入依赖的package包/类
@Override
public Class getConverterClass() {
return Converter.class;
}
示例3: MonthViewDemoControl
import org.jdesktop.beansbinding.Converter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public MonthViewDemoControl() {
selectionModes.setModel(new EnumComboBoxModel<SelectionMode>(SelectionMode.class));
selectionModes.setRenderer(new DefaultListRenderer(DisplayValues.TITLE_WORDS_UNDERSCORE));
// PENDING JW: this does not survive a change in Locale -
// revisit if we add changing Locale to the demo
Calendar calendar = monthView.getCalendar();
// start of week == first day of week in the calendar's coordinate space
CalendarUtils.startOfWeek(calendar);
DefaultComboBoxModel model = new DefaultComboBoxModel();
for (int i = 0; i < 7; i++) {
model.addElement(calendar.getTime());
calendar.add(Calendar.DATE, 1);
}
dayOfWeekComboBox.setModel(model);
SimpleDateFormat format = new SimpleDateFormat("EEEE");
dayOfWeekComboBox.setRenderer(new DefaultListRenderer(
new FormatStringValue(format)));
Converter<?, ?> days = new DayOfWeekConverter(calendar);
BindingGroup group = new BindingGroup();
group.addBinding(Bindings.createAutoBinding(READ,
selectionModes, BeanProperty.create("selectedItem"),
monthView, BeanProperty.create("selectionMode")));
group.addBinding(Bindings.createAutoBinding(READ,
traversable, BeanProperty.create("selected"),
monthView, BeanProperty.create("traversable")));
Binding dayOfWeek = Bindings.createAutoBinding(READ,
dayOfWeekComboBox, BeanProperty.create("selectedItem"),
monthView, BeanProperty.create("firstDayOfWeek"));
dayOfWeek.setConverter(days);
group.addBinding(dayOfWeek);
Binding flagged = Bindings.createAutoBinding(READ,
flaggedDates, BeanProperty.create("date"),
this, BeanProperty.create("lastFlagged"));
group.addBinding(flagged);
Binding unselectable = Bindings.createAutoBinding(READ,
unselectableDates, BeanProperty.create("date"),
this, BeanProperty.create("lastUnselectable"));
group.addBinding(unselectable);
group.addBinding(Bindings.createAutoBinding(READ,
upperBound, BeanProperty.create("date"),
this, BeanProperty.create("upperBound")));
group.addBinding(Bindings.createAutoBinding(READ,
lowerBound, BeanProperty.create("date"),
this, BeanProperty.create("lowerBound")));
group.bind();
// PENDING JW: removed the color selection stuff for now
// future will be to use highlighters anyway - revisit then
}
示例4: getTaxedConverter
import org.jdesktop.beansbinding.Converter; //导入依赖的package包/类
public Converter<Double, String> getTaxedConverter() {
return taxedConverter;
}
示例5: getStringConverter
import org.jdesktop.beansbinding.Converter; //导入依赖的package包/类
public Converter<Double, String> getStringConverter() {
return stringConverter;
}