Cleaned up a bit
This commit is contained in:
parent
03a1596420
commit
85bfe18390
@ -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_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_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_closing_brace_in_array_initializer=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_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_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_imple_if_on_one_line=false
|
||||
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_while_body_on_same_line=false
|
||||
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.never_indent_block_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
||||
|
@ -57,7 +57,7 @@ public final class AudioPlayer {
|
||||
clip = (Clip) AudioSystem.getLine(info);
|
||||
clip.open(format, data, 0, data.length);
|
||||
clip.start();
|
||||
} catch (LineUnavailableException e) {
|
||||
} catch (final LineUnavailableException e) {
|
||||
throw new EnvoyException("Cannot play back audio", e);
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public final class AudioRecorder {
|
||||
tempFile = Files.createTempFile("recording", "wav");
|
||||
|
||||
// Start the recording
|
||||
var ais = new AudioInputStream(line);
|
||||
final var ais = new AudioInputStream(line);
|
||||
AudioSystem.write(ais, AudioFileFormat.Type.WAVE, tempFile.toFile());
|
||||
} catch (IOException | LineUnavailableException e) {
|
||||
throw new EnvoyException("Cannot record voice", e);
|
||||
@ -99,10 +99,10 @@ public final class AudioRecorder {
|
||||
try {
|
||||
line.stop();
|
||||
line.close();
|
||||
byte[] data = Files.readAllBytes(tempFile);
|
||||
final byte[] data = Files.readAllBytes(tempFile);
|
||||
Files.delete(tempFile);
|
||||
return data;
|
||||
} catch (IOException e) {
|
||||
} catch (final IOException e) {
|
||||
throw new EnvoyException("Cannot save voice recording", e);
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ import javafx.scene.layout.VBox;
|
||||
|
||||
import envoy.client.ui.AudioControl;
|
||||
import envoy.client.ui.IconUtil;
|
||||
import envoy.data.Attachment.AttachmentType;
|
||||
import envoy.data.Message;
|
||||
import envoy.data.Message.MessageStatus;
|
||||
import envoy.data.User;
|
||||
@ -41,9 +40,18 @@ public class MessageControl extends VBox {
|
||||
// Creating the underlying VBox, the dateLabel and the textLabel
|
||||
super(new Label(dateFormat.format(message.getCreationDate())));
|
||||
|
||||
// Voice attachment
|
||||
if (message.hasAttachment() && message.getAttachment().getType() == AttachmentType.VOICE)
|
||||
// Handling message attachment display
|
||||
if (message.hasAttachment()) switch (message.getAttachment().getType()) {
|
||||
case PICTURE:
|
||||
break;
|
||||
case VIDEO:
|
||||
break;
|
||||
case VOICE:
|
||||
getChildren().add(new AudioControl(message.getAttachment().getData()));
|
||||
break;
|
||||
case DOCUMENT:
|
||||
break;
|
||||
}
|
||||
|
||||
final var textLabel = new Label(message.getText());
|
||||
textLabel.setWrapText(true);
|
||||
|
@ -1,4 +1,4 @@
|
||||
.button, .list-cell {
|
||||
.button, .list-cell, .progress-bar * {
|
||||
-fx-background-radius: 5.0em;
|
||||
}
|
||||
|
||||
@ -26,6 +26,10 @@
|
||||
-fx-text-fill: transparent;
|
||||
}
|
||||
|
||||
.progress-bar{
|
||||
-fx-progress-color: blue;
|
||||
}
|
||||
|
||||
.online {
|
||||
-fx-text-fill: limegreen;
|
||||
}
|
||||
|
Reference in New Issue
Block a user