added newline at EOF for any file not having one at its end

This commit is contained in:
delvh 2020-03-14 19:59:37 +01:00
parent b46bfd1181
commit 99441b770f
15 changed files with 36 additions and 46 deletions

View File

@ -28,7 +28,7 @@
<dependency> <dependency>
<groupId>com.github.informatik-ag-ngl</groupId> <groupId>com.github.informatik-ag-ngl</groupId>
<artifactId>envoy-common</artifactId> <artifactId>envoy-common</artifactId>
<version>develop-SNAPSHOT</version> <version>f~forwarding_messages-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -61,12 +61,10 @@ public class Chat implements Serializable {
public void read(WriteProxy writeProxy) throws IOException { public void read(WriteProxy writeProxy) throws IOException {
for (int i = model.size() - 1; i >= 0; --i) { for (int i = model.size() - 1; i >= 0; --i) {
final Message m = model.get(i); final Message m = model.get(i);
if (m.getSenderId() == recipient.getId()) { if (m.getSenderId() == recipient.getId()) if (m.getStatus() == MessageStatus.READ) break;
if (m.getStatus() == MessageStatus.READ) break; else {
else { m.setStatus(MessageStatus.READ);
m.setStatus(MessageStatus.READ); writeProxy.writeMessageStatusChangeEvent(new MessageStatusChangeEvent(m));
writeProxy.writeMessageStatusChangeEvent(new MessageStatusChangeEvent(m));
}
} }
} }
} }
@ -89,4 +87,4 @@ public class Chat implements Serializable {
* @since Envoy v0.1-alpha * @since Envoy v0.1-alpha
*/ */
public User getRecipient() { return recipient; } public User getRecipient() { return recipient; }
} }

View File

@ -100,4 +100,4 @@ public class PersistentLocalDb extends LocalDb {
idGenerator = SerializationUtils.read(idGeneratorFile, IdGenerator.class); idGenerator = SerializationUtils.read(idGeneratorFile, IdGenerator.class);
} catch (ClassNotFoundException | IOException e) {} } catch (ClassNotFoundException | IOException e) {}
} }
} }

View File

@ -190,4 +190,4 @@ public class Settings {
* @since Envoy v0.3-alpha * @since Envoy v0.3-alpha
*/ */
public Theme getTheme(String themeName) { return themes.get(themeName); } public Theme getTheme(String themeName) { return themes.get(themeName); }
} }

View File

@ -85,4 +85,4 @@ public class Receiver extends Thread {
* Removes all object processors registered at this {@link Receiver}. * Removes all object processors registered at this {@link Receiver}.
*/ */
public void removeAllProcessors() { processors.clear(); } public void removeAllProcessors() { processors.clear(); }
} }

View File

@ -74,4 +74,4 @@ public class ContactsSearchRenderer implements ComponentListCellRenderer<User> {
return panel; return panel;
} }
} }

View File

@ -60,4 +60,4 @@ public class PrimaryButton extends JButton {
* @since Envoy 0.2-alpha * @since Envoy 0.2-alpha
*/ */
public void setArcSize(int arcSize) { this.arcSize = arcSize; } public void setArcSize(int arcSize) { this.arcSize = arcSize; }
} }

View File

