Skip to content

Commit

Permalink
New menu and about, now as panels (looks pretty)
Browse files Browse the repository at this point in the history
  • Loading branch information
LabunskyA committed Jan 31, 2015
1 parent 6c5f17e commit 2f7c80c
Show file tree
Hide file tree
Showing 3 changed files with 247 additions and 284 deletions.
257 changes: 0 additions & 257 deletions Sources/Dialogs.java

This file was deleted.

67 changes: 63 additions & 4 deletions Sources/Listeners.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,76 @@ class Settings implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
if (!Window.settingsIsOpen) {
SettingsDialog settingsDialog = new SettingsDialog();
settingsDialog.ShowSettingsDialog();
Window.settingsPanel.setVisible(true);
Window.settingsIsOpen = true;
} else {
String value = SettingsPanel.widthScan.getText();
if (value.length() == 0) {
Window.currentResolution = false;
Window.moreThanX = false;
Window.lessThanX = false;
Window.customResolution = new Dimension(0, Window.customResolution.height);
} else {
Window.currentResolution = true;
if (value.contains(">")) {
Window.moreThanX = true;
value = value.substring(1);
}
else Window.moreThanX = false;
if (value.contains("<")) {
Window.lessThanX = true;
value = value.substring(1);
}
else Window.lessThanX = false;
Window.customResolution = new Dimension(Integer.valueOf(value), Window.customResolution.height);
}

value = SettingsPanel.heightScan.getText();
if (value.length() == 0) {
Window.currentResolution = false;
Window.moreThanY = false;
Window.lessThanY = false;
Window.customResolution = new Dimension(Window.customResolution.width, 0);
} else {
Window.currentResolution = true;
if (value.contains(">")) {
Window.moreThanY = true;
value = value.substring(1);
}
else Window.moreThanY = false;
if (value.contains("<")) {
Window.lessThanY = true;
value = value.substring(1);
}
else Window.lessThanY = false;
Window.customResolution = new Dimension(Window.customResolution.width, Integer.valueOf(value));
}

if (SettingsPanel.tag.getText().length() == 0) {
Window.useTag = false;
Window.tag = "";
} else {
Window.useTag = true;
Window.tag = SettingsPanel.tag.getText().toLowerCase();
}

Window.settingsPanel.setVisible(false);
Window.settingsIsOpen = false;
}
}
}

class About implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
AboutDialog aboutNya = new AboutDialog();
aboutNya.ShowAbout();
if (!Window.aboutIsOpen) {
Window.aboutPanel.setVisible(true);
Window.aboutIsOpen = !Window.aboutIsOpen;
}
else {
Window.aboutPanel.setVisible(false);
Window.aboutIsOpen = !Window.aboutIsOpen;
}
}
}

Expand Down
Loading

0 comments on commit 2f7c80c

Please sign in to comment.