Skip to content

Commit 1067a3e

Browse files
committed
Merge tag 'openchemlib-2024.5.1'
[maven-release-plugin] copy for tag openchemlib-2024.5.1
2 parents a0042e2 + 7a3dacf commit 1067a3e

File tree

4 files changed

+38
-32
lines changed

4 files changed

+38
-32
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Please follow the naming scheme YEAR.MONTH.RELEASE_NO_OF_MONTH
99
(eg. 2016.4.1 for second release in Apr 2016)
1010
-->
11-
<version>2024.5.0</version>
11+
<version>2024.5.1</version>
1212

1313
<name>OpenChemLib</name>
1414
<description>Open Source Chemistry Library</description>
@@ -209,7 +209,7 @@
209209
<connection>scm:git:[email protected]:Actelion/openchemlib.git</connection>
210210
<developerConnection>scm:git:[email protected]:Actelion/openchemlib.git</developerConnection>
211211
<url>https://github.com/Actelion/openchemlib</url>
212-
<tag>openchemlib-2024.5.0</tag>
212+
<tag>openchemlib-2024.5.1</tag>
213213
</scm>
214214

215215
<distributionManagement>

src/main/java/com/actelion/research/chem/descriptor/flexophore/completegraphmatcher/ObjectiveBlurFlexophoreHardMatchUncovered.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ public ObjectiveBlurFlexophoreHardMatchUncovered(
150150

151151
}
152152

153+
/**
154+
* Allows mapping of small Flexophores, up to one pharmacophore node.
155+
* @param fragmentNodesMapping
156+
*/
153157
public void setFragmentNodesMapping(boolean fragmentNodesMapping) {
154158
this.fragmentNodesMapping = fragmentNodesMapping;
155159
}

src/main/java/com/actelion/research/gui/JPruningBar.java

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
*/
5252

