javafx.beans.property.SimpleObjectProperty Java Examples

The following examples show how to use javafx.beans.property.SimpleObjectProperty. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OptionsStageViewPanel.java    From Quelea with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Create the stage view options panel.
 * @param bindings HashMap of bindings to setup after the dialog has been created
 */
OptionsStageViewPanel(HashMap<Field, ObservableValue> bindings) {
    this.bindings = bindings;
    ArrayList<String> textAlignment = new ArrayList<>();
    for (TextAlignment alignment : TextAlignment.values()) {
        textAlignment.add(alignment.toFriendlyString());
    }
    lineAlignmentList = FXCollections.observableArrayList(textAlignment);
    alignmentSelectionProperty = new SimpleObjectProperty<>(QueleaProperties.get().getStageTextAlignment());

    fontsList = FXCollections.observableArrayList(Utils.getAllFonts());
    fontSelectionProperty = new SimpleObjectProperty<>(QueleaProperties.get().getStageTextFont());
}
 
Example #2
Source File: User.java    From bisq-core with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void readPersisted() {
    UserPayload persisted = storage.initAndGetPersistedWithFileName("UserPayload", 100);
    userPayload = persisted != null ? persisted : new UserPayload();

    checkNotNull(userPayload.getPaymentAccounts(), "userPayload.getPaymentAccounts() must not be null");
    checkNotNull(userPayload.getAcceptedLanguageLocaleCodes(), "userPayload.getAcceptedLanguageLocaleCodes() must not be null");
    paymentAccountsAsObservable = FXCollections.observableSet(userPayload.getPaymentAccounts());
    currentPaymentAccountProperty = new SimpleObjectProperty<>(userPayload.getCurrentPaymentAccount());
    userPayload.setAccountId(String.valueOf(Math.abs(keyRing.getPubKeyRing().hashCode())));

    // language setup
    if (!userPayload.getAcceptedLanguageLocaleCodes().contains(LanguageUtil.getDefaultLanguageLocaleAsCode()))
        userPayload.getAcceptedLanguageLocaleCodes().add(LanguageUtil.getDefaultLanguageLocaleAsCode());
    String english = LanguageUtil.getEnglishLanguageLocaleCode();
    if (!userPayload.getAcceptedLanguageLocaleCodes().contains(english))
        userPayload.getAcceptedLanguageLocaleCodes().add(english);

    paymentAccountsAsObservable.addListener((SetChangeListener<PaymentAccount>) change -> {
        userPayload.setPaymentAccounts(new HashSet<>(paymentAccountsAsObservable));
        persist();
    });
    currentPaymentAccountProperty.addListener((ov) -> {
        userPayload.setCurrentPaymentAccount(currentPaymentAccountProperty.get());
        persist();
    });
}
 
Example #3
Source File: PainteraBaseView.java    From paintera with GNU General Public License v2.0 5 votes vote down vote up
/**
 *
 * @param numFetcherThreads number of threads used for {@link net.imglib2.cache.queue.FetcherThreads}
 * @param viewerOptions options passed down to {@link OrthogonalViews viewers}
 */
public PainteraBaseView(
		final int numFetcherThreads,
		final ViewerOptions viewerOptions,
		final KeyAndMouseConfig keyAndMouseBindings)
{
	super();
	this.sharedQueue = new SharedQueue(numFetcherThreads, 50);
	this.keyAndMouseBindings = keyAndMouseBindings;
	this.viewerOptions = viewerOptions
			.accumulateProjectorFactory(new CompositeProjectorPreMultiply.CompositeProjectorFactory(sourceInfo
					.composites()))
			// .accumulateProjectorFactory( new
			// ClearingCompositeProjector.ClearingCompositeProjectorFactory<>(
			// sourceInfo.composites(), new ARGBType() ) )
			.numRenderingThreads(Math.min(3, Math.max(1, Runtime.getRuntime().availableProcessors() / 3)));
	this.views = new OrthogonalViews<>(
			manager,
			this.sharedQueue,
			this.viewerOptions,
			viewer3D,
			s -> Optional.ofNullable(sourceInfo.getState(s)).map(SourceState::interpolationProperty).map(ObjectProperty::get).orElse(Interpolation.NLINEAR));
	this.allowedActionsProperty = new SimpleObjectProperty<>(DEFAULT_ALLOWED_ACTIONS);
	this.vsacUpdate = change -> views.setAllSources(visibleSourcesAndConverters);
	visibleSourcesAndConverters.addListener(vsacUpdate);
	LOG.debug("Meshes group={}", viewer3D.meshesGroup());
}
 
