Rename ConfidenceProgressIndicator to StaticProgressIndicator

This commit is contained in:
Manfred Karrer 2016-06-16 21:21:43 +02:00
parent 579ba301db
commit c9bf8a1e55
7 changed files with 67 additions and 67 deletions

View File

@ -20,7 +20,7 @@ package io.bitsquare.gui.components;
import io.bitsquare.btc.WalletService;
import io.bitsquare.btc.listeners.AddressConfidenceListener;
import io.bitsquare.btc.listeners.BalanceListener;
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
import io.bitsquare.gui.components.indicator.StaticProgressIndicator;
import io.bitsquare.gui.util.BSFormatter;
import javafx.scene.control.TextField;
import javafx.scene.control.Tooltip;
@ -46,7 +46,7 @@ public class BalanceWithConfirmationTextField extends AnchorPane {
private final TextField textField;
private final Tooltip progressIndicatorTooltip;
private final ConfidenceProgressIndicator progressIndicator;
private final StaticProgressIndicator progressIndicator;
private final Effect fundedEffect = new DropShadow(BlurType.THREE_PASS_BOX, Color.GREEN, 4, 0.0, 0, 0);
private final Effect notFundedEffect = new DropShadow(BlurType.THREE_PASS_BOX, Color.ORANGERED, 4, 0.0, 0, 0);
@ -62,7 +62,7 @@ public class BalanceWithConfirmationTextField extends AnchorPane {
textField.setFocusTraversable(false);
textField.setEditable(false);
progressIndicator = new ConfidenceProgressIndicator();
progressIndicator = new StaticProgressIndicator();
progressIndicator.setFocusTraversable(false);
progressIndicator.setPrefSize(24, 24);
progressIndicator.setId("funds-confidence");

View File

@ -22,7 +22,7 @@ import de.jensd.fx.fontawesome.AwesomeIcon;
import io.bitsquare.btc.WalletService;
import io.bitsquare.btc.listeners.TxConfidenceListener;
import io.bitsquare.common.util.Utilities;
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
import io.bitsquare.gui.components.indicator.StaticProgressIndicator;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.user.Preferences;
import javafx.scene.control.Label;
@ -50,7 +50,7 @@ public class TxIdTextField extends AnchorPane {
private final TextField textField;
private final Tooltip progressIndicatorTooltip;
private final ConfidenceProgressIndicator progressIndicator;
private final StaticProgressIndicator progressIndicator;
private final Label copyIcon;
private final Label blockExplorerIcon;
private TxConfidenceListener txConfidenceListener;
@ -61,7 +61,7 @@ public class TxIdTextField extends AnchorPane {
///////////////////////////////////////////////////////////////////////////////////////////
public TxIdTextField() {
progressIndicator = new ConfidenceProgressIndicator();
progressIndicator = new StaticProgressIndicator();
progressIndicator.setFocusTraversable(false);
progressIndicator.setPrefSize(24, 24);
progressIndicator.setId("funds-confidence");

View File

@ -23,9 +23,9 @@
* questions.
*/
package io.bitsquare.gui.components.confidence;
package io.bitsquare.gui.components.indicator;
import io.bitsquare.gui.components.confidence.skin.ConfidenceProgressIndicatorSkin;
import io.bitsquare.gui.components.indicator.skin.StaticProgressIndicatorSkin;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.DoublePropertyBase;
import javafx.beans.property.ReadOnlyBooleanProperty;
@ -67,7 +67,7 @@ import javafx.scene.control.Skin;
*/
@SuppressWarnings({"SameParameterValue", "WeakerAccess"})
public class ConfidenceProgressIndicator extends Control {
public class StaticProgressIndicator extends Control {
/**
* Value for progress indicating that the progress is indeterminate.
@ -121,7 +121,7 @@ public class ConfidenceProgressIndicator extends Control {
/**
* Creates a new indeterminate ProgressIndicator.
*/
public ConfidenceProgressIndicator() {
public StaticProgressIndicator() {
this(INDETERMINATE_PROGRESS);
}
@ -129,7 +129,7 @@ public class ConfidenceProgressIndicator extends Control {
* Creates a new ProgressIndicator with the given progress value.
*/
@SuppressWarnings("unchecked")
public ConfidenceProgressIndicator(double progress) {
public StaticProgressIndicator(double progress) {
// focusTraversable is styleable through css. Calling setFocusTraversable
// makes it look to css like the user set the value and css will not
// override. Initializing focusTraversable by calling applyStyle with null
@ -169,7 +169,7 @@ public class ConfidenceProgressIndicator extends Control {
@Override
public Object getBean() {
return ConfidenceProgressIndicator.this;
return StaticProgressIndicator.this;
}
@ -217,7 +217,7 @@ public class ConfidenceProgressIndicator extends Control {
@Override
public Object getBean() {
return ConfidenceProgressIndicator.this;
return StaticProgressIndicator.this;
}
@ -236,7 +236,7 @@ public class ConfidenceProgressIndicator extends Control {
@Override
protected Skin<?> createDefaultSkin() {
return new ConfidenceProgressIndicatorSkin(this);
return new StaticProgressIndicatorSkin(this);
}
/**

View File

@ -23,10 +23,10 @@
* questions.
*/
package io.bitsquare.gui.components.confidence.behavior;
package io.bitsquare.gui.components.indicator.behavior;
import com.sun.javafx.scene.control.behavior.BehaviorBase;
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
import io.bitsquare.gui.components.indicator.StaticProgressIndicator;
import java.util.Collections;
@ -36,7 +36,7 @@ import java.util.Collections;
/**
* @param <C>
*/
public class ConfidenceProgressIndicatorBehavior<C extends ConfidenceProgressIndicator> extends BehaviorBase<C> {
public class StaticProgressIndicatorBehavior<C extends StaticProgressIndicator> extends BehaviorBase<C> {
/**
* ************************************************************************
@ -46,7 +46,7 @@ public class ConfidenceProgressIndicatorBehavior<C extends ConfidenceProgressInd
* ************************************************************************
*/
public ConfidenceProgressIndicatorBehavior(final C progress) {
public StaticProgressIndicatorBehavior(final C progress) {
super(progress, Collections.emptyList());
}
}

View File

@ -23,14 +23,14 @@
* questions.
*/
package io.bitsquare.gui.components.confidence.skin;
package io.bitsquare.gui.components.indicator.skin;
import com.sun.javafx.css.converters.BooleanConverter;
import com.sun.javafx.css.converters.PaintConverter;
import com.sun.javafx.css.converters.SizeConverter;
import com.sun.javafx.scene.control.skin.BehaviorSkinBase;
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
import io.bitsquare.gui.components.confidence.behavior.ConfidenceProgressIndicatorBehavior;
import io.bitsquare.gui.components.indicator.StaticProgressIndicator;
import io.bitsquare.gui.components.indicator.behavior.StaticProgressIndicatorBehavior;
import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
import javafx.beans.property.BooleanProperty;
@ -58,8 +58,8 @@ import java.util.List;
// TODO Copied form OpenJFX, check license issues and way how we integrated it
// We changed behaviour which was not exposed via APIs
public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<ConfidenceProgressIndicator,
ConfidenceProgressIndicatorBehavior<ConfidenceProgressIndicator>> {
public class StaticProgressIndicatorSkin extends BehaviorSkinBase<StaticProgressIndicator,
StaticProgressIndicatorBehavior<StaticProgressIndicator>> {
/**
* ************************************************************************
@ -86,7 +86,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
@Override
public Object getBean() {
return ConfidenceProgressIndicatorSkin.this;
return StaticProgressIndicatorSkin.this;
}
@ -97,7 +97,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
@Override
public CssMetaData<ConfidenceProgressIndicator, Number> getCssMetaData() {
public CssMetaData<StaticProgressIndicator, Number> getCssMetaData() {
return StyleableProperties.INDETERMINATE_SEGMENT_COUNT;
}
};
@ -115,14 +115,14 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
@Override
public CssMetaData<ConfidenceProgressIndicator, Boolean> getCssMetaData() {
public CssMetaData<StaticProgressIndicator, Boolean> getCssMetaData() {
return StyleableProperties.SPIN_ENABLED;
}
@Override
public Object getBean() {
return ConfidenceProgressIndicatorSkin.this;
return StaticProgressIndicatorSkin.this;
}
@ -158,7 +158,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
@Override
public Object getBean() {
return ConfidenceProgressIndicatorSkin.this;
return StaticProgressIndicatorSkin.this;
}
@ -169,7 +169,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
@Override
public CssMetaData<ConfidenceProgressIndicator, Paint> getCssMetaData() {
public CssMetaData<StaticProgressIndicator, Paint> getCssMetaData() {
return StyleableProperties.PROGRESS_COLOR;
}
};
@ -183,8 +183,8 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
* ************************************************************************
*/
@SuppressWarnings("deprecation")
public ConfidenceProgressIndicatorSkin(ConfidenceProgressIndicator control) {
super(control, new ConfidenceProgressIndicatorBehavior<>(control));
public StaticProgressIndicatorSkin(StaticProgressIndicator control) {
super(control, new StaticProgressIndicatorBehavior<>(control));
InvalidationListener indeterminateListener = valueModel -> initialize();
control.indeterminateProperty().addListener(indeterminateListener);
@ -195,7 +195,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
if (getSkinnable().isIndeterminate() && timeLineNulled && spinner == null) {
timeLineNulled = false;
spinner = new IndeterminateSpinner(
getSkinnable(), ConfidenceProgressIndicatorSkin.this,
getSkinnable(), StaticProgressIndicatorSkin.this,
spinEnabled.get(), progressColor.get());
getChildren().add(spinner);
}
@ -225,7 +225,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
if (getSkinnable().getScene() != null && getSkinnable().isIndeterminate()) {
timeLineNulled = false;
spinner = new IndeterminateSpinner(
getSkinnable(), ConfidenceProgressIndicatorSkin.this,
getSkinnable(), StaticProgressIndicatorSkin.this,
spinEnabled.get(), progressColor.get());
getChildren().add(spinner);
getSkinnable().requestLayout();
@ -249,7 +249,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
@SuppressWarnings("deprecation")
private void initialize() {
ConfidenceProgressIndicator control = getSkinnable();
StaticProgressIndicator control = getSkinnable();
boolean isIndeterminate = control.isIndeterminate();
if (isIndeterminate) {
// clean up determinateIndicator
@ -265,7 +265,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
}
// create determinateIndicator
determinateIndicator =
new ConfidenceProgressIndicatorSkin.DeterminateIndicator(control, this, progressColor.get());
new StaticProgressIndicatorSkin.DeterminateIndicator(control, this, progressColor.get());
getChildren().clear();
getChildren().add(determinateIndicator);
}
@ -317,7 +317,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
//private double textGap = 2.0F;
private final ConfidenceProgressIndicator control;
private final StaticProgressIndicator control;
//private Text text;
private final StackPane indicator;
@ -334,7 +334,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
// only update pie arc to nearest degree
private int degProgress;
public DeterminateIndicator(ConfidenceProgressIndicator control, ConfidenceProgressIndicatorSkin s,
public DeterminateIndicator(StaticProgressIndicator control, StaticProgressIndicatorSkin s,
Paint fillOverride) {
this.control = control;
@ -534,8 +534,8 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
@SuppressWarnings("ConstantConditions")
static class IndeterminateSpinner extends Region {
private final ConfidenceProgressIndicator control;
private final ConfidenceProgressIndicatorSkin skin;
private final StaticProgressIndicator control;
private final StaticProgressIndicatorSkin skin;
private final IndicatorPaths pathsG;
@ -544,7 +544,7 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
private Paint fillOverride = null;
public IndeterminateSpinner(ConfidenceProgressIndicator control, ConfidenceProgressIndicatorSkin s,
public IndeterminateSpinner(StaticProgressIndicator control, StaticProgressIndicatorSkin s,
boolean spinEnabled, Paint fillOverride) {
this.control = control;
this.skin = s;
@ -678,63 +678,63 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase<Confidence
private static class StyleableProperties {
public static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES;
private static final CssMetaData<ConfidenceProgressIndicator, Paint> PROGRESS_COLOR =
new CssMetaData<ConfidenceProgressIndicator, Paint>(
private static final CssMetaData<StaticProgressIndicator, Paint> PROGRESS_COLOR =
new CssMetaData<StaticProgressIndicator, Paint>(
"-fx-progress-color", PaintConverter.getInstance(), null) {
@Override
public boolean isSettable(ConfidenceProgressIndicator n) {
final ConfidenceProgressIndicatorSkin skin = (ConfidenceProgressIndicatorSkin) n.getSkin();
public boolean isSettable(StaticProgressIndicator n) {
final StaticProgressIndicatorSkin skin = (StaticProgressIndicatorSkin) n.getSkin();
return skin.progressColor == null || !skin.progressColor.isBound();
}
@Override
public StyleableProperty<Paint> getStyleableProperty(ConfidenceProgressIndicator n) {
final ConfidenceProgressIndicatorSkin skin = (ConfidenceProgressIndicatorSkin) n.getSkin();
public StyleableProperty<Paint> getStyleableProperty(StaticProgressIndicator n) {
final StaticProgressIndicatorSkin skin = (StaticProgressIndicatorSkin) n.getSkin();
return (StyleableProperty<Paint>) skin.progressColor;
}
};
private static final CssMetaData<ConfidenceProgressIndicator, Number> INDETERMINATE_SEGMENT_COUNT =
new CssMetaData<ConfidenceProgressIndicator, Number>(
private static final CssMetaData<StaticProgressIndicator, Number> INDETERMINATE_SEGMENT_COUNT =
new CssMetaData<StaticProgressIndicator, Number>(
"-fx-indeterminate-segment-count", SizeConverter.getInstance(), 8) {
@Override
public void set(ConfidenceProgressIndicator node, Number value, StyleOrigin origin) {
public void set(StaticProgressIndicator node, Number value, StyleOrigin origin) {
super.set(node, value.intValue(), origin);
}
@Override
public boolean isSettable(ConfidenceProgressIndicator n) {
final ConfidenceProgressIndicatorSkin skin = (ConfidenceProgressIndicatorSkin) n.getSkin();
public boolean isSettable(StaticProgressIndicator n) {
final StaticProgressIndicatorSkin skin = (StaticProgressIndicatorSkin) n.getSkin();
return skin.indeterminateSegmentCount == null || !skin.indeterminateSegmentCount.isBound();
}
@Override
public StyleableProperty<Number> getStyleableProperty(ConfidenceProgressIndicator n) {
final ConfidenceProgressIndicatorSkin skin = (ConfidenceProgressIndicatorSkin) n.getSkin();
public StyleableProperty<Number> getStyleableProperty(StaticProgressIndicator n) {
final StaticProgressIndicatorSkin skin = (StaticProgressIndicatorSkin) n.getSkin();
return (StyleableProperty<Number>) skin.indeterminateSegmentCount;
}
};
private static final CssMetaData<ConfidenceProgressIndicator, Boolean> SPIN_ENABLED = new
CssMetaData<ConfidenceProgressIndicator, Boolean>("-fx-spin-enabled",
private static final CssMetaData<StaticProgressIndicator, Boolean> SPIN_ENABLED = new
CssMetaData<StaticProgressIndicator, Boolean>("-fx-spin-enabled",
BooleanConverter.getInstance(),
Boolean.FALSE) {
@Override
public boolean isSettable(ConfidenceProgressIndicator node) {
final ConfidenceProgressIndicatorSkin skin = (ConfidenceProgressIndicatorSkin) node.getSkin();
public boolean isSettable(StaticProgressIndicator node) {
final StaticProgressIndicatorSkin skin = (StaticProgressIndicatorSkin) node.getSkin();
return skin.spinEnabled == null || !skin.spinEnabled.isBound();
}
@Override
public StyleableProperty<Boolean> getStyleableProperty(ConfidenceProgressIndicator node) {
final ConfidenceProgressIndicatorSkin skin = (ConfidenceProgressIndicatorSkin) node.getSkin();
public StyleableProperty<Boolean> getStyleableProperty(StaticProgressIndicator node) {
final StaticProgressIndicatorSkin skin = (StaticProgressIndicatorSkin) node.getSkin();
return (StyleableProperty<Boolean>) skin.spinEnabled;
}
};

View File

@ -21,7 +21,7 @@ import io.bitsquare.btc.AddressEntry;
import io.bitsquare.btc.WalletService;
import io.bitsquare.btc.listeners.BalanceListener;
import io.bitsquare.btc.listeners.TxConfidenceListener;
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
import io.bitsquare.gui.components.indicator.StaticProgressIndicator;
import io.bitsquare.gui.util.BSFormatter;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
@ -39,7 +39,7 @@ public class DepositListItem {
private final StringProperty balance = new SimpleStringProperty();
private final WalletService walletService;
private Coin balanceAsCoin;
private final ConfidenceProgressIndicator progressIndicator;
private final StaticProgressIndicator progressIndicator;
private final Tooltip tooltip;
private String addressString;
private String usage = "-";
@ -52,7 +52,7 @@ public class DepositListItem {
addressString = addressEntry.getAddressString();
// confidence
progressIndicator = new ConfidenceProgressIndicator();
progressIndicator = new StaticProgressIndicator();
progressIndicator.setId("funds-confidence");
tooltip = new Tooltip("Not used yet");
progressIndicator.setProgress(0);
@ -124,7 +124,7 @@ public class DepositListItem {
}
}
public ConfidenceProgressIndicator getProgressIndicator() {
public StaticProgressIndicator getProgressIndicator() {
return progressIndicator;
}

View File

@ -19,7 +19,7 @@ package io.bitsquare.gui.main.funds.transactions;
import io.bitsquare.btc.WalletService;
import io.bitsquare.btc.listeners.TxConfidenceListener;
import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator;
import io.bitsquare.gui.components.indicator.StaticProgressIndicator;
import io.bitsquare.gui.util.BSFormatter;
import io.bitsquare.trade.Tradable;
import io.bitsquare.trade.Trade;
@ -40,7 +40,7 @@ public class TransactionsListItem {
private final Date date;
private final String txId;
private final WalletService walletService;
private final ConfidenceProgressIndicator progressIndicator;
private final StaticProgressIndicator progressIndicator;
private final Tooltip tooltip;
@Nullable
private Tradable tradable;
@ -111,7 +111,7 @@ public class TransactionsListItem {
}
// confidence
progressIndicator = new ConfidenceProgressIndicator();
progressIndicator = new StaticProgressIndicator();
progressIndicator.setId("funds-confidence");
tooltip = new Tooltip("Not used yet");
progressIndicator.setProgress(0);
@ -202,7 +202,7 @@ public class TransactionsListItem {
}
}
public ConfidenceProgressIndicator getProgressIndicator() {
public StaticProgressIndicator getProgressIndicator() {
return progressIndicator;
}