Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CometeTrend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Software Control System
Gui
TangoBeans
CometeTrend
Commits
a55f7285
Commit
a55f7285
authored
1 month ago
by
Raphael GIRARDOT
Browse files
Options
Downloads
Patches
Plain Diff
optimizations with better legend placement (CONTROLGUI-403)
parent
bd61f1b1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/fr/soleil/comete/bean/trend/view/ChartPanel.java
+39
-1
39 additions, 1 deletion
...ain/java/fr/soleil/comete/bean/trend/view/ChartPanel.java
with
39 additions
and
1 deletion
src/main/java/fr/soleil/comete/bean/trend/view/ChartPanel.java
+
39
−
1
View file @
a55f7285
package
fr.soleil.comete.bean.trend.view
;
import
java.awt.BorderLayout
;
import
java.awt.Dimension
;
import
java.awt.Window
;
import
java.io.File
;
import
java.util.Collection
;
...
...
@@ -281,6 +282,8 @@ public class ChartPanel extends JPanel implements ITrendFileListener, IChartView
public
TrendChart
()
{
super
();
// Don't update data map on data file loading (CONTROLGUI-403)
setUpdateDataMapWithFileLoading
(
false
);
}
public
String
getSettingsDirectory
()
{
...
...
@@ -294,7 +297,7 @@ public class ChartPanel extends JPanel implements ITrendFileListener, IChartView
}
public
boolean
hasData
(
String
id
)
{
return
(
id
!=
null
)
&&
data
.
containsKey
(
id
);
return
(
id
!=
null
)
&&
(
getDataView
(
id
,
false
)
!=
null
);
}
public
boolean
isSamplingEnabled
()
{
...
...
@@ -314,6 +317,10 @@ public class ChartPanel extends JPanel implements ITrendFileListener, IChartView
protected
void
doApplyConfiguration
(
CfFileReader
f
)
{
super
.
applyConfiguration
(
f
);
SwingUtilities
.
invokeLater
(()
->
{
refresh
(
false
);
repaint
();
});
}
@Override
...
...
@@ -356,6 +363,37 @@ public class ChartPanel extends JPanel implements ITrendFileListener, IChartView
doApplyConfiguration
(
configurationReader
);
configurationReader
=
null
;
}
if
(
isLegendVisible
()
&&
(
chartLegend
!=
null
)
&&
(
chartSplitPane
!=
null
))
{
// Update legend placement (CONTROLGUI-403)
final
int
placement
=
getLabelPlacement
(),
width
=
getWidth
(),
height
=
getHeight
();
final
int
div
=
chartSplitPane
.
getDividerSize
();
final
int
minViewSize
=
100
,
margin
=
5
;
final
Dimension
size
=
chartLegend
.
getPreferredSize
();
switch
(
placement
)
{
case
LABEL_LEFT:
if
(
width
>=
size
.
width
+
margin
+
div
+
minViewSize
)
{
chartSplitPane
.
setDividerLocation
(
size
.
width
+
margin
);
repaint
();
}
break
;
case
LABEL_RIGHT:
if
(
width
>=
size
.
width
+
margin
+
div
+
minViewSize
)
{
chartSplitPane
.
setDividerLocation
(
width
-
(
size
.
width
+
margin
+
div
));
repaint
();
}
break
;
case
LABEL_UP:
if
(
height
>=
size
.
height
+
margin
+
div
+
minViewSize
)
{
chartSplitPane
.
setDividerLocation
(
size
.
height
+
margin
);
}
break
;
default
:
if
(
height
>=
size
.
height
+
margin
+
div
+
minViewSize
)
{
chartSplitPane
.
setDividerLocation
(
height
-
(
size
.
height
+
margin
+
div
));
}
break
;
}
}
});
super
.
finalActionOnceDataLoaded
();
}
...
...
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