Example #4
Source File: ScheduleItem.java    From G-Earth with MIT License 5 votes vote down vote up
protected void construct(int index, boolean paused, Interval delay, HPacket packet, HMessage.Direction destination) {
    this.indexProperty = new SimpleIntegerProperty(index);
    this.pausedProperty = new SimpleBooleanProperty(paused);
    this.delayProperty = new SimpleObjectProperty<>(delay);
    this.packetProperty = new SimpleObjectProperty<>(packet);
    this.destinationProperty = new SimpleObjectProperty<>(destination);
}
 
Example #5
Source File: CObjectGridLineColumn.java    From Open-Lowcode with Eclipse Public License 2.0 5 votes vote down vote up
private void setValueFactory() {
	setCellValueFactory(new Callback<CellDataFeatures<CObjectGridLine<E>, E>, ObservableValue<E>>() {

		@Override
		public ObservableValue<E> call(javafx.scene.control.TableColumn.CellDataFeatures<CObjectGridLine<E>, E> p) {
			CObjectGridLine<E> line = p.getValue();
			return new SimpleObjectProperty<E>(line.getLabelObject());

		}

	});
}
 
Example #6
Source File: WorkScheduleEditorController.java    From OEE-Designer with MIT License 5 votes vote down vote up
private void initializeShiftEditor() {
	// bind to list of shifts
	tvShifts.setItems(shiftList);

	// table view row selection listener
	tvShifts.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> {
		if (newValue != null) {
			try {
				onSelectShift(newValue);
			} catch (Exception e) {
				AppUtils.showErrorDialog(e);
			}
		}
	});

	// shift table callbacks
	// shift name
	shiftNameColumn.setCellValueFactory(cellDataFeatures -> {
		return new SimpleStringProperty(cellDataFeatures.getValue().getName());
	});

	// shift description
	shiftDescriptionColumn.setCellValueFactory(cellDataFeatures -> {
		return new SimpleStringProperty(cellDataFeatures.getValue().getDescription());
	});

	// shift start time
	shiftStartColumn.setCellValueFactory(cellDataFeatures -> {
		return new SimpleObjectProperty<LocalTime>(cellDataFeatures.getValue().getStart());
	});

	// shift duration
	shiftDurationColumn.setCellValueFactory(cellDataFeatures -> {
		return new SimpleStringProperty(
				AppUtils.stringFromDuration(cellDataFeatures.getValue().getDuration(), false));
	});
}
 
Example #7
Source File: AndroidPicturesService.java    From attach with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Optional<Image> loadImageFromGallery() {
    result = new SimpleObjectProperty<>();
    selectPicture();
    try {
        Platform.enterNestedEventLoop(result);
    } catch (Exception e) {
        LOG.severe("GalleryActivity: enterNestedEventLoop failed: " + e);
    }
    return Optional.ofNullable(result.get());
}
 
