Cleaned up a bit

This commit is contained in:
delvh 2020-07-05 15:37:13 +02:00
parent c5b42385aa
commit 3afe896137
6 changed files with 37 additions and 25 deletions

View File

@ -245,7 +245,7 @@ org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=insert org.eclipse.jdt.core.formatter.insert_new_line_after_label=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
@ -439,7 +439,7 @@ org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_if_empty
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_if_empty
org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_if_single_item org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_if_single_item
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_always org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_always
@ -450,7 +450,7 @@ org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=true org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=true
org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true
org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_if_empty
org.eclipse.jdt.core.formatter.lineSplit=150 org.eclipse.jdt.core.formatter.lineSplit=150
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false

View File

@ -57,7 +57,7 @@ public final class AudioPlayer {
clip = (Clip) AudioSystem.getLine(info); clip = (Clip) AudioSystem.getLine(info);
clip.open(format, data, 0, data.length); clip.open(format, data, 0, data.length);
clip.start(); clip.start();
} catch (LineUnavailableException e) { } catch (final LineUnavailableException e) {
throw new EnvoyException("Cannot play back audio", e); throw new EnvoyException("Cannot play back audio", e);
} }
} }

View File

@ -81,7 +81,7 @@ public final class AudioRecorder {
tempFile = Files.createTempFile("recording", "wav"); tempFile = Files.createTempFile("recording", "wav");
// Start the recording // Start the recording
var ais = new AudioInputStream(line); final var ais = new AudioInputStream(line);
AudioSystem.write(ais, AudioFileFormat.Type.WAVE, tempFile.toFile()); AudioSystem.write(ais, AudioFileFormat.Type.WAVE, tempFile.toFile());
} catch (IOException | LineUnavailableException e) { } catch (IOException | LineUnavailableException e) {
throw new EnvoyException("Cannot record voice", e); throw new EnvoyException("Cannot record voice", e);
@ -99,10 +99,10 @@ public final class AudioRecorder {
try { try {
line.stop(); line.stop();
line.close(); line.close();
byte[] data = Files.readAllBytes(tempFile); final byte[] data = Files.readAllBytes(tempFile);
Files.delete(tempFile); Files.delete(tempFile);
return data; return data;
} catch (IOException e) { } catch (final IOException e) {
throw new EnvoyException("Cannot save voice recording", e); throw new EnvoyException("Cannot save voice recording", e);
} }
} }

View File

@ -11,7 +11,6 @@ import javafx.scene.layout.VBox;
import envoy.client.ui.AudioControl; import envoy.client.ui.AudioControl;
import envoy.client.ui.IconUtil; import envoy.client.ui.IconUtil;
import envoy.data.Attachment.AttachmentType;
import envoy.data.Message; import envoy.data.Message;
import envoy.data.Message.MessageStatus; import envoy.data.Message.MessageStatus;
import envoy.data.User; import envoy.data.User;
@ -41,9 +40,18 @@ public class MessageControl extends VBox {
// Creating the underlying VBox, the dateLabel and the textLabel // Creating the underlying VBox, the dateLabel and the textLabel
super(new Label(dateFormat.format(message.getCreationDate()))); super(new Label(dateFormat.format(message.getCreationDate())));
// Voice attachment // Handling message attachment display
if (message.hasAttachment() && message.getAttachment().getType() == AttachmentType.VOICE) if (message.hasAttachment()) switch (message.getAttachment().getType()) {
case PICTURE:
break;
case VIDEO:
break;
case VOICE:
getChildren().add(new AudioControl(message.getAttachment().getData())); getChildren().add(new AudioControl(message.getAttachment().getData()));
break;
case DOCUMENT:
break;
}
final var textLabel = new Label(message.getText()); final var textLabel = new Label(message.getText());
textLabel.setWrapText(true); textLabel.setWrapText(true);

View File

@ -1,4 +1,4 @@
.button, .list-cell { .button, .list-cell, .progress-bar * {
-fx-background-radius: 5.0em; -fx-background-radius: 5.0em;
} }
@ -26,6 +26,10 @@
-fx-text-fill: transparent; -fx-text-fill: transparent;
} }
.progress-bar{
-fx-progress-color: blue;
}
.online { .online {
-fx-text-fill: limegreen; -fx-text-fill: limegreen;
} }