@ -15,7 +15,7 @@ import envoy.client.data.SettingsItem;
* Project: <strong>envoy-client</strong><br> * Project: <strong>envoy-client</strong><br>
* File: <strong>PrimaryToggleSwitch.java</strong><br> * File: <strong>PrimaryToggleSwitch.java</strong><br>
* Created: <strong>21 Dec 2019</strong><br> * Created: <strong>21 Dec 2019</strong><br>
* *
* @author Maximilian K&auml;fer * @author Maximilian K&auml;fer
* @author Kai S. K. Engelbart * @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha * @since Envoy v0.3-alpha
@ -28,7 +28,7 @@ public class PrimaryToggleSwitch extends JButton {
/** /**
* Initializes a {@link PrimaryToggleSwitch}. * Initializes a {@link PrimaryToggleSwitch}.
* *
* @param settingsItem the {@link SettingsItem} that is controlled by this * @param settingsItem the {@link SettingsItem} that is controlled by this
* {@link PrimaryToggleSwitch} * {@link PrimaryToggleSwitch}
* @since Envoy v0.3-alpha * @since Envoy v0.3-alpha
@ -54,4 +54,4 @@ public class PrimaryToggleSwitch extends JButton {
g.setColor(Settings.getInstance().getThemes().get(Settings.getInstance().getCurrentTheme()).getInteractableBackgroundColor()); g.setColor(Settings.getInstance().getThemes().get(Settings.getInstance().getCurrentTheme()).getInteractableBackgroundColor());
g.fillRoundRect(state ? 25 : 0, 0, 25, 25, 25, 25); g.fillRoundRect(state ? 25 : 0, 0, 25, 25, 25, 25);
} }
} }

View File

@ -127,11 +127,9 @@ public class Startup {
// Save all users to the local database and flush cache // Save all users to the local database and flush cache
localDb.setUsers(client.getUsers()); localDb.setUsers(client.getUsers());
writeProxy.flushCache(); writeProxy.flushCache();
} else { } else
// Set all contacts to offline mode // Set all contacts to offline mode
localDb.getUsers().values().stream().filter(u -> u != localDb.getUser()).forEach(u -> u.setStatus(UserStatus.OFFLINE)); localDb.getUsers().values().stream().filter(u -> u != localDb.getUser()).forEach(u -> u.setStatus(UserStatus.OFFLINE));
}
// Display ChatWindow and StatusTrayIcon // Display ChatWindow and StatusTrayIcon
EventQueue.invokeLater(() -> { EventQueue.invokeLater(() -> {
@ -173,4 +171,4 @@ public class Startup {
} }
})); }));
} }
} }

View File

@ -94,4 +94,4 @@ public class StatusTrayIcon {
throw new EnvoyException("Could not attach Envoy tray icon to system tray.", e); throw new EnvoyException("Could not attach Envoy tray icon to system tray.", e);
} }
} }
} }

View File

@ -59,4 +59,4 @@ public class UserListRenderer extends JLabel implements ListCellRenderer<User> {
} }
return this; return this;
} }
} }

View File

@ -90,4 +90,4 @@ public class GeneralSettingsPanel extends SettingsPanel {
@Override @Override
public ActionListener getOkButtonAction() { return evt -> {}; } public ActionListener getOkButtonAction() { return evt -> {}; }
} }

View File

@ -42,10 +42,12 @@ public class NewThemeScreen extends JDialog {
* Creates a window, where you can choose a name for a new {@link Theme}. <br> * Creates a window, where you can choose a name for a new {@link Theme}. <br>
* There are two versions of this Window. The first one is responsible for * There are two versions of this Window. The first one is responsible for
* choosing the name, the second one appears, if the name already exists. * choosing the name, the second one appears, if the name already exists.
* *
* @param parent the dialog is launched with its location relative to this {@link SettingsScreen} * @param parent the dialog is launched with its location relative to
* @param newThemeAction is executed when a new theme name is entered * this {@link SettingsScreen}
* @param modifyThemeAction is executed when an existing theme name is entered and confirmed * @param newThemeAction is executed when a new theme name is entered
* @param modifyThemeAction is executed when an existing theme name is entered
* and confirmed
* @since Envoy v0.3-alpha * @since Envoy v0.3-alpha
*/ */
public NewThemeScreen(SettingsScreen parent, Consumer<String> newThemeAction, Consumer<String> modifyThemeAction) { public NewThemeScreen(SettingsScreen parent, Consumer<String> newThemeAction, Consumer<String> modifyThemeAction) {
@ -223,4 +225,4 @@ public class NewThemeScreen extends JDialog {
overwrite.addActionListener((evt) -> { modifyThemeAction.accept(nameEnterTextArea.getText()); dispose(); }); overwrite.addActionListener((evt) -> { modifyThemeAction.accept(nameEnterTextArea.getText()); dispose(); });
} }
} }

View File

@ -189,4 +189,4 @@ public class SettingsScreen extends JDialog {
options.setForeground(theme.getUserNameColor()); options.setForeground(theme.getUserNameColor());
options.setBackground(theme.getCellColor()); options.setBackground(theme.getCellColor());
} }
} }

View File

@ -2,8 +2,6 @@ package envoy.client.ui.settings;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -100,17 +98,13 @@ public class ThemeCustomizationPanel extends SettingsPanel {
colorsPanel.setBackground(theme.getCellColor()); colorsPanel.setBackground(theme.getCellColor());
// Apply theme upon selection // Apply theme upon selection
themes.addItemListener(new ItemListener() { themes.addItemListener(e -> {
String selectedValue = (String) themes.getSelectedItem();
logger.log(Level.FINEST, "Selected theme: " + selectedValue);
@Override final Theme currentTheme = Settings.getInstance().getTheme(selectedValue);
public void itemStateChanged(ItemEvent e) { Settings.getInstance().setCurrentTheme(selectedValue);
String selectedValue = (String) themes.getSelectedItem(); EventBus.getInstance().dispatch(new ThemeChangeEvent(currentTheme));
logger.log(Level.FINEST, "Selected theme: " + selectedValue);
final Theme currentTheme = Settings.getInstance().getTheme(selectedValue);
Settings.getInstance().setCurrentTheme(selectedValue);
EventBus.getInstance().dispatch(new ThemeChangeEvent(currentTheme));
}
}); });
// Apply current theme // Apply current theme
@ -143,11 +137,9 @@ public class ThemeCustomizationPanel extends SettingsPanel {
}, name -> { }, name -> {
// Modify theme // Modify theme
Settings.getInstance().getThemes().replace(name, new Theme(name, temporaryTheme)); Settings.getInstance().getThemes().replace(name, new Theme(name, temporaryTheme));
if (themes.getSelectedItem().equals(name)) { if (themes.getSelectedItem().equals(name))
EventBus.getInstance().dispatch(new ThemeChangeEvent(Settings.getInstance().getTheme(name))); EventBus.getInstance().dispatch(new ThemeChangeEvent(Settings.getInstance().getTheme(name)));
} else { else themes.setSelectedItem(name);
themes.setSelectedItem(name);
}
}).setVisible(true); }).setVisible(true);
themeChanged = false; themeChanged = false;
} }
@ -232,4 +224,4 @@ public class ThemeCustomizationPanel extends SettingsPanel {
colorsPanel.add(button, gbc_button); colorsPanel.add(button, gbc_button);
} }
} }