Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bool Button: Handle runtime changes of on/off_image #2114

Merged
merged 1 commit into from
Jan 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Bool Button: Handle runtime changes of on/off_image
Need to actually show the updated image for the current value
  • Loading branch information
Kay committed Jan 26, 2022
commit 476cdc676f7dfdccefcc4798a1f28a8f8cb01973
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015-2020 Oak Ridge National Laboratory.
* Copyright (c) 2015-2022 Oak Ridge National Laboratory.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -12,7 +12,6 @@
import java.util.List;
import java.util.logging.Level;

import javafx.scene.layout.Pane;
import org.csstudio.display.builder.model.DirtyFlag;
import org.csstudio.display.builder.model.DisplayModel;
import org.csstudio.display.builder.model.UntypedWidgetPropertyListener;
Expand All @@ -32,6 +31,7 @@
import javafx.scene.control.ButtonBase;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.paint.CycleMethod;
import javafx.scene.paint.LinearGradient;
Expand Down Expand Up @@ -268,6 +268,8 @@ private void imagesChanged(final WidgetProperty<?> property, final Object old_va
loadImage(model_widget.propOffImage().getValue()),
loadImage(model_widget.propOnImage().getValue())
};
// The 'value_image' needs to be updated
stateChanged();
}

private ImageView loadImage(final String path)
Expand Down