mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
Added close button for widgets III
This commit is contained in:
parent
9ca7d18fff
commit
8110246b86
@ -81,14 +81,16 @@ public class Widget extends JPanel implements
|
|||||||
//nothing to do
|
//nothing to do
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Visibility visibility =
|
if(visibleProperty.isEnabled()) {
|
||||||
Visibility.valueOf(visibilityProperty.getValue());
|
Visibility visibility =
|
||||||
if (visibility.isStronglyColored()) {
|
Visibility.valueOf(visibilityProperty.getValue());
|
||||||
visibilityProperty
|
if (visibility.isStronglyColored()) {
|
||||||
.setValue(Visibility.WEAKLY_COLORED.name());
|
visibilityProperty
|
||||||
} else {
|
.setValue(Visibility.WEAKLY_COLORED.name());
|
||||||
visibilityProperty
|
} else {
|
||||||
.setValue(Visibility.STRONGLY_COLORED.name());
|
visibilityProperty
|
||||||
|
.setValue(Visibility.STRONGLY_COLORED.name());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,6 +120,17 @@ public class Widget extends JPanel implements
|
|||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setVisible(boolean aFlag) {
|
||||||
|
if(visibleProperty.isEnabled() && !aFlag) {
|
||||||
|
super.setVisible(false);
|
||||||
|
}
|
||||||
|
if(visibleProperty.isDisabled() && aFlag) {
|
||||||
|
super.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public final void setDonePercent(double donePercent) {
|
public final void setDonePercent(double donePercent) {
|
||||||
if (donePercent > 1) {
|
if (donePercent > 1) {
|
||||||
donePercent = 1;
|
donePercent = 1;
|
||||||
@ -135,11 +148,12 @@ public class Widget extends JPanel implements
|
|||||||
@Override
|
@Override
|
||||||
public final void paintComponent(Graphics brush) {
|
public final void paintComponent(Graphics brush) {
|
||||||
super.paintComponent(brush);
|
super.paintComponent(brush);
|
||||||
setVisible(visibleProperty.isEnabled());
|
|
||||||
|
System.out.println("widget.visibleProperty=" + visibleProperty.isEnabled());
|
||||||
|
|
||||||
Visibility visibility =
|
Visibility visibility =
|
||||||
Visibility.valueOf(visibilityProperty.getValue());
|
Visibility.valueOf(visibilityProperty.getValue());
|
||||||
this.setVisible(visibility != Visibility.NONE);
|
super.setVisible(visibility != Visibility.NONE && visibleProperty.isEnabled());
|
||||||
paintWidget(brush);
|
paintWidget(brush);
|
||||||
|
|
||||||
if (mouseOver && mouseOverCloseButton) {
|
if (mouseOver && mouseOverCloseButton) {
|
||||||
|
@ -109,5 +109,8 @@ public class Property<T> {
|
|||||||
public void removeListener(ChangeListener<T> listener) {
|
public void removeListener(ChangeListener<T> listener) {
|
||||||
this.changeListeners.remove(listener);
|
this.changeListeners.remove(listener);
|
||||||
}
|
}
|
||||||
|
public String toString() {
|
||||||
|
return String.valueOf(getValue());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user