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
b7d824d8
Commit
b7d824d8
authored
Aug 01, 2018
by
Nico Mack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor improvement
parent
a70c44b5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
CPS/src/lu/list/itis/dkd/tui/utility/scales/ColourScaleRenderer.java
...list/itis/dkd/tui/utility/scales/ColourScaleRenderer.java
+3
-10
No files found.
CPS/src/lu/list/itis/dkd/tui/utility/scales/ColourScaleRenderer.java
View file @
b7d824d8
...
@@ -13,14 +13,10 @@
...
@@ -13,14 +13,10 @@
*/
*/
package
lu.list.itis.dkd.tui.utility.scales
;
package
lu.list.itis.dkd.tui.utility.scales
;
import
lu.list.itis.dkd.tui.widget.corona.ShapeFactory
;
import
java.awt.Dimension
;
import
java.awt.Dimension
;
import
java.awt.Font
;
import
java.awt.FontMetrics
;
import
java.awt.FontMetrics
;
import
java.awt.Graphics2D
;
import
java.awt.Graphics2D
;
import
java.awt.RenderingHints
;
import
java.awt.RenderingHints
;
import
java.awt.Shape
;
import
java.awt.font.FontRenderContext
;
import
java.awt.font.FontRenderContext
;
import
java.awt.font.GlyphVector
;
import
java.awt.font.GlyphVector
;
import
java.awt.geom.Rectangle2D
;
import
java.awt.geom.Rectangle2D
;
...
@@ -53,9 +49,6 @@ public class ColourScaleRenderer {
...
@@ -53,9 +49,6 @@ public class ColourScaleRenderer {
private
static
final
int
DEFAULT_GAP
=
5
;
private
static
final
int
DEFAULT_GAP
=
5
;
private
static
final
Shape
DEFAULT_SHAPE
=
ShapeFactory
.
buildCircle
(
15
);
private
static
final
Font
DEFAULT_FONT
=
new
Font
(
"Arial"
,
Font
.
PLAIN
,
13
);
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// ***************************************************************************
// ***************************************************************************
// * Constructor(s) *
// * Constructor(s) *
...
@@ -134,14 +127,14 @@ public class ColourScaleRenderer {
...
@@ -134,14 +127,14 @@ public class ColourScaleRenderer {
List
<
ColourMapping
<
T
>>
mappings
=
scale
.
getColourMappings
();
List
<
ColourMapping
<
T
>>
mappings
=
scale
.
getColourMappings
();
double
offset
=
(
double
)
required
.
height
/
((
this
.
renderTitle
)
?
mappings
.
size
()
+
1
:
mappings
.
size
());
double
offset
=
(
double
)
required
.
height
/
((
this
.
renderTitle
)
?
mappings
.
size
()
+
1
:
mappings
.
size
());
double
fontBaseLineOffset
=
metrics
.
getAscent
()
/
2
;
int
fontBaseLineOffset
=
metrics
.
getAscent
()
/
2
;
offscreen
.
translate
(-
shapeBounds
.
getX
(),
(
offset
/
2
));
offscreen
.
translate
(-
shapeBounds
.
getX
(),
(
offset
/
2
));
offscreen
.
setFont
(
scale
.
getTitleFont
());
offscreen
.
setFont
(
scale
.
getTitleFont
());
if
(
this
.
renderTitle
)
{
if
(
this
.
renderTitle
)
{
offscreen
.
setPaint
(
scale
.
getTitleColour
());
offscreen
.
setPaint
(
scale
.
getTitleColour
());
offscreen
.
drawString
(
scale
.
getTitle
(),
(
int
)
(
shapeBounds
.
getX
()
+
shapeBounds
.
getWidth
()
+
horizontalGap
),
(
int
)
fontBaseLineOffset
);
offscreen
.
drawString
(
scale
.
getTitle
(),
(
int
)
(
shapeBounds
.
getX
()
+
shapeBounds
.
getWidth
()
+
horizontalGap
),
fontBaseLineOffset
);
offscreen
.
translate
(
0
,
offset
);
offscreen
.
translate
(
0
,
offset
);
}
}
...
@@ -151,7 +144,7 @@ public class ColourScaleRenderer {
...
@@ -151,7 +144,7 @@ public class ColourScaleRenderer {
offscreen
.
setPaint
(
mapping
.
getColour
());
offscreen
.
setPaint
(
mapping
.
getColour
());
offscreen
.
fill
(
scale
.
getMappingShape
());
offscreen
.
fill
(
scale
.
getMappingShape
());
offscreen
.
setPaint
(
scale
.
getLabelColour
());
offscreen
.
setPaint
(
scale
.
getLabelColour
());
offscreen
.
drawString
(
scale
.
getLabelFor
(
mapping
),
(
int
)
(
shapeBounds
.
getX
()
+
shapeBounds
.
getWidth
()
+
horizontalGap
),
(
int
)
fontBaseLineOffset
);
offscreen
.
drawString
(
scale
.
getLabelFor
(
mapping
),
(
int
)
(
shapeBounds
.
getX
()
+
shapeBounds
.
getWidth
()
+
horizontalGap
),
fontBaseLineOffset
);
offscreen
.
translate
(
0
,
offset
);
offscreen
.
translate
(
0
,
offset
);
}
}
...
...
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