Example #8
Source File: TabTest.java    From WorkbenchFX with Apache License 2.0 5 votes vote down vote up
@Override
public void start(Stage stage) {
  MockitoAnnotations.initMocks(this);

  robot = new FxRobot();

  mockBench = mock(Workbench.class);

  for (int i = 0; i < moduleNodes.length; i++) {
    moduleNodes[i] = new Label("Module Content");
    moduleIcons[i] = new Label("Module Icon " + i);
  }

  for (int i = 0; i < mockModules.length; i++) {
    mockModules[i] = createMockModule(
        moduleNodes[i], moduleIcons[i], true, "Module " + i, mockBench,
        FXCollections.observableArrayList(), FXCollections.observableArrayList()
    );
  }

  modulesList = FXCollections.observableArrayList(mockModules);
  when(mockBench.getModules()).thenReturn(modulesList);
  activeModule = new SimpleObjectProperty<>();
  when(mockBench.activeModuleProperty()).thenReturn(activeModule);

  tab = new MockTab(mockBench);
  tab.setModule(mockModules[0]);

  Scene scene = new Scene(tab, 100, 100);
  stage.setScene(scene);
  stage.show();
}
 
Example #9
Source File: Tile.java    From WorkbenchFX with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs a new {@link Tile}.
 *
 * @param workbench which created this {@link Tile}
 */
public Tile(Workbench workbench) {
  this.workbench = workbench;
  module = new SimpleObjectProperty<>(this, "module");
  name = new SimpleStringProperty(this, "name");
  icon = new SimpleObjectProperty<>(this, "icon");
  setupModuleListeners();
  setupEventHandlers();
  getStyleClass().add("tile-control");
}
 
Example #10
Source File: MemoryInfoTableModel.java    From Noexes with GNU General Public License v3.0 5 votes vote down vote up
public MemoryInfoTableModel(String name, MemoryInfo info) {
    this.name = new SimpleStringProperty(name);
    this.addr = new SimpleLongProperty(info.getAddress());
    this.size = new SimpleLongProperty(info.getSize());
    this.end = Bindings.add(addr, size);
    this.type = new SimpleObjectProperty<>(info.getType());
    this.access = new SimpleIntegerProperty(info.getPerm());
}
 
Example #11
Source File: NameField.java    From paintera with GNU General Public License v2.0 5 votes vote down vote up
public NameField(final String name, final String prompt, final Effect errorEffect)
{
	this.nameField = new TextField("");
	this.nameField.setPromptText(prompt);
	this.errorEffect = errorEffect;
	this.noErrorEffect = this.nameField.getEffect();
	this.errorString = name + " not specified!";
	this.errorMessage = new SimpleObjectProperty<>(errorString);
	this.nameField.textProperty().addListener((obs, oldv, newv) -> {
		final boolean isError = Optional.ofNullable(newv).orElse("").length() > 0;
		this.errorMessage.set(!isError ? errorString : "");
		this.effectProperty.set(!isError ? this.errorEffect : noErrorEffect);
	});

	this.effectProperty.addListener((obs, oldv, newv) -> {
		if (!nameField.isFocused())
			nameField.setEffect(newv);
	});

	nameField.setEffect(this.effectProperty.get());

	nameField.focusedProperty().addListener((obs, oldv, newv) -> {
		if (newv)
			nameField.setEffect(this.noErrorEffect);
		else
			nameField.setEffect(effectProperty.get());
	});

	this.nameField.setText(null);

}
 
Example #12
Source File: TimeSection.java    From OEE-Designer with MIT License 4 votes vote down vote up
public ObjectProperty<Color> highlightColorProperty() {
    if (null == highlightColor) { highlightColor = new SimpleObjectProperty<>(TimeSection.this, "highlightColor", _highlightColor); }
    return highlightColor;
}
 
Example #13
Source File: TimeSection.java    From OEE-Designer with MIT License 4 votes vote down vote up
public ObjectProperty<LocalTime> startProperty() {
    if (null == start) { start = new SimpleObjectProperty<>(TimeSection.this, "start", _start); }
    return start;
}
 
Example #14
Source File: TileBuilder.java    From OEE-Designer with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public final B onThresholdExceeded(final TileEventListener HANDLER) {
       properties.put("onThresholdExceeded", new SimpleObjectProperty<>(HANDLER));
       return (B)this;
   }
 