5353
public class JPruningBar extends JPanel implements MouseListener, MouseMotionListener {
54-
static final long serialVersionUID = 0x20070307;
54+
private static final long serialVersionUID = 0x20070307;
5555

5656
private static final int cRedWaterRGB = Color.RED.getRGB();
5757
private static final int cBlueWaterRGB = 0x156be4;
@@ -60,9 +60,11 @@ public class JPruningBar extends JPanel implements MouseListener, MouseMotionLis
6060
private static final int cBarWidth = cThumbSize - 2 * HiDPIHelper.scale(3); // even integer
6161
private static final int cBorder = HiDPIHelper.scale(2);
6262

63-
private float[] mPosition;
64-
private float mX1,mY1,mLowValue,mMinValue,mHighValue,mMaxValue, mValuePerPixel;
65-
private boolean mIsHorizontal,mUpdateNeeded,mUseRedColor,mAllowDoubleClickChange,mWasDragged;
63+
private final float[] mPosition;
64+
private float mX1,mY1;
65+
private double mValuePerPixel,mLowValue,mMinValue,mHighValue,mMaxValue;
66+
private final boolean mIsHorizontal,mAllowDoubleClickChange;
67+
private boolean mUpdateNeeded,mUseRedColor,mWasDragged;
6668
private int mID,mMousePosition,mClickedArea,mActiveThumb;
6769
private ArrayList<PruningBarListener> mListener;
6870

@@ -78,11 +80,11 @@ public JPruningBar(boolean isHorizontal, int id) {
7880
this(0, 100, isHorizontal, id, false);
7981
}
8082

81-
public JPruningBar(float min, float max, boolean isHorizontal, int id) {
83+
public JPruningBar(double min, double max, boolean isHorizontal, int id) {
8284
this(min, max, isHorizontal, id, false);
8385
}
8486

85-
public JPruningBar(float min, float max, boolean isHorizontal, int id, boolean allowDoubleClick) {
87+
public JPruningBar(double min, double max, boolean isHorizontal, int id, boolean allowDoubleClick) {
8688
init();
8789
mMinValue = min;
8890
mLowValue = min;
@@ -131,15 +133,15 @@ public void paintComponent(Graphics g) {
131133
g2D.fill(new Rectangle2D.Float(mX1+(cThumbSize-cBarWidth)/2, mY1+cThumbSize-1, cBarWidth, y2-mY1-2*cThumbSize+2));
132134

133135
float zoomSpace = (mIsHorizontal ? x2-mX1 : y2-mY1) - 2 * cThumbSize;
134-
float valueSpace = mMaxValue - mMinValue;
136+
double valueSpace = mMaxValue - mMinValue;
135137
mValuePerPixel = valueSpace / zoomSpace;
136138
if (mIsHorizontal) {
137-
mPosition[0] = (mLowValue - mMinValue) / mValuePerPixel;
138-
mPosition[1] = (mHighValue - mMinValue) / mValuePerPixel;
139+
mPosition[0] = (float)((mLowValue - mMinValue) / mValuePerPixel);
140+
mPosition[1] = (float)((mHighValue - mMinValue) / mValuePerPixel);
139141
}
140142
else { // tribute to inverted Y-scale in java
141-
mPosition[0] = (mMaxValue - mHighValue) / mValuePerPixel;
142-
mPosition[1] = (mMaxValue - mLowValue) / mValuePerPixel;
143+
mPosition[0] = (float)((mMaxValue - mHighValue) / mValuePerPixel);
144+
mPosition[1] = (float)((mMaxValue - mLowValue) / mValuePerPixel);
143145
}
144146

145147
int rgb = mUseRedColor ? cRedWaterRGB : HeaderPaintHelper.getThemeColors() == null ? cBlueWaterRGB : HeaderPaintHelper.getThemeColors()[0];
@@ -196,19 +198,19 @@ public void update(Graphics g) {
196198
paint(g);
197199
}
198200

199-
public float getLowValue() {
201+
public double getLowValue() {
200202
return mLowValue;
201203
}
202204

203-
public float getHighValue() {
205+
public double getHighValue() {
204206
return mHighValue;
205207
}
206208

207-
public float getMaximumValue() {
209+
public double getMaximumValue() {
208210
return mMaxValue;
209211
}
210212

211-
public float getMinimumValue() {
213+
public double getMinimumValue() {
212214
return mMinValue;
213215
}
214216

@@ -234,7 +236,7 @@ public void reset() {
234236
* @param high
235237
* @param silent if true, PruningBarEvents are suppressed
236238
*/
237-
public void setLowAndHigh(float low, float high, boolean silent) {
239+
public void setLowAndHigh(double low, double high, boolean silent) {
238240
if (low < mMinValue)
239241
low = mMinValue;
240242
if (high > mMaxValue)
@@ -255,7 +257,7 @@ public void setLowAndHigh(float low, float high, boolean silent) {
255257
* Sends PruningBarEvents in case of a successful change.
256258
* @param low
257259
*/
258-
public void setLowValue(float low) {
260+
public void setLowValue(double low) {
259261
if (setLow(low)) {
260262
informListeners(false);
261263
mUpdateNeeded = true;
@@ -272,7 +274,7 @@ public void setID(int id) {
272274
* Sends PruningBarEvents in case of a successful change.
273275
* @param high
274276
*/
275-
public void setHighValue(float high) {
277+
public void setHighValue(double high) {
276278
if (setHigh(high)) {
277279
informListeners(false);
278280
mUpdateNeeded = true;
@@ -285,7 +287,7 @@ public void setHighValue(float high) {
285287
* Sends PruningBarEvents in case of a successful change.
286288
* @param max
287289
*/
288-
public void setMaximumValue(float max) {
290+
public void setMaximumValue(double max) {
289291
if (max < mMinValue)
290292
max = mMinValue;
291293

@@ -307,7 +309,7 @@ public void setMaximumValue(float max) {
307309
* Sends PruningBarEvents in case of a successful change.
308310
* @param min
309311
*/
310-
public void setMinimumValue(float min) {
312+
public void setMinimumValue(double min) {
311313
// changes the allowed min value; may update low and high to stay within limits
312314
if (min > mMaxValue)
313315
min = mMaxValue;
@@ -331,7 +333,7 @@ public void setMinimumValue(float min) {
331333
* @param min
332334
* @param max
333335
*/
334-
public void setMinAndMax(float min, float max) {
336+
public void setMinAndMax(double min, double max) {
335337
mLowValue = mMinValue = min;
336338
mHighValue = mMaxValue = max;
337339
mUpdateNeeded = true;
@@ -450,7 +452,7 @@ public synchronized void mouseDragged(MouseEvent e) {
450452

451453
mWasDragged = true;
452454

453-
float change = mValuePerPixel * (float)(position - mMousePosition);
455+
double change = mValuePerPixel * (position - mMousePosition);
454456
if (!mIsHorizontal) // tribute to inverted Y-scale in java
455457
change = -change;
456458
if (e.isControlDown())
@@ -543,7 +545,7 @@ private void init() {
543545
mListener = new ArrayList<>();
544546
}
545547

546-
private boolean setHigh(float value) {
548+
private boolean setHigh(double value) {
547549
if (value < mLowValue)
548550
value = mLowValue;
549551
else if (value > mMaxValue)
@@ -556,7 +558,7 @@ else if (value > mMaxValue)
556558
return true;
557559
}
558560

559-
private boolean setLow(float value) {
561+
private boolean setLow(double value) {
560562
if (value < mMinValue)
561563
value = mMinValue;
562564
else if (value > mHighValue)
@@ -569,7 +571,7 @@ else if (value > mHighValue)
569571
return true;
570572
}
571573

572-
private void informListeners(float low, float high) {
574+
private void informListeners(double low, double high) {
573575
for (int i=0; i<mListener.size(); i++)
574576
mListener.get(i).pruningBarChanged(
575577
new PruningBarEvent(this, low, high, false, mID, PruningBarEvent.TYPE_TYPED));

src/main/java/com/actelion/research/gui/PruningBarEvent.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ public class PruningBarEvent extends EventObject {
4242
public static final int TYPE_DRAGGED = 1;
4343
public static final int TYPE_TYPED = 2;
4444

45-
private float mLowValue,mHighValue;
45+
private double mLowValue,mHighValue;
4646
private int mType,mID;
4747
private boolean mAdjusting;
4848

49-
public PruningBarEvent(Object source, float low, float high, boolean adjusting, int id) {
49+
public PruningBarEvent(Object source, double low, double high, boolean adjusting, int id) {
5050
this(source, low, high, adjusting, id, TYPE_DRAGGED);
5151
}
5252

53-
public PruningBarEvent(Object source, float low, float high, boolean adjusting, int id, int type) {
53+
public PruningBarEvent(Object source, double low, double high, boolean adjusting, int id, int type) {
5454
super(source);
5555
mLowValue = low;
5656
mHighValue = high;
@@ -59,11 +59,11 @@ public PruningBarEvent(Object source, float low, float high, boolean adjusting,
5959
mType = type;
6060
}
6161

62-
public float getLowValue() {
62+
public double getLowValue() {
6363
return mLowValue;
6464
}
6565

66-
public float getHighValue() {
66+
public double getHighValue() {
6767
return mHighValue;
6868
}
6969

0 commit comments

Comments
 (0)