本文整理匯總了Java中javafx.util.Callback.call方法的典型用法代碼示例。如果您正苦於以下問題:Java Callback.call方法的具體用法?Java Callback.call怎麽用?Java Callback.call使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.util.Callback
的用法示例。
在下文中一共展示了Callback.call方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: _getValue
import javafx.util.Callback; //導入方法依賴的package包/類
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override public String _getValue() {
CheckBoxTreeTableCell cell = (CheckBoxTreeTableCell) node;
Callback selectedStateCallback = cell.getSelectedStateCallback();
String cbText;
if (selectedStateCallback != null) {
ObservableValue<Boolean> call = (ObservableValue<Boolean>) selectedStateCallback.call(cell.getItem());
int selection = call.getValue() ? 2 : 0;
cbText = JavaFXCheckBoxElement.states[selection];
} else {
Node cb = cell.getGraphic();
JavaFXElement comp = (JavaFXElement) JavaFXElementFactory.createElement(cb, driver, window);
cbText = comp._getValue();
}
String cellText = cell.getText();
if (cellText == null) {
cellText = "";
}
String text = cellText + ":" + cbText;
return text;
}
示例2: _getValue
import javafx.util.Callback; //導入方法依賴的package包/類
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override public String _getValue() {
CheckBoxTreeTableCell cell = (CheckBoxTreeTableCell) node;
Callback selectedStateCallback = cell.getSelectedStateCallback();
String cbText;
if (selectedStateCallback != null) {
ObservableValue<Boolean> call = (ObservableValue<Boolean>) selectedStateCallback.call(cell.getItem());
int selection = call.getValue() ? 2 : 0;
cbText = JavaFXCheckBoxElement.states[selection];
} else {
Node cb = cell.getGraphic();
RFXComponent comp = getFinder().findRawRComponent(cb, null, null);
cbText = comp._getValue();
}
return cbText;
}
示例3: doAddEntryView
import javafx.util.Callback; //導入方法依賴的package包/類
private DayEntryView doAddEntryView(Entry<?> entry) {
Callback<Entry<?>, DayEntryView> factory = getSkinnable().getEntryViewFactory();
DayEntryView view = factory.call(entry);
view.getProperties().put("control", getSkinnable()); //$NON-NLS-1$
view.setManaged(false);
int index = findIndex(entry);
getChildren().add(index, view);
if (!(entry instanceof DraggedEntry) && LoggingDomain.VIEW.isLoggable(Level.FINE)) {
LoggingDomain.VIEW.fine("added entry view " + entry.getTitle() + ", day = " + getSkinnable().getDate());
}
return view;
}
示例4: doAddEntryView
import javafx.util.Callback; //導入方法依賴的package包/類
private AllDayEntryView doAddEntryView(Entry<?> entry) {
Callback<Entry<?>, AllDayEntryView> factory = getSkinnable().getEntryViewFactory();
AllDayEntryView view = factory.call(entry);
view.applyCss(); // TODO: really needed
view.getProperties().put("control", getSkinnable()); //$NON-NLS-1$
view.setManaged(false);
int index = findIndex(entry);
getChildren().add(index, view);
if (!(entry instanceof DraggedEntry) && LoggingDomain.VIEW.isLoggable(Level.FINE)) {
LoggingDomain.VIEW.fine("added entry view " + entry.getTitle() + ", day = " + getSkinnable().getDate());
}
return view;
}
示例5: _getValue
import javafx.util.Callback; //導入方法依賴的package包/類
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public String _getValue() {
CheckBoxTableCell cell = (CheckBoxTableCell) node;
Callback selectedStateCallback = cell.getSelectedStateCallback();
String cbText;
if (selectedStateCallback != null) {
ObservableValue<Boolean> call = (ObservableValue<Boolean>) selectedStateCallback.call(cell.getItem());
int selection = call.getValue() ? 2 : 0;
cbText = JavaFXCheckBoxElement.states[selection];
} else {
Node cb = cell.getGraphic();
JavaFXElement comp = (JavaFXElement) JavaFXElementFactory.createElement(cb, driver, window);
cbText = comp._getValue();
}
String cellText = cell.getText();
if (cellText == null) {
cellText = "";
}
String text = cellText + ":" + cbText;
return text;
}
示例6: _getValue
import javafx.util.Callback; //導入方法依賴的package包/類
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public String _getValue() {
CheckBoxTableCell cell = (CheckBoxTableCell) node;
Callback selectedStateCallback = cell.getSelectedStateCallback();
String cbText;
if (selectedStateCallback != null) {
ObservableValue<Boolean> call = (ObservableValue<Boolean>) selectedStateCallback.call(cell.getItem());
int selection = call.getValue() ? 2 : 0;
cbText = JavaFXCheckBoxElement.states[selection];
} else {
Node cb = cell.getGraphic();
RFXComponent comp = getFinder().findRawRComponent(cb, null, null);
cbText = comp._getValue();
}
return cbText;
}
示例7: showDetails
import javafx.util.Callback; //導入方法依賴的package包/類
private void showDetails(InputEvent evt, double x, double y) {
DateControl control = getDateControl();
/*
* We might run in the sampler application. Then the entry view will not
* be inside a date control.
*/
if (control != null && getParent() != null) {
Callback<EntryDetailsParameter, Boolean> callback = control.getEntryDetailsCallback();
EntryDetailsParameter param = new EntryDetailsParameter(evt, control, getEntry(), getParent(), x, y);
callback.call(param);
}
}
示例8: createCalendarSource
import javafx.util.Callback; //導入方法依賴的package包/類
/**
* Creates a new calendar source that will be added to the list of calendar
* sources of this date control. The method delegates the actual creation of
* the calendar source to a factory, which can be specified by calling
* {@link #setCalendarSourceFactory(Callback)}.
*
* @see #setCalendarSourceFactory(Callback)
*/
public final void createCalendarSource() {
Callback<CreateCalendarSourceParameter, CalendarSource> factory = getCalendarSourceFactory();
if (factory != null) {
CreateCalendarSourceParameter param = new CreateCalendarSourceParameter(this);
CalendarSource calendarSource = factory.call(param);
if (calendarSource != null && !getCalendarSources().contains(calendarSource)) {
getCalendarSources().add(calendarSource);
}
}
}
示例9: doEditEntry
import javafx.util.Callback; //導入方法依賴的package包/類
private void doEditEntry(Entry<?> entry) {
EntryViewBase<?> entryView = findEntryView(entry);
if (entryView != null) {
entryView.bounce();
Point2D localToScreen = entryView.localToScreen(0, 0);
Callback<EntryDetailsParameter, Boolean> callback = getEntryDetailsCallback();
EntryDetailsParameter param = new EntryDetailsParameter(null, this, entry, entryView, localToScreen.getX(), localToScreen.getY());
callback.call(param);
}
}
示例10: updateEntries
import javafx.util.Callback; //導入方法依賴的package包/類
@Override
public void updateEntries(List<Entry<?>> entries) {
getStyleClass().removeAll(USAGE_VERY_LOW, USAGE_LOW, USAGE_MEDIUM, USAGE_HIGH, USAGE_VERY_HIGH);
int entryCount = 0;
if (entries != null) {
entryCount = entries.size();
}
final Callback<Integer, DateControl.Usage> usagePolicy = getView().getUsagePolicy();
switch (usagePolicy.call(entryCount)) {
case NONE:
break;
case VERY_LOW:
getStyleClass().add(USAGE_VERY_LOW);
break;
case LOW:
getStyleClass().add(USAGE_LOW);
break;
case MEDIUM:
getStyleClass().add(USAGE_MEDIUM);
break;
case HIGH:
getStyleClass().add(USAGE_HIGH);
break;
case VERY_HIGH:
default:
getStyleClass().add(USAGE_VERY_HIGH);
break;
}
}
示例11: showDateDetails
import javafx.util.Callback; //導入方法依賴的package包/類
private void showDateDetails(LocalDate date) {
DateCell cell = cellMap.get(date);
Bounds bounds = cell.localToScreen(cell.getLayoutBounds());
Callback<DateControl.DateDetailsParameter, Boolean> callback = getSkinnable().getDateDetailsCallback();
DateControl.DateDetailsParameter param = new DateControl.DateDetailsParameter(null, getSkinnable(), cell, date, bounds.getMinX(), bounds.getMinY());
callback.call(param);
}
示例12: createNode
import javafx.util.Callback; //導入方法依賴的package包/類
private Node createNode(Entry<?> entry) {
Callback<Entry<?>, MonthEntryView> factory = getSkinnable().getEntryViewFactory();
MonthEntryView view = factory.call(entry);
view.getProperties().put("control", getSkinnable()); //$NON-NLS-1$
view.getProperties().put("startDate", date); //$NON-NLS-1$
view.getProperties().put("endDate", date); //$NON-NLS-1$
Position position = Position.ONLY;
if (entry.isFullDay()) {
if (date.isBefore(entry.getEndDate()) && (day == 0 || (date.equals(entry.getStartDate())))) {
position = Position.FIRST;
} else if (entry.isMultiDay() && date.equals(entry.getEndDate())) {
position = Position.LAST;
} else if (entry.isMultiDay()) {
position = Position.MIDDLE;
}
} else if (entry.isMultiDay()) {
if (day == 0 || (date.equals(entry.getStartDate()) && date.isBefore(entry.getEndDate()))) {
position = Position.FIRST;
} else if (date.equals(entry.getEndDate())) {
position = Position.LAST;
} else {
position = Position.MIDDLE;
}
}
view.getProperties().put("position", position); //$NON-NLS-1$
return view;
}
示例13: TableViewExt
import javafx.util.Callback; //導入方法依賴的package包/類
public TableViewExt(TableView<T> tableView) {
this.tableView = tableView;
// Callback to monitor row creation and to identify visible screen rows
final Callback<TableView<T>, TableRow<T>> rf = tableView.getRowFactory();
final Callback<TableView<T>, TableRow<T>> modifiedRowFactory = param -> {
TableRow<T> r = rf != null ? rf.call(param) : new TableRow<>();
// Save row, this implementation relies on JaxaFX re-using TableRow efficiently
// TODO has been causing gui issues. I wonder if it's because rows are never removed
rows.add(r);
return r;
};
tableView.setRowFactory(modifiedRowFactory);
}
示例14: updateControl
import javafx.util.Callback; //導入方法依賴的package包/類
private void updateControl() {
pane.getChildren().clear();
pane.getColumnConstraints().clear();
// the day views
WeekDayHeaderView view = getSkinnable();
final int numberOfDays = view.getNumberOfDays();
Callback<WeekDayHeaderView, WeekDayCell> cellFactory = view.getCellFactory();
for (int i = 0; i < numberOfDays; i++) {
ColumnConstraints con = new ColumnConstraints();
con.setPercentWidth((double) 100 / (double) numberOfDays);
pane.getColumnConstraints().add(con);
WeekDayCell cell = cellFactory.call(view);
GridPane.setHgrow(cell, Priority.ALWAYS);
GridPane.setVgrow(cell, Priority.ALWAYS);
GridPane.setFillHeight(cell, true);
GridPane.setFillWidth(cell, true);
final int dayCount = i;
/*
* TODO: listener must be removed when number of days change.
*/
view.dateProperty().addListener(evt -> updateCell(cell, dayCount));
updateCell(cell, dayCount);
pane.add(cell, i, 0);
}
}
示例15: updateItem
import javafx.util.Callback; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override public void updateItem(T item, boolean empty) {
super.updateItem(item, empty);
if (! empty) {
StringConverter<T> c = getConverter();
Callback<T, ObservableValue<Boolean>> callback = getSelectedStateCallback();
if (callback == null) {
throw new NullPointerException(
"The CheckBoxListCell selectedStateCallbackProperty can not be null");
}
setGraphic(checkBox);
setText(c != null ? c.toString(item) : (item == null ? "" : item.toString()));
if (booleanProperty != null) {
checkBox.selectedProperty().unbindBidirectional((BooleanProperty)booleanProperty);
}
booleanProperty = callback.call(item);
if (booleanProperty != null) {
checkBox.selectedProperty().bindBidirectional((BooleanProperty)booleanProperty);
}
} else {
setGraphic(null);
setText(null);
}
}