Example #15
Source File: TileBuilder.java    From OEE-Designer with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public final B barBackgroundColor(final Color COLOR) {
       properties.put("barBackgroundColor", new SimpleObjectProperty<>(COLOR));
       return (B)this;
   }
 
Example #16
Source File: TileBuilder.java    From OEE-Designer with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public final B textAlignment(final TextAlignment ALIGNMENT) {
       properties.put("textAlignment", new SimpleObjectProperty(ALIGNMENT));
       return (B)this;
   }
 
Example #17
Source File: TileBuilder.java    From OEE-Designer with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public final B notificationBackgroundColor(final Color COLOR) {
       properties.put("notificationBackgroundColor", new SimpleObjectProperty(COLOR));
       return (B)this;
   }
 
Example #18
Source File: TileBuilder.java    From OEE-Designer with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public final B styleClass(final String... STYLES) {
       properties.put("styleClass", new SimpleObjectProperty<>(STYLES));
       return (B)this;
   }
 
Example #19
Source File: TileBuilder.java    From OEE-Designer with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public final B textSize(final TextSize SIZE) {
       properties.put("textSize", new SimpleObjectProperty(SIZE));
       return (B)this;
   }
 
Example #20
Source File: TileBuilder.java    From OEE-Designer with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public final B barColor(final Color COLOR) {
       properties.put("barColor", new SimpleObjectProperty<>(COLOR));
       return (B)this;
   }
 
Example #21
Source File: TimeSection.java    From OEE-Designer with MIT License 4 votes vote down vote up
public ObjectProperty<Color> colorProperty() {
    if (null == color) { color = new SimpleObjectProperty<>(TimeSection.this, "color", _color); }
    return color;
}
 
Example #22
Source File: TimeSection.java    From OEE-Designer with MIT License 4 votes vote down vote up
public ObjectProperty<Image> iconProperty() {
    if (null == icon) { icon = new SimpleObjectProperty<>(this, "icon", _icon); }
    return icon;
}
 
Example #23
Source File: TileBuilder.java    From OEE-Designer with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public final B pointsOfInterest(final List<Location> LOCATIONS) {
       properties.put("poiList", new SimpleObjectProperty(LOCATIONS));
       return (B)this;
   }
 
Example #24
Source File: TileBuilder.java    From OEE-Designer with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public final B duration(final LocalTime DURATION) {
       properties.put("duration", new SimpleObjectProperty(DURATION));
       return (B)this;
   }
 
Example #25
Source File: TileBuilder.java    From OEE-Designer with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public final B gradientStops(final List<Stop> STOPS) {
       properties.put("gradientStopsList", new SimpleObjectProperty(STOPS));
       return (B)this;
   }
 
Example #26
Source File: TileBuilder.java    From OEE-Designer with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public final B barChartItems(final BarChartItem... ITEMS) {
       properties.put("barChartItemsArray", new SimpleObjectProperty<>(ITEMS));
       return (B)this;
   }
 
Example #27
Source File: ScheduleItem.java    From G-Earth with MIT License 4 votes vote down vote up
public SimpleObjectProperty<Interval> getDelayProperty() {
    return delayProperty;
}
 
Example #28
Source File: PixelMatrixBuilder.java    From OEE-Designer with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public final B matrixFont(final MatrixFont FONT) {
       properties.put("matrixFont", new SimpleObjectProperty(FONT));
       return (B)this;
   }
 
Example #29
Source File: PixelMatrixBuilder.java    From OEE-Designer with MIT License 4 votes vote down vote up
@SuppressWarnings("unchecked")
public final B pixelShape(final PixelShape SHAPE) {
       properties.put("pixelShape", new SimpleObjectProperty(SHAPE));
       return (B)this;
   }
 
Example #30
Source File: WatchlistModel.java    From Noexes with GNU General Public License v3.0 4 votes vote down vote up
public SimpleObjectProperty<String> addrProperty() {
    return addr;
}