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
|
||||
return;
|
||||
}
|
||||
Visibility visibility =
|
||||
Visibility.valueOf(visibilityProperty.getValue());
|
||||
if (visibility.isStronglyColored()) {
|
||||
visibilityProperty
|
||||
.setValue(Visibility.WEAKLY_COLORED.name());
|
||||
} else {
|
||||
visibilityProperty
|
||||
.setValue(Visibility.STRONGLY_COLORED.name());
|
||||
if(visibleProperty.isEnabled()) {
|
||||
Visibility visibility =
|
||||
Visibility.valueOf(visibilityProperty.getValue());
|
||||
if (visibility.isStronglyColored()) {
|
||||
visibilityProperty
|
||||
.setValue(Visibility.WEAKLY_COLORED.name());
|
||||
} else {
|
||||
visibilityProperty
|
||||
.setValue(Visibility.STRONGLY_COLORED.name());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,6 +120,17 @@ public class Widget extends JPanel implements
|
||||
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) {
|
||||
if (donePercent > 1) {
|
||||
donePercent = 1;
|
||||
@ -135,11 +148,12 @@ public class Widget extends JPanel implements
|
||||
@Override
|
||||
public final void paintComponent(Graphics brush) {
|
||||
super.paintComponent(brush);
|
||||
setVisible(visibleProperty.isEnabled());
|
||||
|
||||
System.out.println("widget.visibleProperty=" + visibleProperty.isEnabled());
|
||||
|
||||
Visibility visibility =
|
||||
Visibility.valueOf(visibilityProperty.getValue());
|
||||
this.setVisible(visibility != Visibility.NONE);
|
||||
super.setVisible(visibility != Visibility.NONE && visibleProperty.isEnabled());
|
||||
paintWidget(brush);
|
||||
|
||||
if (mouseOver && mouseOverCloseButton) {
|
||||
|
@ -109,5 +109,8 @@ public class Property<T> {
|
||||
public void removeListener(ChangeListener<T> listener) {
|
||||
this.changeListeners.remove(listener);
|
||||
}
|
||||
public String toString() {
|
||||
return String.valueOf(getValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user