Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tp-4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pirkl-poo-2018
tp-4
Commits
3bd0aff8
Commit
3bd0aff8
authored
6 years ago
by
Alexis Durgnat
Browse files
Options
Downloads
Patches
Plain Diff
Extracted color of chat message in parameters
parent
8ea566d3
No related branches found
No related tags found
1 merge request
!21
*poof* final version
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/ch/hepia/ui/MainWindowController.java
+5
-5
5 additions, 5 deletions
src/main/java/ch/hepia/ui/MainWindowController.java
with
5 additions
and
5 deletions
src/main/java/ch/hepia/ui/MainWindowController.java
+
5
−
5
View file @
3bd0aff8
...
@@ -156,9 +156,9 @@ public class MainWindowController implements Initializable {
...
@@ -156,9 +156,9 @@ public class MainWindowController implements Initializable {
* Draws a newly received message
* Draws a newly received message
* @param message The message to draw
* @param message The message to draw
*/
*/
private
void
drawMessage
(
User
user
,
String
message
,
String
image
){
private
void
drawMessage
(
User
user
,
String
message
,
String
image
,
Color
color
){
Pane
p
=
new
Pane
();
Pane
p
=
new
Pane
();
setChatPanelStyle
(
p
);
setChatPanelStyle
(
p
,
color
);
Image
lblImg
=
new
Image
(
Main
.
class
.
getResourceAsStream
(
image
));
Image
lblImg
=
new
Image
(
Main
.
class
.
getResourceAsStream
(
image
));
Label
msg
=
new
Label
();
Label
msg
=
new
Label
();
msg
.
setWrapText
(
true
);
msg
.
setWrapText
(
true
);
...
@@ -174,13 +174,13 @@ public class MainWindowController implements Initializable {
...
@@ -174,13 +174,13 @@ public class MainWindowController implements Initializable {
chatContainer
.
getChildren
().
add
(
p
);
chatContainer
.
getChildren
().
add
(
p
);
}
}
private
void
setChatPanelStyle
(
Pane
p
)
{
private
void
setChatPanelStyle
(
Pane
p
,
Color
color
)
{
p
.
setBackground
(
p
.
setBackground
(
new
Background
(
new
Background
(
new
BackgroundFill
(
new
BackgroundFill
(
new
LinearGradient
(
0
,
0
,
0
,
1
,
true
,
new
LinearGradient
(
0
,
0
,
0
,
1
,
true
,
CycleMethod
.
NO_CYCLE
,
CycleMethod
.
NO_CYCLE
,
new
Stop
(
1
,
AppConfig
.
COLOR_BLUE_10_OPACITY
),
new
Stop
(
1
,
color
),
new
Stop
(
0
,
Color
.
WHITE
)
new
Stop
(
0
,
Color
.
WHITE
)
),
),
new
CornerRadii
(
5
),
new
CornerRadii
(
5
),
...
@@ -265,7 +265,7 @@ public class MainWindowController implements Initializable {
...
@@ -265,7 +265,7 @@ public class MainWindowController implements Initializable {
chatMessage
->
{
chatMessage
->
{
Platform
.
runLater
(()
->
{
Platform
.
runLater
(()
->
{
String
message
=
chatMessage
.
getUser
().
toString
()
+
": "
+
chatMessage
.
getMessage
();
String
message
=
chatMessage
.
getUser
().
toString
()
+
": "
+
chatMessage
.
getMessage
();
drawMessage
(
chatMessage
.
getUser
(),
message
,
AppConfig
.
CHAT_MESSAGE_ICON
);
drawMessage
(
chatMessage
.
getUser
(),
message
,
AppConfig
.
CHAT_MESSAGE_ICON
,
AppConfig
.
COLOR_BLUE_10_OPACITY
);
});
});
},
},
chatMessage
->
!(
app
.
getUser
().
get
().
getIgnoredUserList
().
contains
(
chatMessage
.
getUser
()))
chatMessage
->
!(
app
.
getUser
().
get
().
getIgnoredUserList
().
contains
(
chatMessage
.
getUser
()))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment