public void reset(NoticeBoardMenu menu) { NoticeBoardMenu last = noticeBoardMenu.getLast(); Preconditions.checkArgument(menu.getType() == last.getType(), "The displayed menu has a different type than the one to replace it with."); noticeBoardMenu.removeLast(); addMenu(menu); }
public NoticeBoard() { setManaged(false); String cssFileName = NoticeBoard.class.getSimpleName()+".css"; URL resource = NoticeBoard.class.getResource(cssFileName); getStylesheets().add(resource.toExternalForm()); getStyleClass().add("noticeBoardText"); ScrollPane scrollPane = new ScrollPane(); scrollPane.setLayoutX(20); scrollPane.setLayoutY(11); scrollPane.setMaxWidth(DEFAULT_WIDTH); scrollPane.setMinWidth(216); scrollPane.setMaxHeight(216); scrollPane.setMinHeight(216); scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER); scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); nbScrollPane = new NoticeBoardScrollPaneContent(); scrollPane.setContent(nbScrollPane); getChildren().addAll(scrollPane); }
noticeBoard.setLayoutX(5); noticeBoard.setLayoutY(TOP_STATUS_HEIGHT+MAP_OVERVIEW_HEIGHT+MENU_HEIGHT+TOP_STATUS_HEIGHT+6);