Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TULIP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
14
Issues
14
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NUI
TULIP
Commits
2a72f59a
Commit
2a72f59a
authored
Sep 11, 2018
by
Nico Mack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added new Constructor to SelectioGroup class.
Fixed a bug in ColorNuance behaviour.
parent
ee493ab8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
7 deletions
+29
-7
TULIP/src/lu/list/itis/dkd/tui/bootstrapping/BootstrappingUtils.java
...u/list/itis/dkd/tui/bootstrapping/BootstrappingUtils.java
+1
-1
TULIP/src/lu/list/itis/dkd/tui/utility/ColorNuance.java
TULIP/src/lu/list/itis/dkd/tui/utility/ColorNuance.java
+8
-6
TULIP/src/lu/list/itis/dkd/tui/utility/selection/SelectionGroup.java
...u/list/itis/dkd/tui/utility/selection/SelectionGroup.java
+20
-0
No files found.
TULIP/src/lu/list/itis/dkd/tui/bootstrapping/BootstrappingUtils.java
View file @
2a72f59a
...
...
@@ -895,7 +895,7 @@ public class BootstrappingUtils {
Element
nuanceNode
=
(
childName
!=
null
)
?
rootElement
.
getChild
(
childName
)
:
rootElement
;
if
(
nuanceNode
!=
null
)
{
nuance
=
new
ColorNuance
();
nuance
.
setAlpha
(
getContentAsNuance
(
nuanceNode
,
Externalization
.
ALPHA_NODE
,
BootstrappingUtils
.
OPTIONAL
,
0
d
,
context
,
NORMALIZED
));
nuance
.
setAlpha
(
getContentAsNuance
(
nuanceNode
,
Externalization
.
ALPHA_NODE
,
BootstrappingUtils
.
OPTIONAL
,
-
1
d
,
context
,
NORMALIZED
));
nuance
.
setHue
(
getContentAsNuance
(
nuanceNode
,
Externalization
.
HUE_NODE
,
BootstrappingUtils
.
OPTIONAL
,
0
d
,
context
,
NORMALIZED
));
nuance
.
setSaturation
(
getContentAsNuance
(
nuanceNode
,
Externalization
.
SATURATION_NODE
,
BootstrappingUtils
.
OPTIONAL
,
0
d
,
context
,
NORMALIZED
));
nuance
.
setBrightness
(
getContentAsNuance
(
nuanceNode
,
Externalization
.
BRIGHTNESS_NODE
,
BootstrappingUtils
.
OPTIONAL
,
0
d
,
context
,
NORMALIZED
));
...
...
TULIP/src/lu/list/itis/dkd/tui/utility/ColorNuance.java
View file @
2a72f59a
...
...
@@ -126,7 +126,7 @@ public class ColorNuance {
// ---------------------------------------------------------------------------
public
boolean
affectsAlpha
()
{
return
this
.
brightness
!
=
0
;
return
this
.
alpha
>
=
0
;
}
// ---------------------------------------------------------------------------
...
...
@@ -264,14 +264,16 @@ public class ColorNuance {
}
if
(
affectsAlpha
())
{
double
normalizedAlpha
=
newAlpha
;
normalizedAlpha
*=
1
+
this
.
alpha
;
newAlpha
=
MathUtils
.
constrain
((
int
)
(
normalizedAlpha
),
0x00
,
0xff
);
// double normalizedAlpha = newAlpha;
// normalizedAlpha *= this.alpha;
newAlpha
=
(
int
)
(
255
*
this
.
alpha
);
newAlpha
=
MathUtils
.
constrain
(
newAlpha
,
0x00
,
0xff
);
}
int
rgb
=
Color
.
HSBtoRGB
(
hsb
[
HUE
],
hsb
[
SATURATION
],
hsb
[
BRIGHTNESS
]);
rgb
|=
((
newAlpha
<<
24
)
&
0xFF000000
);
return
new
Color
(
rgb
);
rgb
&=
0x00FFFFFF
;
rgb
|=
(
newAlpha
<<
24
);
return
new
Color
(
rgb
,
true
);
}
// ---------------------------------------------------------------------------
...
...
TULIP/src/lu/list/itis/dkd/tui/utility/selection/SelectionGroup.java
View file @
2a72f59a
...
...
@@ -66,6 +66,21 @@ public class SelectionGroup implements SelectionListener {
this
.
listeners
=
new
ArrayList
<>();
}
// ---------------------------------------------------------------------------
/**
* @param name
* @param isExclusive
*
*/
// ---------------------------------------------------------------------------
public
SelectionGroup
(
String
name
,
boolean
isExclusive
)
{
this
.
name
=
name
;
this
.
isExclusive
=
isExclusive
;
this
.
members
=
new
ArrayList
<>();
this
.
listeners
=
new
ArrayList
<>();
}
// ---------------------------------------------------------------------------
/**
* @param rootElement
...
...
@@ -206,6 +221,11 @@ public class SelectionGroup implements SelectionListener {
}
// ---------------------------------------------------------------------------
/**
* @param selectable
* @return
*/
// ---------------------------------------------------------------------------
public
boolean
add
(
Selectable
selectable
)
{
if
(!
this
.
members
.
contains
(
selectable
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment