Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
993071e9
Commit
993071e9
authored
Jul 03, 2020
by
Alexander Diewald
Browse files
Merge branch '3451' into 'master'
[3451] Remove fourD visualization See merge request af3/af3!352
parents
f8caf50f
cca9c52a
Changes
14
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.exploration.ui/META-INF/MANIFEST.MF
View file @
993071e9
...
...
@@ -37,7 +37,6 @@ Export-Package: org.fortiss.af3.exploration.ui,
org.fortiss.af3.exploration.ui.perspective.targetdef.objective,
org.fortiss.af3.exploration.ui.perspective.visualization,
org.fortiss.af3.exploration.ui.perspective.visualization.visualizations,
org.fortiss.af3.exploration.ui.perspective.visualization.visualizations.fourD,
org.fortiss.af3.exploration.ui.perspective.visualization.visualizations.spider,
org.fortiss.af3.exploration.ui.perspective.visualization.visualizations.table,
org.fortiss.af3.exploration.ui.util
org.fortiss.af3.exploration.ui/src/org/fortiss/af3/exploration/ui/perspective/visualization/.ratings
View file @
993071e9
DSESolutionVisualizationContainer.java 4c97bf1e9885e6bcfc425acad4a71c9f1bb918e9 GREEN
VisualizationViewBackend.java
ad6ccfd7683afc86d8dbfc09c774abf1d8fdecae
GREEN
VisualizationViewBackend.java
1e88a8e3b62639a49dbcc0b693dca332bb779556
GREEN
org.fortiss.af3.exploration.ui/src/org/fortiss/af3/exploration/ui/perspective/visualization/VisualizationViewBackend.java
View file @
993071e9
...
...
@@ -72,8 +72,6 @@ public class VisualizationViewBackend extends VisualizationViewGUI {
getBtnSpiderChart
().
addSelectionListener
(
createVisSubViewActivator
(
ViewConstants
.
SPIDER
,
solution
));
getBtndSpace
()
.
addSelectionListener
(
createVisSubViewActivator
(
ViewConstants
.
FOURD
,
solution
));
getBtnTable
()
.
addSelectionListener
(
createVisSubViewActivator
(
ViewConstants
.
TABLE
,
solution
));
getBtnGanttChart
()
...
...
@@ -83,7 +81,6 @@ public class VisualizationViewBackend extends VisualizationViewGUI {
switchView
(
ViewConstants
.
SPIDER
,
solution
);
}
else
{
getBtnSpiderChart
().
setEnabled
(
false
);
getBtndSpace
().
setEnabled
(
false
);
getBtnTable
().
setEnabled
(
false
);
getBtnGanttChart
().
setEnabled
(
false
);
}
...
...
org.fortiss.af3.exploration.ui/src/org/fortiss/af3/exploration/ui/perspective/visualization/VisualizationViewGUI.java
View file @
993071e9
...
...
@@ -36,7 +36,6 @@ abstract public class VisualizationViewGUI extends DSEPerspectiveViewBase {
private
Button
btnSpiderChart
;
private
Composite
visualizationViewComposite
;
private
Section
sctnVisualization
;
private
Button
btndSpace
;
private
Button
btnTable
;
private
Button
btnGanttChart
;
private
CheckboxTableViewer
checkboxTableViewer
;
...
...
@@ -88,11 +87,6 @@ abstract public class VisualizationViewGUI extends DSEPerspectiveViewBase {
formToolkit
.
adapt
(
btnSpiderChart
,
true
,
true
);
btnSpiderChart
.
setText
(
"Spider Chart"
);
btndSpace
=
new
Button
(
composite
,
SWT
.
NONE
);
btndSpace
.
setLayoutData
(
new
GridData
(
SWT
.
FILL
,
SWT
.
CENTER
,
true
,
false
,
1
,
1
));
formToolkit
.
adapt
(
btndSpace
,
true
,
true
);
btndSpace
.
setText
(
"4D Space"
);
btnTable
=
new
Button
(
composite
,
SWT
.
NONE
);
btnTable
.
setLayoutData
(
new
GridData
(
SWT
.
FILL
,
SWT
.
CENTER
,
false
,
false
,
1
,
1
));
formToolkit
.
adapt
(
btnTable
,
true
,
true
);
...
...
@@ -114,11 +108,6 @@ abstract public class VisualizationViewGUI extends DSEPerspectiveViewBase {
return
btnGanttChart
;
}
/** Returns btndSpace. */
public
Button
getBtndSpace
()
{
return
btndSpace
;
}
/** Returns btnTable. */
public
Button
getBtnTable
()
{
return
btnTable
;
...
...
org.fortiss.af3.exploration.ui/src/org/fortiss/af3/exploration/ui/perspective/visualization/visualizations/.ratings
View file @
993071e9
IVisualizationView.java
da16f360bfd9c1c8236dca569f5a6fb6bb8af0a2
GREEN
VisualizationViewFactory.java
a2b635a3257cd43b30c57ab35850e12d7d8a370
0 GREEN
IVisualizationView.java
c28bc848c54d3b1f92da9a014d437d7ad96ee25f
GREEN
VisualizationViewFactory.java
96ba7996ee48a0950019f801dff39fb00786e53
0 GREEN
org.fortiss.af3.exploration.ui/src/org/fortiss/af3/exploration/ui/perspective/visualization/visualizations/IVisualizationView.java
View file @
993071e9
...
...
@@ -29,8 +29,6 @@ public interface IVisualizationView {
public
enum
ViewConstants
{
/** Represents Spider Chart View */
SPIDER
,
/** Represents 4D View */
FOURD
,
/** Represents Table View */
TABLE
,
/** Represents Gantt Chart View */
...
...
org.fortiss.af3.exploration.ui/src/org/fortiss/af3/exploration/ui/perspective/visualization/visualizations/VisualizationViewFactory.java
View file @
993071e9
...
...
@@ -17,7 +17,6 @@ package org.fortiss.af3.exploration.ui.perspective.visualization.visualizations;
import
org.eclipse.swt.widgets.Composite
;
import
org.fortiss.af3.exploration.ui.perspective.visualization.DSESolutionVisualizationContainer
;
import
org.fortiss.af3.exploration.ui.perspective.visualization.visualizations.fourD.Editor4DVisualization
;
import
org.fortiss.af3.exploration.ui.perspective.visualization.visualizations.gantt.GanttScheduleVisualization
;
import
org.fortiss.af3.exploration.ui.perspective.visualization.visualizations.spider.SpiderChartVisualization
;
import
org.fortiss.af3.exploration.ui.perspective.visualization.visualizations.table.TableVisualization
;
...
...
@@ -44,9 +43,6 @@ public final class VisualizationViewFactory {
case
SPIDER:
createdView
=
new
SpiderChartVisualization
();
break
;
case
FOURD:
createdView
=
new
Editor4DVisualization
();
break
;
case
TABLE:
createdView
=
new
TableVisualization
();
break
;
...
...
org.fortiss.af3.exploration.ui/src/org/fortiss/af3/exploration/ui/perspective/visualization/visualizations/fourD/.ratings
deleted
100644 → 0
View file @
f8caf50f
Editor4DBackend.java 5868d7748b3957a37272cc17458ca920f196303f GREEN
Editor4DComposite.java cc0b9cba20232ea1e0142de3785fafd1b1de3027 GREEN
Editor4DVisualization.java e62e080064cbe72a89c6e9c665731db4330d7b10 GREEN
org.fortiss.af3.exploration.ui/src/org/fortiss/af3/exploration/ui/perspective/visualization/visualizations/fourD/Editor4DBackend.java
deleted
100644 → 0
View file @
f8caf50f
/*-------------------------------------------------------------------------+
| Copyright 2016 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package
org.fortiss.af3.exploration.ui.perspective.visualization.visualizations.fourD
;
import
static
java
.
lang
.
Math
.
ceil
;
import
static
org
.
eclipse
.
swt
.
SWT
.
Paint
;
import
static
org
.
eclipse
.
wb
.
swt
.
SWTResourceManager
.
getColor
;
import
static
org
.
fortiss
.
af3
.
exploration
.
ui
.
util
.
ExplorationSolutionVisualizationUtils
.
get4DimColor
;
import
static
org
.
fortiss
.
af3
.
exploration
.
ui
.
util
.
ExplorationSolutionVisualizationUtils
.
getColor
;
import
static
org
.
fortiss
.
af3
.
exploration
.
ui
.
util
.
ExplorationSolutionVisualizationUtils
.
getGradientPrecentage
;
import
static
org
.
fortiss
.
af3
.
exploration
.
ui
.
util
.
SpiderChartUtils
.
getAllValuesOFAxis
;
import
static
org
.
fortiss
.
af3
.
exploration
.
ui
.
util
.
SpiderChartUtils
.
getValueOfAxis
;
import
static
org
.
fortiss
.
tooling
.
graphicsGL
.
util
.
Graph3DModelElementFactory
.
graphPoint
;
import
static
org
.
fortiss
.
tooling
.
graphicsGL
.
util
.
Graph3DModelElementFactory
.
text
;
import
static
org
.
fortiss
.
tooling
.
graphicsGL
.
util
.
Graphics3DModelElementFactory
.
BLACK
;
import
static
org
.
fortiss
.
tooling
.
kernel
.
ui
.
util
.
SelectionUtils
.
checkAndPickFirst
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.List
;
import
org.eclipse.jface.viewers.ArrayContentProvider
;
import
org.eclipse.jface.viewers.ISelectionChangedListener
;
import
org.eclipse.jface.viewers.IStructuredSelection
;
import
org.eclipse.jface.viewers.SelectionChangedEvent
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.events.DisposeEvent
;
import
org.eclipse.swt.events.DisposeListener
;
import
org.eclipse.swt.events.PaintEvent
;
import
org.eclipse.swt.events.PaintListener
;
import
org.eclipse.swt.events.SelectionAdapter
;
import
org.eclipse.swt.events.SelectionEvent
;
import
org.eclipse.swt.graphics.GC
;
import
org.eclipse.swt.graphics.RGB
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.layout.GridLayout
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Event
;
import
org.fortiss.af3.exploration.ui.perspective.visualization.DSESolutionVisualizationContainer
;
import
org.fortiss.af3.exploration.ui.util.SpiderChartUtils
;
import
org.fortiss.tooling.base.model.visualization.Axis
;
import
org.fortiss.tooling.base.model.visualization.DataSet
;
import
org.fortiss.tooling.base.model.visualization.DataSetCollection
;
import
org.fortiss.tooling.graphicsGL.model.Color3D
;
import
org.fortiss.tooling.graphicsGL.model.graph.GraphPoint3D
;
import
org.fortiss.tooling.graphicsGL.model.graph.GraphText3D
;
import
org.fortiss.tooling.kernel.ui.presentation.ModelElementLabelProvider
;
import
org.fortiss.tooling.kernel.ui.util.SelectionUtils
;
/**
* Backend implementation of the 4D visualization.
*
* @author eder
*/
public
class
Editor4DBackend
extends
Editor4DCubeGUI
{
/** References the solution representation (visualization data). */
private
DataSetCollection
dataSetCollection
;
/** The controller gui. */
private
Editor4DControlGUI
gui
;
/** The default scaling factor. */
private
float
DEFAULT_SCALE
=
10
.
f
;
/** Maximum value of parameter on x axis. */
private
double
xMax
;
/** Maximum value of parameter on y axis. */
private
double
yMax
;
/** Maximum value of parameter on z axis. */
private
double
zMax
;
/** GraphPoint to schedule mapping. */
private
HashMap
<
GraphPoint3D
,
DataSet
>
graphToSchedule
=
new
HashMap
<
GraphPoint3D
,
DataSet
>();
/** The used gc. */
private
GC
gc
;
/** Scaling on the x axis. */
private
float
scaleX
;
/** Scaling on the y axis. */
private
float
scaleY
;
/** Scaling on the z axis. */
private
float
scaleZ
;
/** The default point/deployment color. */
private
static
Color3D
DEFAULT_POINT_COLOR
=
BLACK
;
/** Constructor. */
public
Editor4DBackend
(
Composite
parent
,
int
style
,
Editor4DControlGUI
gui
,
DSESolutionVisualizationContainer
solutionViz
)
{
super
(
parent
,
style
);
this
.
gui
=
gui
;
this
.
dataSetCollection
=
solutionViz
.
getDataSetCollection
();
setUpControls
();
}
/** {@inheritDoc} */
@Override
public
void
createPartControl
()
{
super
.
createPartControl
();
setLayout
(
new
GridLayout
(
1
,
false
));
setLayoutData
(
new
GridData
(
SWT
.
FILL
,
SWT
.
FILL
,
true
,
true
,
1
,
1
));
setBounds
(
getParent
().
getBounds
());
}
/** set up the control gui. */
private
void
setUpControls
()
{
gui
.
x_Axis_Combo
.
setContentProvider
(
new
ArrayContentProvider
());
gui
.
x_Axis_Combo
.
setLabelProvider
(
new
AxisLabelProvider
());
gui
.
x_Axis_Combo
.
addSelectionChangedListener
(
new
ComboSelectionListener
());
gui
.
y_Axis_Combo
.
setContentProvider
(
new
ArrayContentProvider
());
gui
.
y_Axis_Combo
.
setLabelProvider
(
new
AxisLabelProvider
());
gui
.
y_Axis_Combo
.
addSelectionChangedListener
(
new
ComboSelectionListener
());
gui
.
z_Axis_Combo
.
setContentProvider
(
new
ArrayContentProvider
());
gui
.
z_Axis_Combo
.
setLabelProvider
(
new
AxisLabelProvider
());
gui
.
z_Axis_Combo
.
addSelectionChangedListener
(
new
ComboSelectionListener
());
gui
.
fourD_Axis_Combo
.
setContentProvider
(
new
ArrayContentProvider
());
gui
.
fourD_Axis_Combo
.
setLabelProvider
(
new
AxisLabelProvider
());
gui
.
fourD_Axis_Combo
.
addSelectionChangedListener
(
new
ISelectionChangedListener
()
{
@Override
public
void
selectionChanged
(
SelectionChangedEvent
event
)
{
gui
.
canvas
.
notifyListeners
(
Paint
,
new
Event
());
updateGraphModel
();
}
});
gui
.
dimension4_CheckBox
.
addSelectionListener
(
new
SelectionAdapter
()
{
/** {@inheritDoc} */
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
updateGraphModel
();
}
});
gc
=
new
GC
(
gui
.
canvas
);
gui
.
canvas
.
addPaintListener
(
new
GradientPainter
());
gui
.
canvas
.
addDisposeListener
(
new
DisposeListener
()
{
/** {@inheritDoc} */
@Override
public
void
widgetDisposed
(
DisposeEvent
e
)
{
gc
.
dispose
();
}
});
updateData
();
}
/** Selection Adapter for Combos. */
private
class
ComboSelectionListener
implements
ISelectionChangedListener
{
/** {@inheritDoc} */
@Override
public
void
selectionChanged
(
SelectionChangedEvent
event
)
{
updateGraphModel
();
}
}
/** Update the visualization. */
private
void
updateData
()
{
gui
.
x_Axis_Combo
.
setInput
(
dataSetCollection
.
getAxes
());
gui
.
y_Axis_Combo
.
setInput
(
dataSetCollection
.
getAxes
());
gui
.
z_Axis_Combo
.
setInput
(
dataSetCollection
.
getAxes
());
gui
.
fourD_Axis_Combo
.
setInput
(
dataSetCollection
.
getAxes
());
updateGraphModel
();
}
/** Label provider for visualization axes. */
private
class
AxisLabelProvider
extends
ModelElementLabelProvider
{
/** {@inheritDoc} */
@Override
public
String
getText
(
Object
element
)
{
Axis
<?>
axis
=
(
Axis
<?>)
element
;
return
axis
.
getName
();
}
}
/** Gradient painter class. */
private
class
GradientPainter
implements
PaintListener
{
/** {@inheritDoc} */
@Override
public
void
paintControl
(
PaintEvent
e
)
{
if
(
e
.
gc
==
null
)
{
e
.
gc
=
gc
;
}
IStructuredSelection
selection
=
(
IStructuredSelection
)
gui
.
fourD_Axis_Combo
.
getSelection
();
Object
firstElement
=
selection
.
getFirstElement
();
List
<
Double
>
values
=
getAllValuesOFAxis
(
dataSetCollection
,
(
Axis
<?>)
firstElement
);
if
(
values
.
isEmpty
())
{
return
;
}
Collections
.
sort
(
values
);
Double
max
=
values
.
get
(
values
.
size
()
-
1
);
// list is not empty at this point
Double
min
=
values
.
get
(
0
);
int
nrOfColors
=
values
.
size
();
GC
gc
=
e
.
gc
;
int
canvasWidth
=
gui
.
canvas
.
getSize
().
x
;
int
height
=
gui
.
canvas
.
getSize
().
y
;
int
width
=
(
int
)(
gui
.
canvas
.
getSize
().
x
*
1.0
/
(
nrOfColors
+
1
)
*
1.0
)
+
1
;
// Check if there is some space left.
int
left
=
canvasWidth
-
(
nrOfColors
*
width
);
if
(
left
>
nrOfColors
)
{
width
+=
left
/
nrOfColors
;
}
for
(
int
i
=
0
;
i
<
nrOfColors
;
++
i
)
{
double
p
=
getGradientPrecentage
(
max
,
min
,
values
.
get
(
i
));
RGB
color
=
getColor
(
p
);
gc
.
setBackground
(
getColor
(
color
));
gc
.
fillRectangle
(
i
*
width
,
0
,
width
,
height
);
}
// set up the labels beneath the color gradient
if
(
min
.
equals
(
max
))
{
gui
.
dim4_left_Label
.
setText
(
""
);
gui
.
dim4_right_Label
.
setText
(
""
);
gui
.
dim4_center_Label
.
setText
(
min
+
""
);
return
;
}
Axis
<?>
axis
=
SelectionUtils
.
checkAndPickFirst
(
gui
.
fourD_Axis_Combo
.
getSelection
(),
Axis
.
class
);
double
minAxisValue
=
SpiderChartUtils
.
getMinAxisValue
(
dataSetCollection
,
axis
);
double
maxAxisValue
=
SpiderChartUtils
.
getMaxAxisValue
(
dataSetCollection
,
axis
);
gui
.
dim4_left_Label
.
setText
(
minAxisValue
+
""
);
gui
.
dim4_right_Label
.
setText
(
maxAxisValue
+
""
);
double
center
=
((
maxAxisValue
-
minAxisValue
)
/
2.0
)
+
minAxisValue
;
gui
.
dim4_center_Label
.
setText
(
center
+
""
);
}
}
/** Updates the graphModel with current schedule information. */
private
void
updateGraphModel
()
{
graphModel
.
getPoints
().
clear
();
graphModel
.
getTexts
().
clear
();
graphToSchedule
.
clear
();
Axis
<?>
x_selection
=
checkAndPickFirst
(
gui
.
x_Axis_Combo
.
getSelection
(),
Axis
.
class
);
Axis
<?>
y_selection
=
checkAndPickFirst
(
gui
.
y_Axis_Combo
.
getSelection
(),
Axis
.
class
);
Axis
<?>
z_selection
=
checkAndPickFirst
(
gui
.
z_Axis_Combo
.
getSelection
(),
Axis
.
class
);
Axis
<?>
dim4_selection
=
checkAndPickFirst
(
gui
.
fourD_Axis_Combo
.
getSelection
(),
Axis
.
class
);
boolean
isDim4Enabled
=
gui
.
dimension4_CheckBox
.
getSelection
();
// Calculate scaling.
calculateScaling
(
x_selection
,
y_selection
,
z_selection
,
dataSetCollection
);
labelAxis
(
x_selection
,
y_selection
,
z_selection
);
for
(
DataSet
set
:
dataSetCollection
.
getSets
())
{
// Axis section.
Double
xValue
=
getValueOfAxis
(
set
,
x_selection
);
Double
yValue
=
getValueOfAxis
(
set
,
y_selection
);
Double
zValue
=
getValueOfAxis
(
set
,
z_selection
);
// DIM4 color.
Color3D
color
=
get4DimColor
(
dim4_selection
,
set
,
dataSetCollection
);
// Notify the paint listener.
gui
.
canvas
.
notifyListeners
(
Paint
,
new
Event
());
GraphPoint3D
point
=
graphPoint
((
float
)(
xValue
/
scaleX
),
(
float
)(
yValue
/
scaleY
),
(
float
)(
zValue
/
scaleZ
));
// If 4 dim checkbox is selected.
if
(
isDim4Enabled
)
point
.
setColor
(
color
);
else
point
.
setColor
(
DEFAULT_POINT_COLOR
);
graphToSchedule
.
put
(
point
,
set
);
}
graphModel
.
getPoints
().
addAll
(
graphToSchedule
.
keySet
());
}
/** Draws the labels of all axis in the graph. */
private
void
labelAxis
(
Axis
<?>
x
,
Axis
<?>
y
,
Axis
<?>
z
)
{
// Draw axis units.
ArrayList
<
GraphText3D
>
texts
=
new
ArrayList
<
GraphText3D
>();
String
name
=
x
==
null
?
"x_Axis"
:
x
.
getName
();
texts
.
add
(
text
(
name
,
graphPoint
(
AXIS_LENGTH
,
0
,
0
)));
String
name2
=
y
==
null
?
"y_Axis"
:
y
.
getName
();
texts
.
add
(
text
(
name2
,
graphPoint
(
0
,
AXIS_LENGTH
,
0
)));
String
name3
=
z
==
null
?
"z_Axis"
:
z
.
getName
();
texts
.
add
(
text
(
name3
,
graphPoint
(
0
,
0
,
AXIS_LENGTH
)));
// Draw numbers.
for
(
int
i
=
0
;
i
<
AXIS_LENGTH
;
i
+=
10
)
{
float
space
=
0.15f
;
if
(
i
==
0
)
{
texts
.
add
(
text
(
"0"
,
graphPoint
(
space
,
space
,
space
)));
continue
;
}
texts
.
add
(
text
((
int
)
ceil
(
i
*
scaleX
)
+
""
,
graphPoint
(
i
,
0
,
space
)));
texts
.
add
(
text
((
int
)
ceil
(
i
*
scaleY
)
+
""
,
graphPoint
(
0
,
i
,
space
)));
texts
.
add
(
text
((
int
)
ceil
(
i
*
scaleZ
)
+
""
,
graphPoint
(
space
,
space
,
i
)));
}
GraphText3D
[]
textArray
=
new
GraphText3D
[
texts
.
size
()];
for
(
int
i
=
0
;
i
<
texts
.
size
();
++
i
)
{
textArray
[
i
]
=
texts
.
get
(
i
);
}
graphModel
.
getTexts
().
addAll
(
texts
);
}
/** Calculates scaling for the selected axis, assumption values are all > 0. */
private
void
calculateScaling
(
Axis
<?>
x
,
Axis
<?>
y
,
Axis
<?>
z
,
DataSetCollection
dataSetCollection
)
{
ArrayList
<
Double
>
xValues
=
new
ArrayList
<
Double
>();
ArrayList
<
Double
>
yValues
=
new
ArrayList
<
Double
>();
ArrayList
<
Double
>
zValues
=
new
ArrayList
<
Double
>();
xValues
.
addAll
(
getAllValuesOFAxis
(
dataSetCollection
,
x
));
yValues
.
addAll
(
getAllValuesOFAxis
(
dataSetCollection
,
y
));
zValues
.
addAll
(
getAllValuesOFAxis
(
dataSetCollection
,
z
));
xMax
=
xValues
.
isEmpty
()
?
0
:
Collections
.
max
(
xValues
);
yMax
=
yValues
.
isEmpty
()
?
0
:
Collections
.
max
(
yValues
);
zMax
=
zValues
.
isEmpty
()
?
0
:
Collections
.
max
(
zValues
);
// All values should lie within the axis_length range
// that means they are all scaled to 0 - axis_length.
scaleX
=
(
float
)(
xMax
*
1
.
f
/
AXIS_LENGTH
);
scaleY
=
(
float
)(
yMax
*
1
.
f
/
AXIS_LENGTH
);
scaleZ
=
(
float
)(
zMax
*
1
.
f
/
AXIS_LENGTH
);
// If the range of the values is very small adjust the scaling
// minimum scaling should be >= 0.1.
if
(
scaleX
<=
0
)
{
scaleX
=
DEFAULT_SCALE
;
}
else
{
while
(
scaleX
<
0.1f
)
{
scaleX
*=
2
;
}
}
if
(
scaleY
<=
0
)
{
scaleY
=
DEFAULT_SCALE
;
}
else
{
while
(
scaleY
<
0.1f
)
{
scaleY
*=
2
;
}
}
if
(
scaleZ
<=
0
)
{
scaleZ
=
DEFAULT_SCALE
;
}
else
{
while
(
scaleZ
<
0.1f
)
{
scaleZ
*=
2
;
}
}
}
}
org.fortiss.af3.exploration.ui/src/org/fortiss/af3/exploration/ui/perspective/visualization/visualizations/fourD/Editor4DComposite.java
deleted
100644 → 0
View file @
f8caf50f
/*-------------------------------------------------------------------------+
| Copyright 2016 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package
org.fortiss.af3.exploration.ui.perspective.visualization.visualizations.fourD
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.graphics.Rectangle
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.layout.GridLayout
;
import
org.eclipse.swt.widgets.Composite
;
/**
* Container composite which stores the {@link Editor4DBackend} and {@link Editor4DControlGUI} next
* to each other.
*
* @author eder
*/
public
class
Editor4DComposite
extends
Composite
{
/** {@link Composite} hosting the visualization. */
/* package */
Composite
visComposite
;
/** {@link Composite} hosting the visualization control combo boxes and alike. */
/* package */
Composite
controlComposite
;
/** Constructor. */
public
Editor4DComposite
(
Composite
parent
,
int
style
)
{
super
(
parent
,
style
);
createPartControl
(
parent
);
}
/** Creates the gui. */
private
void
createPartControl
(
Composite
parent
)
{
setLayout
(
new
GridLayout
(
2
,
false
));
setLayoutData
(
new
GridData
(
GridData
.
FILL
,
GridData
.
FILL
,
true
,
true
,
2
,
1
));
visComposite
=
new
Composite
(
this
,
SWT
.
FILL
);
visComposite
.
setLayout
(
new
GridLayout
(
1
,
false
));
visComposite
.
setLayoutData
(
new
GridData
(
GridData
.
FILL
,
GridData
.
FILL
,
true
,
true
));
controlComposite
=
new
Composite
(
this
,
SWT
.
FILL
);
controlComposite
.
setLayout
(
new
GridLayout
(
1
,
false
));
controlComposite
.
setLayoutData
(
new
GridData
(
GridData
.
FILL
,
GridData
.
FILL
,
false
,
true
));
Rectangle
clientArea
=
parent
.
getClientArea
();
setBounds
(
clientArea
.
x
,
clientArea
.
y
,
clientArea
.
width
,
clientArea
.
height
);
}
/** {@inheritDoc} */
@Override
public
void
dispose
()
{
visComposite
.
dispose
();