@Override public void initialize(URL location, ResourceBundle resources) { model = new RNAXDModel(); setFileDependingButtonBindings(); bindMenuItemsToButtons(); model.setFileLoaded(false); reloadItem.setSelected(false); selectionFocusItem.setSelected(false); initFileChooser(); setFileOpenedBinding(); }
/** * Mètode que canvia les unitats i mostra les seves dades * * @param actionEvent */ public void changeUnits(ActionEvent actionEvent) { CheckMenuItem men = (CheckMenuItem) actionEvent.getSource(); switch (men.getId()) { case "mts": units = 0; ipr.setSelected(false); break; case "ipr": units = 1; mts.setSelected(false); break; } setData(city, units); }
/** * Mètode que canvia la ciutat i mostra les seves dades * * @param actionEvent */ public void changeCity(ActionEvent actionEvent) { CheckMenuItem men = (CheckMenuItem) actionEvent.getSource(); switch (men.getId()) { case "bcn": city = "Barcelona"; mdd.setSelected(false); break; case "mdd": city = "Madrid"; bcn.setSelected(false); break; } setData(city, units); }
private void selectionFocusBinding() { if (selectionFocusItem.isSelected()) { selectionModel.getSelectedItems().addListener(selectionFocusListener); } selectionFocusItem .selectedProperty() .addListener( (observable, oldValue, newValue) -> { if (newValue == oldValue) return; if (newValue && !oldValue) { selectionModel.getSelectedItems().addListener(selectionFocusListener); } else { selectionModel.getSelectedItems().removeListener(selectionFocusListener); } }); }
private void setFileDependingButtonBindings() { // MenuItems pyrpurItem.disableProperty().bind(model.fileLoadedProperty().not()); augcItem.disableProperty().bind(model.fileLoadedProperty().not()); meshItem.disableProperty().bind(model.fileLoadedProperty().not()); stickItem.disableProperty().bind(model.fileLoadedProperty().not()); ballItem.disableProperty().bind(model.fileLoadedProperty().not()); // Buttons on the side colorPyrpur.disableProperty().bind(model.fileLoadedProperty().not()); colorAugc.disableProperty().bind(model.fileLoadedProperty().not()); structureMesh.disableProperty().bind(model.fileLoadedProperty().not()); structureStick.disableProperty().bind(model.fileLoadedProperty().not()); structureBall.disableProperty().bind(model.fileLoadedProperty().not()); playRotate.disableProperty().bind(model.fileLoadedProperty().not()); rotateLeft.disableProperty().bind(model.fileLoadedProperty().not()); rotateRight.disableProperty().bind(model.fileLoadedProperty().not()); zoomIn.disableProperty().bind(model.fileLoadedProperty().not()); zoomOut.disableProperty().bind(model.fileLoadedProperty().not()); centerObject.disableProperty().bind(model.fileLoadedProperty().not()); }
/** initialize tertiary structure view */ private void initTertiaryView() { Group models3D = new Group(); rnaSequence3D = new RNASequence(model.getPdbfile()); if (tertiaryRoom == null) { tertiaryRoom = new Room(models3D, 50, 50); tertiaryRoom.rotateCamera(tertiaryRoom); tertiaryRoom.scaleCamera(scene); tertiaryRoom.alignToParent(pane3D); tertiaryRoom.setPickOnBounds(false); pane3D.getChildren().add(tertiaryRoom); } else { tertiaryRoom.setObject(rnaSequence3D); } if (reloadItem.isSelected()) loadOneModel(0); if (!reloadItem.isSelected()) loadAllmodels(); ((MeshModel) rnaSequence3D.getModels().get(1)).colorPyrPur(); rnaSequence3D.setSelectionModel(selectionModel); tertiaryRoom.setCameraCenter(rnaSequence3D.computeCenter()); activateRightSideButtons(); }
protected void handleRadioGroups() { clearGroups(); for (int i = 0; i < getItemCount(); i++) { Object obj = getItem(i); if (obj instanceof CheckMenuItem) { CheckMenuItem check = (CheckMenuItem) obj; if (check.getGroup() != null) { El g = getGroup(check.getGroup()); Accessibility.setState( g.dom, "aria-owns", g.dom.getAttribute("aria-owns") + " " + check.getId()); if (check.getAriaGroupTitle() != null) { g.dom.setTitle(check.getAriaGroupTitle()); } } } } }
public ArchiveView(final ArchiveHandler archiveHandler, ListStore<Device> deviceStore) { this.archiveHandler = archiveHandler; deviceStore.addStoreHandlers(deviceStoreHandlers); this.deviceStore = deviceStore; DeviceProperties deviceProperties = GWT.create(DeviceProperties.class); deviceCombo = new ComboBox<Device>(deviceStore, deviceProperties.label()); // Element that displays the current track color styleButtonTrackColor = new TextButton(); styleButtonTrackColor .getElement() .getStyle() .setProperty("backgroundColor", "#".concat(style.DEFAULT_COLOR)); styleButtonTrackColor.getElement().getStyle().setCursor(Style.Cursor.TEXT); // Menu with the small palette smallColorMenu = new ExtColorMenu(ArchiveStyle.COLORS, ArchiveStyle.COLORS); smallColorMenu.setColor(ArchiveStyle.DEFAULT_COLOR); smallColorMenu .getPalette() .addValueChangeHandler( new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { style.setTrackColor(event.getValue()); smallColorMenu.hide(true); fullColorMenu.getPalette().setValue("", false); styleButtonTrackColor .getElement() .getStyle() .setProperty("backgroundColor", "#".concat(style.getTrackColor())); } }); // Menu with the complete palette fullColorMenu = new ColorMenu(); fullColorMenu .getPalette() .addValueChangeHandler( new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { style.setTrackColor(event.getValue()); fullColorMenu.hide(true); smallColorMenu.getPalette().setValue("", false); styleButtonTrackColor .getElement() .getStyle() .setProperty("backgroundColor", "#".concat(style.getTrackColor())); } }); // Markers routeMarkersType = new Menu(); for (Object[] obj : new Object[][] { {i18n.noMarkers(), null}, {i18n.standardMarkers(), PositionIconType.iconArchive}, {i18n.reducedMarkers(), PositionIconType.dotArchive} }) { CheckMenuItem item = new CheckMenuItem((String) obj[0]); final PositionIconType iconType = (PositionIconType) obj[1]; item.setGroup("markers"); item.setChecked( iconType == ApplicationContext.getInstance().getUserSettings().getArchiveMarkerType()); if (item.isChecked()) { style.setIconType(iconType); } item.addSelectionHandler( new SelectionHandler<Item>() { @Override public void onSelection(SelectionEvent<Item> event) { style.setIconType(iconType); archiveHandler.onChangeArchiveMarkerType(iconType); } }); routeMarkersType.add(item); } devicesTabs = new TabPanel(GWT.<TabPanel.TabPanelAppearance>create(BlueTabPanelBottomAppearance.class)); archivePanels = new HashMap<Long, ArchivePanel>(); uiBinder.createAndBindUi(this); markersMenu.setText(i18n.overlayType(UserSettings.OverlayType.MARKERS)); // Initialize with current time long min = 60 * 1000; Date now = new Date(); Date to = new Date(((now.getTime() + 15 * min) / (15 * min)) * 15 * min); Date from = new Date(to.getTime() - 60 * min); fromDate.setValue(from); fromTime.setValue(from); toDate.setValue(to); toTime.setValue(to); }
public void configureStorage(Event evt) { withDatabase = cmDatabase.isSelected(); }
private void bindMenuItemsToButtons() { pyrpurItem.selectedProperty().bindBidirectional(colorPyrpur.selectedProperty()); augcItem.selectedProperty().bindBidirectional(colorAugc.selectedProperty()); meshItem.selectedProperty().bindBidirectional(structureMesh.selectedProperty()); stickItem.selectedProperty().bindBidirectional(structureStick.selectedProperty()); }