/**
* Constructs a new {@link JobPolicyPanel}.
* @param configuration the {@link BuildWallConfiguration}.
* @param styling the {@link JavaFxStyle} to apply.
* @param defaults the {@link ConfigurationPanelDefaults}.
*/
JobPolicyPanel( BuildWallConfiguration configuration, JavaFxStyle styling, ConfigurationPanelDefaults defaults ) {
this.configuration = configuration;
this.styling = styling;
labels = new HashMap<>();
boxes = new HashMap<>();
properties = new HashMap<>();
defaults.configureColumnConstraints( this );
constructLayout();
configuration.jobPolicies().addListener( ( Change< ? extends JenkinsJob, ? extends BuildWallJobPolicy > change ) -> {
if ( !labels.containsKey( change.getKey() ) ) {
constructLayout();
} else {
boxes.get( change.getKey() ).getSelectionModel().select( change.getValueAdded() );
}
} );
}
java类javafx.collections.MapChangeListener.Change的实例源码
JobPolicyPanel.java 文件源码
项目:JttDesktop
阅读 26
收藏 0
点赞 0
评论 0
GetArtist.java 文件源码
项目:jmusic
阅读 22
收藏 0
点赞 0
评论 0
private void createMedia() {
try {
media = new Media("http://traffic.libsyn.com/dickwall/JavaPosse373.mp3");
media.getMetadata().addListener(new MapChangeListener<String, Object>() {
@Override
public void onChanged(Change<? extends String, ? extends Object> ch) {
if (ch.wasAdded()) {
handleMetadata(ch.getKey(), ch.getValueAdded());
}
}
});
// mediaPlayer = new MediaPlayer(media);
// mediaPlayer.setOnError(new Runnable() {
// @Override
// public void run() {
// final String errorMessage = media.getError().getMessage();
// // Handle errors during playback
// System.out.println("MediaPlayer Error: " + errorMessage);
// }
// });
//
// mediaPlayer.play();
} catch (RuntimeException re) {
// Handle construction errors
System.out.println("Caught Exception: " + re.getMessage());
}
}
CalendarView.java 文件源码
项目:CalendarFX
阅读 31
收藏 0
点赞 0
评论 0
/**
* Constructs a new calendar view.
*/
public CalendarView() {
getStyleClass().add(DEFAULT_STYLE_CLASS);
this.dayPage = new DayPage();
this.weekPage = new WeekPage();
this.monthPage = new MonthPage();
this.yearPage = new YearPage();
this.searchField = (CustomTextField) TextFields.createClearableTextField();
this.sourceView = new SourceView();
this.searchResultView = new SearchResultView();
this.yearMonthView = new YearMonthView();
if (Boolean.getBoolean("calendarfx.developer")) { //$NON-NLS-1$
this.developerConsole = new DeveloperConsole();
this.developerConsole.setDateControl(this);
}
selectedPage.set(dayPage);
Bindings.bindBidirectional(searchField.visibleProperty(), showSearchFieldProperty());
/*
* We do have a user agent stylesheet, but it doesn't seem to work
* properly when run as a standalone jar file.
*/
getStylesheets().add(CalendarView.class.getResource("calendar.css").toExternalForm()); //$NON-NLS-1$
/*
* We are "abusing" the properties map to pass new values of read-only
* properties from the skin to the control.
*/
getProperties().addListener((Change<?, ?> change) -> {
if (change.getKey().equals(SELECTED_PAGE)) {
if (change.getValueAdded() != null) {
PageBase page = (PageBase) change.getValueAdded();
selectedPage.set(page);
getProperties().remove(SELECTED_PAGE);
}
}
});
InvalidationListener fixSelectedPageListener = it -> fixSelectedPage();
dayPage.hiddenProperty().addListener(fixSelectedPageListener);
weekPage.hiddenProperty().addListener(fixSelectedPageListener);
monthPage.hiddenProperty().addListener(fixSelectedPageListener);
yearPage.hiddenProperty().addListener(fixSelectedPageListener);
fixSelectedPage();
}
CalendarView.java 文件源码
项目:JProCalendarFX
阅读 34
收藏 0
点赞 0
评论 0
/**
* Constructs a new uk.co.senapt.desktop.ui.modules.calendar view.
*/
public CalendarView() {
getStyleClass().add(DEFAULT_STYLE_CLASS);
this.dayPage = new DayPage();
bind(dayPage, true);
this.sourceView = new SourceView();
this.searchResultView = new SearchResultView();
this.yearMonthView = new YearMonthView();
if (Boolean.getBoolean("calendarfx.developer")) { //$NON-NLS-1$
this.developerConsole = new DeveloperConsole();
this.developerConsole.setDateControl(this);
}
selectedPage.set(dayPage);
/*
* We do have a user agent stylesheet, but it doesn't seem to work
* properly when run as a standalone jar file.
*/
getStylesheets().add(com.calendarfx.view.CalendarView.class.getResource("calendar.css").toExternalForm()); //$NON-NLS-1$
/*
* We are "abusing" the properties map to pass new values of read-only
* properties from the skin to the control.
*/
getProperties().addListener((Change<?, ?> change) -> {
if (change.getKey().equals(SELECTED_PAGE)) {
if (change.getValueAdded() != null) {
PageBase page = (PageBase) change.getValueAdded();
selectedPage.set(page);
getProperties().remove(SELECTED_PAGE);
}
}
});
dayPage.hiddenProperty().addListener(fixSelectedPageListener);
dayPage.setDayPageLayout(DayPageLayout.DAY_ONLY);
fixSelectedPage();
setTraysAnimated(false);
getYearMonthView().setShowWeekNumbers(false);
}
MediaInfo.java 文件源码
项目:fx-player
阅读 24
收藏 0
点赞 0
评论 0
void onChanged(MediaInfo info, Media media,
Change<? extends String, ? extends Object> change);