Skip to content

Commit

Permalink
Fixed expand all frame
Browse files Browse the repository at this point in the history
  • Loading branch information
Exslims committed Apr 15, 2017
1 parent d93f2b1 commit cec2da6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private static class ConfigManagerHolder {
@Getter
private boolean checkUpdateOnStartUp = true;
@Getter
private boolean dismissAfterKick = false;
private boolean dismissAfterKick = true;
@Getter
private boolean showLeague = false;
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private JPanel getSettingsSlidePanel(){
componentsFactory.getIconButton("app/open-tests.png",
30,
AppThemeColor.TRANSPARENT,
"Test frames");
"Open tests");
openTests.addActionListener(action -> {
FramesManager.INSTANCE.hideFrame(SettingsFrame.class);
FramesManager.INSTANCE.preShowFrame(TestCasesFrame.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void mouseEntered(MouseEvent e) {
}
});
}
private void changeVisible(FrameVisibleState state){
protected void changeVisible(FrameVisibleState state){
if (processingHideEvent) {
switch (state) {
case SHOW: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,11 @@ public void initHandlers() {
setUpExpandButton();
}
});
MercuryStore.INSTANCE.messageSubject.subscribe(message -> {
SwingUtilities.invokeLater(()-> {
if(!currentMessages.containsKey(message)) {
addMessage(message);
}
});
});
MercuryStore.INSTANCE.messageSubject.subscribe(message -> SwingUtilities.invokeLater(()-> {
if(!currentMessages.containsKey(message)) {
addMessage(message);
}
}));
EventRouter.UI.registerHandler(CloseMessagePanelEvent.class, event -> {
Message message = ((CloseMessagePanelEvent) event).getMessage();
MessagePanel panel = currentMessages.get(message);
Expand Down Expand Up @@ -197,7 +195,9 @@ private void addMessage(Message message){
messagePanel.setVisible(false);
}
if (mainContainer.getComponentCount() > limitMsgCount) {
setUpExpandButton();
if(AppStarter.APP_STATUS == FrameVisibleState.SHOW) {
setUpExpandButton();
}
expandAllFrame.incMessageCount();
}
break;
Expand All @@ -207,14 +207,24 @@ private void addMessage(Message message){
messagePanel.setVisible(false);
}
if (mainContainer.getComponentCount() > (limitMsgCount + 1)) {
setUpExpandButton();
if(AppStarter.APP_STATUS == FrameVisibleState.SHOW) {
setUpExpandButton();
}
expandAllFrame.incMessageCount();
}
break;
}
}
}

@Override
protected void changeVisible(FrameVisibleState state) {
super.changeVisible(state);
if(state.equals(FrameVisibleState.SHOW)) {
setUpExpandButton();
}
}

private void setUpExpandButton(){
if(!inScaleSettings && !inMoveMode && !dnd) {
switch (flowDirections) {
Expand Down Expand Up @@ -318,9 +328,8 @@ protected JPanel getPanelForPINSettings() {

private void onLimitCountChange(){
expandAllFrame.resetMessageCount();
Arrays.stream(mainContainer.getComponents()).forEach(component -> {
component.setVisible(true);
});
Arrays.stream(mainContainer.getComponents())
.forEach(component -> component.setVisible(true));
switch (flowDirections){
case DOWNWARDS:{
Component[] components = mainContainer.getComponents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import javax.swing.*;
import javax.swing.Timer;
import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.*;
Expand All @@ -32,7 +34,6 @@ public TestCasesFrame() {
nickNames = new ArrayList<>();
offer = new ArrayList<>();
leagues = new ArrayList<>();

items.add("Wondertrap Velvet Slippers");
items.add("Rain of Arrows");
items.add("Dreadarc Cleaver");
Expand Down

0 comments on commit cec2da6

Please sign in to comment.