Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TULIP-CPS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NUI
TULIP-CPS
Commits
be5a940d
Commit
be5a940d
authored
Nov 24, 2017
by
Nico Mack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes required by encapsulation of coronas property in Widgets
parent
741ebbab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
CPS/src/lu/list/itis/dkd/tui/widget/ValueWidget.java
CPS/src/lu/list/itis/dkd/tui/widget/ValueWidget.java
+25
-25
No files found.
CPS/src/lu/list/itis/dkd/tui/widget/ValueWidget.java
View file @
be5a940d
...
...
@@ -80,8 +80,8 @@ public class ValueWidget extends TetherableWidget implements InformationProvider
protected
boolean
constrainted
;
/**
* Field holding the current angular position of the constrainted (lowerStopAngle |
*
upperStopAngle)
angle.
* Field holding the current angular position of the constrainted (lowerStopAngle |
upperStopAngle)
* angle.
*/
protected
double
dialAngle
;
private
double
stepAngle
;
...
...
@@ -211,6 +211,28 @@ public class ValueWidget extends TetherableWidget implements InformationProvider
LOGGER
.
trace
(
"{} = {}"
,
variable
.
getName
(),
value
);
//$NON-NLS-1$
}
}
// ---------------------------------------------------------------------------
@SuppressWarnings
(
"unchecked"
)
private
void
updateInformationReceivers
()
{
for
(
Corona
corona
:
this
.
getAllCoronas
())
{
if
(
corona
instanceof
InformationReceiver
<?>)
{
Type
[]
types
=
corona
.
getClass
().
getGenericInterfaces
();
for
(
Type
type
:
types
)
{
if
(
type
instanceof
ParameterizedType
)
{
String
typeName
=
((
ParameterizedType
)
type
).
getActualTypeArguments
()[
0
].
getTypeName
();
if
(
typeName
.
equals
(
String
.
class
.
getTypeName
()))
{
String
information
=
(
variable
.
getValue
()
!=
null
)
?
variable
.
getValue
().
toString
()
:
null
;
((
InformationReceiver
<
String
>)
corona
).
setInformation
(
information
);
}
else
if
(
typeName
.
equals
(
Double
.
class
.
getTypeName
()))
{
((
InformationReceiver
<
Double
>)
corona
).
setInformation
(
variable
.
getValue
());
}
}
}
}
}
}
// ---------------------------------------------------------------------------
// ***************************************************************************
...
...
@@ -349,31 +371,9 @@ public class ValueWidget extends TetherableWidget implements InformationProvider
// ---------------------------------------------------------------------------
@SuppressWarnings
(
"unchecked"
)
@Override
public
void
paint
(
Graphics2D
canvas
)
{
for
(
Corona
corona
:
coronas
.
values
())
{
if
(
corona
instanceof
InformationReceiver
<?>)
{
Type
[]
types
=
corona
.
getClass
().
getGenericInterfaces
();
for
(
Type
type
:
types
)
{
if
(!(
type
instanceof
ParameterizedType
))
{
continue
;
}
String
typeName
=
((
ParameterizedType
)
type
).
getActualTypeArguments
()[
0
].
getTypeName
();
if
(
typeName
.
equals
(
String
.
class
.
getTypeName
()))
{
String
information
=
(
variable
.
getValue
()
!=
null
)
?
variable
.
getValue
().
toString
()
:
null
;
((
InformationReceiver
<
String
>)
corona
).
setInformation
(
information
);
continue
;
}
if
(
typeName
.
equals
(
Double
.
class
.
getTypeName
()))
{
((
InformationReceiver
<
Double
>)
corona
).
setInformation
(
variable
.
getValue
());
continue
;
}
}
}
}
this
.
updateInformationReceivers
();
super
.
paint
(
canvas
);
}
...
...
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