Merge pull request #2285 from SiboVG/issue-2283
[#2283] Apply radial positioning to non-single cluster
This commit is contained in:
commit
6bc477f478
@ -260,27 +260,21 @@ public class InnerTube extends ThicknessRingComponent implements AxialPositionab
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Coordinate> getClusterPoints() {
|
public List<Coordinate> getClusterPoints() {
|
||||||
List<Coordinate> list = new ArrayList<Coordinate>(getInstanceCount());
|
List<Coordinate> list = new ArrayList<>(getInstanceCount());
|
||||||
List<Double> points = cluster.getPoints(clusterRotation - getRadialDirection());
|
List<Double> points = cluster.getPoints(clusterRotation - getRadialDirection());
|
||||||
double separation = getClusterSeparation();
|
double separation = getClusterSeparation();
|
||||||
|
double yOffset = this.radialPosition * Math.cos(this.radialDirection);
|
||||||
|
double zOffset = this.radialPosition * Math.sin(this.radialDirection);
|
||||||
for (int i = 0; i < points.size() / 2; i++) {
|
for (int i = 0; i < points.size() / 2; i++) {
|
||||||
list.add(new Coordinate(0, points.get(2 * i) * separation, points.get(2 * i + 1) * separation));
|
list.add(new Coordinate(0, points.get(2 * i) * separation + yOffset, points.get(2 * i + 1) * separation + zOffset));
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Coordinate[] getInstanceOffsets(){
|
public Coordinate[] getInstanceOffsets(){
|
||||||
|
|
||||||
if ( 1 == getInstanceCount()) {
|
|
||||||
double yOffset = this.radialPosition * Math.cos(this.radialDirection);
|
|
||||||
double zOffset = this.radialPosition * Math.sin(this.radialDirection);
|
|
||||||
return new Coordinate[] { Coordinate.ZERO.add(0.0, yOffset, zOffset) };
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Coordinate> points = getClusterPoints();
|
List<Coordinate> points = getClusterPoints();
|
||||||
|
return points.toArray(new Coordinate[0]);
|
||||||
return points.toArray( new Coordinate[ points.size() ]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
|
@ -505,6 +505,7 @@ class ClusterSelectionPanel extends JPanel {
|
|||||||
setMaximumSize(new Dimension(BUTTON_SIZE, BUTTON_SIZE));
|
setMaximumSize(new Dimension(BUTTON_SIZE, BUTTON_SIZE));
|
||||||
setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
|
setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
|
||||||
// setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
|
// setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
|
||||||
|
setToolTipText(config.getXMLName());
|
||||||
component.addChangeListener(this);
|
component.addChangeListener(this);
|
||||||
addMouseListener(this);
|
addMouseListener(this);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user