[Git][java-team/libjide-oss-java][upstream] New upstream version 3.7.4+dfsg
Markus Koschany
gitlab at salsa.debian.org
Thu Jun 28 21:02:01 BST 2018
Markus Koschany pushed to branch upstream at Debian Java Maintainers / libjide-oss-java
Commits:
c237d96b by Markus Koschany at 2018-06-28T21:54:36+02:00
New upstream version 3.7.4+dfsg
- - - - -
25 changed files:
- ChangeLog
- JIDE Common Layer.iml
- README.txt
- build.properties
- pom.xml
- src-jdk8/com/jidesoft/plaf/windows/AnimationController.java
- src/com/jidesoft/plaf/windows/TMSchema.java → src-jdk8/com/jidesoft/plaf/windows/TMSchema.java
- src/com/jidesoft/plaf/windows/XPStyle.java → src-jdk8/com/jidesoft/plaf/windows/XPStyle.java
- src/com/jidesoft/utils/ReflectionUtils.java → src-jdk8/com/jidesoft/utils/ReflectionUtils.java
- − src-jdk9/com/jidesoft/plaf/windows/AnimationController.java
- src-jdk9/com/jidesoft/plaf/windows/XPStyle.java
- src/com/jidesoft/plaf/LookAndFeelFactory.java
- src/com/jidesoft/plaf/basic/BasicJideSplitButtonUI.java
- src/com/jidesoft/plaf/basic/BasicPainter.java
- src/com/jidesoft/plaf/basic/BasicStyledLabelUI.java
- src/com/jidesoft/plaf/eclipse/EclipseMenuItemUI.java
- src/com/jidesoft/plaf/eclipse/EclipseMenuUI.java
- src/com/jidesoft/plaf/vsnet/VsnetMenuItemUI.java
- src/com/jidesoft/plaf/vsnet/VsnetMenuUI.java
- + src/com/jidesoft/plaf/windows/WindowsGraphicsUtilsPort.java
- src/com/jidesoft/swing/Animator.java
- src/com/jidesoft/swing/Flashable.java
- src/com/jidesoft/swing/Searchable.java
- src/com/jidesoft/swing/TreeSearchable.java
- src/com/jidesoft/utils/MathUtils.java
Changes:
=====================================
ChangeLog
=====================================
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,73 @@
+2018-06-22 frank <frank at jidesoft.com>
+
+ * README.txt: update README.txt
+
+2018-06-22 jidesoft <anderson at jidesoft.com>
+
+ * src-jdk9/com/jidesoft/plaf/windows/AnimationController.java,
+ src-jdk9/com/jidesoft/plaf/windows/XPStyle.java: remove
+ AnimationController for JDK 9
+
+2018-06-22 jidesoft <anderson at jidesoft.com>
+
+ * JIDE Common Layer.iml,
+ src-jdk8/com/jidesoft/plaf/windows/AnimationController.java,
+ src-jdk9/com/jidesoft/plaf/windows/AnimationController.java,
+ src-jdk9/com/jidesoft/plaf/windows/XPStyle.java: fix compile errors
+
+2018-06-22 jidesoft <anderson at jidesoft.com>
+
+ * build.properties, pom.xml, {src =>
+ src-jdk8}/com/jidesoft/plaf/windows/TMSchema.java, {src =>
+ src-jdk8}/com/jidesoft/plaf/windows/XPStyle.java, {src =>
+ src-jdk8}/com/jidesoft/utils/ReflectionUtils.java: prepare for 3.7.4
+ release
+
+2018-06-21 jidesoft <anderson at jidesoft.com>
+
+ * src-jdk8/com/jidesoft/plaf/windows/AnimationController.java,
+ src-jdk9/com/jidesoft/plaf/windows/AnimationController.java:
+ Common,B,WindowsLookAndFeel,Remove a few usages of
+ WindowsLookAndFeel,,no
+
+2018-05-03 jidesoft <anderson at jidesoft.com>
+
+ * src/com/jidesoft/plaf/windows/WindowsGraphicsUtilsPort.java:
+ Common,B,WindowsGraphicsUtilsPort,Added WindowsGraphicsUtilsPort
+
+2018-05-03 jidesoft <anderson at jidesoft.com>
+
+ * src/com/jidesoft/swing/Searchable.java,
+ src/com/jidesoft/swing/TreeSearchable.java:
+ Common,E,Searchable,Fixed javadoc errors in Searchable,83284,no
+
+2018-05-02 jidesoft <anderson at jidesoft.com>
+
+ * src/com/jidesoft/plaf/LookAndFeelFactory.java,
+ src/com/jidesoft/plaf/basic/BasicJideSplitButtonUI.java,
+ src/com/jidesoft/plaf/basic/BasicPainter.java,
+ src/com/jidesoft/plaf/basic/BasicStyledLabelUI.java,
+ src/com/jidesoft/plaf/eclipse/EclipseMenuItemUI.java,
+ src/com/jidesoft/plaf/eclipse/EclipseMenuUI.java,
+ src/com/jidesoft/plaf/vsnet/VsnetMenuItemUI.java,
+ src/com/jidesoft/plaf/vsnet/VsnetMenuUI.java:
+ Common,B,LookAndFeelFactory,Remove the usage of WindowsLookAndFeel
+
+2018-03-22 jidesoft <support at jidesoft.com>
+
+ * : Merge pull request #29 from yGuy/patch-1 Workaround Java 10 Issue /w missing Windows LnF
+
+2018-03-20 jidesoft <anderson at jidesoft.com>
+
+ * src/com/jidesoft/utils/MathUtils.java: Common,B,MathUtils,Fixed a
+ bug in max and range methods,83186,no
+
+2018-02-15 jidesoft <anderson at jidesoft.com>
+
+ * src/com/jidesoft/swing/Animator.java,
+ src/com/jidesoft/swing/Flashable.java: Common,B,Animator,Fixed the
+ TableFlashable not working after restarting,83112,no
+
2018-01-28 frank <frank at jidesoft.com>
* build.properties, pom.xml: 3.7.2
=====================================
JIDE Common Layer.iml
=====================================
--- a/JIDE Common Layer.iml
+++ b/JIDE Common Layer.iml
@@ -9,7 +9,7 @@
<sourceFolder url="file://$MODULE_DIR$/properties" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
- <sourceFolder url="file://$MODULE_DIR$/src-jdk8" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src-jdk9" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/classes" />
<excludeFolder url="file://$MODULE_DIR$/javadoc" />
<excludeFolder url="file://$MODULE_DIR$/target" />
=====================================
README.txt
=====================================
--- a/README.txt
+++ b/README.txt
@@ -58,7 +58,7 @@ If you just want to use JIDE Common Layer in your project which used Maven, you
<dependency>
<groupId>com.jidesoft</groupId>
<artifactId>jide-oss</artifactId>
- <version>3.7.0</version>
+ <version>3.7.4</version>
</dependency>
You can specify different versions if you want to use that version. You can find all available version numbers at http://search.maven.org by searching jide-oss.
=====================================
build.properties
=====================================
--- a/build.properties
+++ b/build.properties
@@ -2,7 +2,7 @@
# USER DEFINED VALUES
#
company_name=JIDE Software, Inc.
-jide_version=3.7.2
+jide_version=3.7.4
base_dir=.
output_dir=${basedir}/classes
=====================================
pom.xml
=====================================
--- a/pom.xml
+++ b/pom.xml
@@ -16,7 +16,7 @@
<groupId>com.jidesoft</groupId>
<artifactId>jide-oss</artifactId>
<name>JIDE Common Layer</name>
- <version>3.7.2</version>
+ <version>3.7.4</version>
<packaging>jar</packaging>
<description>JIDE Common Layer (Professional Swing Components)</description>
<url>https://github.com/jidesoft/jide-oss</url>
=====================================
src-jdk8/com/jidesoft/plaf/windows/AnimationController.java
=====================================
--- a/src-jdk8/com/jidesoft/plaf/windows/AnimationController.java
+++ b/src-jdk8/com/jidesoft/plaf/windows/AnimationController.java
@@ -10,7 +10,6 @@ import com.jidesoft.plaf.windows.TMSchema.Part;
import com.jidesoft.plaf.windows.TMSchema.Prop;
import com.jidesoft.plaf.windows.TMSchema.State;
import com.jidesoft.plaf.windows.XPStyle.Skin;
-import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import sun.awt.AppContext;
import sun.security.action.GetBooleanAction;
import sun.swing.UIClientPropertyKey;
@@ -223,9 +222,35 @@ class AnimationController implements ActionListener, PropertyChangeListener {
}
}
+ /**
+ * As of Java 10, com.sun.java.swing.plaf.windows.WindowsLookAndFeel is no longer available on macOS thus
+ * "instanceof WindowsLookAndFeel" directives will result in a NoClassDefFoundError during runtime. This method
+ * was introduced to avoid this exception.
+ *
+ * @param lnf
+ * @return true if it is a WindowsLookAndFeel.
+ */
+ public static boolean isWindowsLookAndFeel(LookAndFeel lnf) {
+ if (lnf == null) {
+ return false;
+ }
+ else {
+ try {
+ Class c = Class.forName("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
+ return c.isInstance(lnf);
+ }
+ catch (ClassNotFoundException cnfe) {
+ // if it is not possible to load the Windows LnF class, the
+ // given lnf instance cannot be an instance of the Windows
+ // LnF class
+ return false;
+ }
+ }
+ }
+
public synchronized void propertyChange(PropertyChangeEvent e) {
if ("lookAndFeel" == e.getPropertyName()
- && !(e.getNewValue() instanceof WindowsLookAndFeel)) {
+ && !isWindowsLookAndFeel((LookAndFeel) e.getNewValue())) {
dispose();
}
}
=====================================
src/com/jidesoft/plaf/windows/TMSchema.java → src-jdk8/com/jidesoft/plaf/windows/TMSchema.java
=====================================
=====================================
src/com/jidesoft/plaf/windows/XPStyle.java → src-jdk8/com/jidesoft/plaf/windows/XPStyle.java
=====================================
=====================================
src/com/jidesoft/utils/ReflectionUtils.java → src-jdk8/com/jidesoft/utils/ReflectionUtils.java
=====================================
=====================================
src-jdk9/com/jidesoft/plaf/windows/AnimationController.java deleted
=====================================
--- a/src-jdk9/com/jidesoft/plaf/windows/AnimationController.java
+++ /dev/null
@@ -1,397 +0,0 @@
-package com.jidesoft.plaf.windows;
-
-import com.jidesoft.plaf.windows.TMSchema.Part;
-import com.jidesoft.plaf.windows.TMSchema.Prop;
-import com.jidesoft.plaf.windows.TMSchema.State;
-import com.jidesoft.plaf.windows.XPStyle.Skin;
-import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
-import sun.awt.AppContext;
-import sun.security.action.GetBooleanAction;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.security.AccessController;
-import java.util.ArrayList;
-import java.util.EnumMap;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import static com.jidesoft.plaf.windows.TMSchema.State.*;
-
-/**
- * Copied from JDK source code and modified to provide additional integration between JIDE components and native windows
- * L&F.
- */
-class AnimationController implements ActionListener, PropertyChangeListener {
-
- private final static boolean VISTA_ANIMATION_DISABLED =
- AccessController.doPrivileged(new GetBooleanAction("swing.disablevistaanimation"));
-
-
- private final static Object ANIMATION_CONTROLLER_KEY =
- new StringBuilder("ANIMATION_CONTROLLER_KEY");
-
- private final Map<JComponent, Map<Part, AnimationState>> animationStateMap =
- new WeakHashMap<JComponent, Map<Part, AnimationState>>();
-
- //this timer is used to cause repaint on animated components
- //30 repaints per second should give smooth animation affect
- private final javax.swing.Timer timer =
- new javax.swing.Timer(1000 / 30, this);
-
- private static synchronized AnimationController getAnimationController() {
- AppContext appContext = AppContext.getAppContext();
- Object obj = appContext.get(ANIMATION_CONTROLLER_KEY);
- if (obj == null) {
- obj = new AnimationController();
- appContext.put(ANIMATION_CONTROLLER_KEY, obj);
- }
- return (AnimationController) obj;
- }
-
- private AnimationController() {
- timer.setRepeats(true);
- timer.setCoalesce(true);
- //we need to dispose the controller on l&f change
- UIManager.addPropertyChangeListener(this);
- }
-
- private static void triggerAnimation(JComponent c,
- Part part, State newState) {
- if (c instanceof JTabbedPane
- || part == Part.TP_BUTTON) {
- //idk: we can not handle tabs animation because
- //the same (component,part) is used to handle all the tabs
- //and we can not track the states
- //Vista theme might have transition duration for toolbar buttons
- //but native application does not seem to animate them
- return;
- }
- AnimationController controller =
- AnimationController.getAnimationController();
- State oldState = controller.getState(c, part);
- if (oldState != newState) {
- controller.putState(c, part, newState);
- if (newState == State.DEFAULTED) {
- // it seems for DEFAULTED button state Vista does animation from
- // HOT
- oldState = State.HOT;
- }
- if (oldState != null) {
- long duration;
- if (newState == State.DEFAULTED) {
- //Only button might have DEFAULTED state
- //idk: do not know how to get the value from Vista
- //one second seems plausible value
- duration = 1000;
- }
- else {
- duration = XPStyle.getXP().getThemeTransitionDuration(
- c, part,
- normalizeState(oldState),
- normalizeState(newState),
- Prop.TRANSITIONDURATIONS);
- }
- controller.startAnimation(c, part, oldState, newState, duration);
- }
- }
- }
-
- // for scrollbar up, down, left and right button pictures are
- // defined by states. It seems that theme has duration defined
- // only for up button states thus we doing this translation here.
- private static State normalizeState(State state) {
- State rv;
- switch (state) {
- case DOWNPRESSED:
- /* falls through */
- case LEFTPRESSED:
- /* falls through */
- case RIGHTPRESSED:
- rv = UPPRESSED;
- break;
-
- case DOWNDISABLED:
- /* falls through */
- case LEFTDISABLED:
- /* falls through */
- case RIGHTDISABLED:
- rv = UPDISABLED;
- break;
-
- case DOWNHOT:
- /* falls through */
- case LEFTHOT:
- /* falls through */
- case RIGHTHOT:
- rv = UPHOT;
- break;
-
- case DOWNNORMAL:
- /* falls through */
- case LEFTNORMAL:
- /* falls through */
- case RIGHTNORMAL:
- rv = UPNORMAL;
- break;
-
- default:
- rv = state;
- break;
- }
- return rv;
- }
-
- private synchronized State getState(JComponent component, Part part) {
- State rv = null;
- Object tmpObject =
- component.getClientProperty(PartUIClientPropertyKey.getKey(part));
- if (tmpObject instanceof State) {
- rv = (State) tmpObject;
- }
- return rv;
- }
-
- private synchronized void putState(JComponent component, Part part,
- State state) {
- component.putClientProperty(PartUIClientPropertyKey.getKey(part),
- state);
- }
-
- private synchronized void startAnimation(JComponent component,
- Part part,
- State startState,
- State endState,
- long millis) {
- boolean isForwardAndReverse = false;
- if (endState == State.DEFAULTED) {
- isForwardAndReverse = true;
- }
- Map<Part, AnimationState> map = animationStateMap.get(component);
- if (millis <= 0) {
- if (map != null) {
- map.remove(part);
- if (map.size() == 0) {
- animationStateMap.remove(component);
- }
- }
- return;
- }
- if (map == null) {
- map = new EnumMap<Part, AnimationState>(Part.class);
- animationStateMap.put(component, map);
- }
- map.put(part,
- new AnimationState(startState, millis, isForwardAndReverse));
- if (!timer.isRunning()) {
- timer.start();
- }
- }
-
- static void paintSkin(JComponent component, Skin skin,
- Graphics g, int dx, int dy, int dw, int dh, State state) {
- if (VISTA_ANIMATION_DISABLED) {
- skin.paintSkinRaw(g, dx, dy, dw, dh, state);
- return;
- }
- triggerAnimation(component, skin.part, state);
- AnimationController controller = getAnimationController();
- synchronized (controller) {
- AnimationState animationState = null;
- Map<Part, AnimationState> map =
- controller.animationStateMap.get(component);
- if (map != null) {
- animationState = map.get(skin.part);
- }
- if (animationState != null) {
- animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
- }
- else {
- skin.paintSkinRaw(g, dx, dy, dw, dh, state);
- }
- }
- }
-
- public synchronized void propertyChange(PropertyChangeEvent e) {
- if ("lookAndFeel" == e.getPropertyName()
- && !(e.getNewValue() instanceof WindowsLookAndFeel)) {
- dispose();
- }
- }
-
- public synchronized void actionPerformed(ActionEvent e) {
- java.util.List<JComponent> componentsToRemove = null;
- java.util.List<Part> partsToRemove = null;
- for (JComponent component : animationStateMap.keySet()) {
- component.repaint();
- if (partsToRemove != null) {
- partsToRemove.clear();
- }
- Map<Part, AnimationState> map = animationStateMap.get(component);
- if (!component.isShowing()
- || map == null
- || map.size() == 0) {
- if (componentsToRemove == null) {
- componentsToRemove = new ArrayList<JComponent>();
- }
- componentsToRemove.add(component);
- continue;
- }
- for (Part part : map.keySet()) {
- if (map.get(part).isDone()) {
- if (partsToRemove == null) {
- partsToRemove = new ArrayList<Part>();
- }
- partsToRemove.add(part);
- }
- }
- if (partsToRemove != null) {
- if (partsToRemove.size() == map.size()) {
- //animation is done for the component
- if (componentsToRemove == null) {
- componentsToRemove = new ArrayList<JComponent>();
- }
- componentsToRemove.add(component);
- }
- else {
- for (Part part : partsToRemove) {
- map.remove(part);
- }
- }
- }
- }
- if (componentsToRemove != null) {
- for (JComponent component : componentsToRemove) {
- animationStateMap.remove(component);
- }
- }
- if (animationStateMap.size() == 0) {
- timer.stop();
- }
- }
-
- private synchronized void dispose() {
- timer.stop();
- UIManager.removePropertyChangeListener(this);
- synchronized (AnimationController.class) {
- AppContext.getAppContext()
- .put(ANIMATION_CONTROLLER_KEY, null);
- }
- }
-
- private static class AnimationState {
- private final State startState;
-
- //animation duration in nanoseconds
- private final long duration;
-
- //animatin start time in nanoseconds
- private long startTime;
-
- //direction the alpha value is changing
- //forward - from 0 to 1
- //!forward - from 1 to 0
- private boolean isForward = true;
-
- //if isForwardAndReverse the animation continually goes
- //forward and reverse. alpha value is changing from 0 to 1 then
- //from 1 to 0 and so forth
- private boolean isForwardAndReverse;
-
- private float progress;
-
- AnimationState(final State startState,
- final long milliseconds,
- boolean isForwardAndReverse) {
- assert startState != null && milliseconds > 0;
- assert SwingUtilities.isEventDispatchThread();
-
- this.startState = startState;
- this.duration = milliseconds * 1000000;
- this.startTime = System.nanoTime();
- this.isForwardAndReverse = isForwardAndReverse;
- progress = 0f;
- }
-
- private void updateProgress() {
- assert SwingUtilities.isEventDispatchThread();
-
- if (isDone()) {
- return;
- }
- long currentTime = System.nanoTime();
-
- progress = ((float) (currentTime - startTime))
- / duration;
- progress = Math.max(progress, 0); //in case time was reset
- if (progress >= 1) {
- progress = 1;
- if (isForwardAndReverse) {
- startTime = currentTime;
- progress = 0;
- isForward = !isForward;
- }
- }
- }
-
- void paintSkin(Skin skin, Graphics _g,
- int dx, int dy, int dw, int dh, State state) {
- assert SwingUtilities.isEventDispatchThread();
-
- updateProgress();
- if (!isDone()) {
- Graphics2D g = (Graphics2D) _g.create();
- skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
- float alpha;
- if (isForward) {
- alpha = progress;
- }
- else {
- alpha = 1 - progress;
- }
- g.setComposite(AlphaComposite.SrcOver.derive(alpha));
- skin.paintSkinRaw(g, dx, dy, dw, dh, state);
- g.dispose();
- }
- else {
- skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
- }
- }
-
- boolean isDone() {
- assert SwingUtilities.isEventDispatchThread();
-
- return progress >= 1;
- }
- }
-
- private static class PartUIClientPropertyKey
- implements UIClientPropertyKey {
-
- private static final Map<Part, PartUIClientPropertyKey> map =
- new EnumMap<Part, PartUIClientPropertyKey>(Part.class);
-
- static synchronized PartUIClientPropertyKey getKey(Part part) {
- PartUIClientPropertyKey rv = map.get(part);
- if (rv == null) {
- rv = new PartUIClientPropertyKey(part);
- map.put(part, rv);
- }
- return rv;
- }
-
- private final Part part;
-
- private PartUIClientPropertyKey(Part part) {
- this.part = part;
- }
-
- public String toString() {
- return part.toString();
- }
- }
-}
=====================================
src-jdk9/com/jidesoft/plaf/windows/XPStyle.java
=====================================
--- a/src-jdk9/com/jidesoft/plaf/windows/XPStyle.java
+++ b/src-jdk9/com/jidesoft/plaf/windows/XPStyle.java
@@ -11,7 +11,6 @@ import com.jidesoft.utils.ReflectionUtils;
import com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel;
import com.sun.java.swing.plaf.windows.WindowsComboBoxUI;
import sun.awt.image.SunWritableRaster;
-import sun.awt.image.SurfaceManager;
import sun.awt.windows.ThemeReader;
import sun.security.action.GetPropertyAction;
import sun.swing.CachedPainter;
@@ -574,16 +573,7 @@ public class XPStyle {
* @param state which state to paint
*/
public void paintSkin(Graphics g, int dx, int dy, int dw, int dh, State state) {
- if (ThemeReader.isGetThemeTransitionDurationDefined()
- && component instanceof JComponent
- && SwingUtilities.getAncestorOfClass(CellRendererPane.class,
- component) == null) {
- AnimationController.paintSkin((JComponent) component, this,
- g, dx, dy, dw, dh, state);
- }
- else {
- paintSkinRaw(g, dx, dy, dw, dh, state);
- }
+ paintSkinRaw(g, dx, dy, dw, dh, state);
}
/**
=====================================
src/com/jidesoft/plaf/LookAndFeelFactory.java
=====================================
--- a/src/com/jidesoft/plaf/LookAndFeelFactory.java
+++ b/src/com/jidesoft/plaf/LookAndFeelFactory.java
@@ -26,7 +26,6 @@ import com.jidesoft.swing.JideTabbedPane;
import com.jidesoft.utils.ProductNames;
import com.jidesoft.utils.SecurityUtils;
import com.jidesoft.utils.SystemInfo;
-import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import javax.swing.*;
import javax.swing.plaf.BorderUIResource;
@@ -196,6 +195,11 @@ public class LookAndFeelFactory implements ProductNames {
public static final String A03_LNF = "a03.swing.plaf.A03LookAndFeel";
/**
+ * Class name of Darcula L&F.
+ */
+ public static final String DARCULA_LNF = "com.bulenkov.darcula.DarculaLaf";
+
+ /**
* Class name of Pgs L&F.
*/
public static final String PGS_LNF = "com.pagosoft.plaf.PgsLookAndFeel";
@@ -533,10 +537,10 @@ public class LookAndFeelFactory implements ProductNames {
if (_defaultStyle == -1) {
int suggestedStyle;
try {
- if (SystemInfo.isWindowsVistaAbove() && UIManager.getLookAndFeel() instanceof WindowsLookAndFeel && SystemInfo.isJdk6Above()) {
+ if (SystemInfo.isWindowsVistaAbove() && isWindowsLookAndFeel(UIManager.getLookAndFeel()) && SystemInfo.isJdk6Above()) {
suggestedStyle = EXTENSION_STYLE_OFFICE2007;
}
- else if (XPUtils.isXPStyleOn() && UIManager.getLookAndFeel() instanceof WindowsLookAndFeel) {
+ else if (XPUtils.isXPStyleOn() && isWindowsLookAndFeel(UIManager.getLookAndFeel())) {
suggestedStyle = EXTENSION_STYLE_OFFICE2003;
}
else {
@@ -845,7 +849,7 @@ public class LookAndFeelFactory implements ProductNames {
break;
}
}
- else if (lnf instanceof WindowsLookAndFeel) {
+ else if (isWindowsLookAndFeel(lnf)) {
switch (style) {
case EXTENSION_STYLE_OFFICE2007:
VsnetWindowsUtils.initComponentDefaultsWithMenu(uiDefaults);
@@ -1340,6 +1344,12 @@ public class LookAndFeelFactory implements ProductNames {
if (lnfClassName.endsWith("LookAndFeel")) {
return lnfClassName.substring(start, lnfClassName.length() - "LookAndFeel".length());
}
+ else if (lnfClassName.endsWith("Laf")) {
+ return lnfClassName.substring(start, lnfClassName.length() - "Laf".length());
+ }
+ else if (lnfClassName.endsWith("Lnf")) {
+ return lnfClassName.substring(start, lnfClassName.length() - "Lnf".length());
+ }
return null;
}
@@ -1351,7 +1361,6 @@ public class LookAndFeelFactory implements ProductNames {
* if the L&F is installed.
*
* @param lnfName the L&F name.
- *
* @return <tt>true</tt> if the L&F is in classpath, <tt>false</tt> otherwise
*/
public static boolean isLnfInstalled(String lnfName) {
@@ -1378,7 +1387,6 @@ public class LookAndFeelFactory implements ProductNames {
* Checks if the L&F is the L&F or a subclass of the L&F.
*
* @param lnf the full class name of the L&F (including the package).
- *
* @return true or false.
*/
public static boolean isLnfInUse(String lnf) {
@@ -1482,7 +1490,6 @@ public class LookAndFeelFactory implements ProductNames {
* Returns whether Plastic3D L&F is in classpath
*
* @return <tt>true</tt> Plastic3D L&F is in classpath, <tt>false</tt> otherwise
- *
* @deprecated replace by {@link #isPlastic3DLnfInstalled()}
*/
@Deprecated
@@ -1518,6 +1525,15 @@ public class LookAndFeelFactory implements ProductNames {
}
/**
+ * Returns whether Darcula L&F is in classpath
+ *
+ * @return <tt>true</tt> Darcula L&F is in classpath, <tt>false</tt> otherwise
+ */
+ public static boolean isDarculaLnfInstalled() {
+ return isLnfInstalled(DARCULA_LNF);
+ }
+
+ /**
* Returns whether or not the Pgs L&F is in classpath.
*
* @return <tt>true</tt> if pgs L&F is in classpath, <tt>false</tt> otherwise
@@ -1839,6 +1855,58 @@ public class LookAndFeelFactory implements ProductNames {
}
/**
+ * As of Java 10, com.sun.java.swing.plaf.windows.WindowsLookAndFeel is no longer available on macOS thus
+ * "instanceof WindowsLookAndFeel" directives will result in a NoClassDefFoundError during runtime. This method
+ * was introduced to avoid this exception.
+ *
+ * @param lnf
+ * @return true if it is a WindowsLookAndFeel.
+ */
+ public static boolean isWindowsLookAndFeel(LookAndFeel lnf) {
+ if (lnf == null) {
+ return false;
+ }
+ else {
+ try {
+ Class c = Class.forName(WINDOWS_LNF);
+ return c.isInstance(lnf);
+ }
+ catch (ClassNotFoundException cnfe) {
+ // if it is not possible to load the Windows LnF class, the
+ // given lnf instance cannot be an instance of the Windows
+ // LnF class
+ return false;
+ }
+ }
+ }
+
+ /**
+ * As of Java 10, com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel is no longer available on macOS thus
+ * "instanceof WindowsClassicLookAndFeel" directives will result in a NoClassDefFoundError during runtime. This method
+ * was introduced to avoid this exception.
+ *
+ * @param lnf
+ * @return true if it is a WindowsClassicLookAndFeel.
+ */
+ public static boolean isWindowsClassicLookAndFeel(LookAndFeel lnf) {
+ if (lnf == null) {
+ return false;
+ }
+ else {
+ try {
+ Class c = Class.forName(WINDOWS_CLASSIC_LNF);
+ return c.isInstance(lnf);
+ }
+ catch (ClassNotFoundException cnfe) {
+ // if it is not possible to load the Windows LnF class, the
+ // given lnf instance cannot be an instance of the Windows
+ // LnF class
+ return false;
+ }
+ }
+ }
+
+ /**
* Sets the products you will use. This is needed so that LookAndFeelFactory knows what UIDefault to initialize. For
* example, if you use only JIDE Docking Framework and JIDE Grids, you should call
* <code>setProductUsed(ProductNames.PRODUCT_DOCK | ProductNames.PRODUCT_GRIDS)</code> so that we don't initialize
@@ -1865,7 +1933,6 @@ public class LookAndFeelFactory implements ProductNames {
* Gets the flag indicating if JIDE will try to load the LnF class when {@link #isLnfInstalled(String)} is invoked.
*
* @return true if JIDE will try to load the LnF class. Otherwise false
- *
* @see #setLoadLookAndFeelClass(boolean)
* @since 3.2.0
*/
@@ -1882,13 +1949,17 @@ public class LookAndFeelFactory implements ProductNames {
* you wish.
*
* @param loadLookAndFeelClass the flag
- *
* @since 3.2.0
*/
public static void setLoadLookAndFeelClass(boolean loadLookAndFeelClass) {
_loadLookAndFeelClass = loadLookAndFeelClass;
}
+ public static boolean isMnemonicHidden() {
+ return !UIManager.getBoolean("Button.showMnemonics");
+ }
+
+
public static void main(String[] args) {
// LookAndFeelFactory.setLnfInstalled(AQUA_LNF, false);
// System.out.println(LookAndFeelFactory.isLnfInstalled(AQUA_LNF));
=====================================
src/com/jidesoft/plaf/basic/BasicJideSplitButtonUI.java
=====================================
--- a/src/com/jidesoft/plaf/basic/BasicJideSplitButtonUI.java
+++ b/src/com/jidesoft/plaf/basic/BasicJideSplitButtonUI.java
@@ -7,11 +7,11 @@
package com.jidesoft.plaf.basic;
import com.jidesoft.icons.IconsFactory;
+import com.jidesoft.plaf.LookAndFeelFactory;
import com.jidesoft.plaf.UIDefaultsLookup;
import com.jidesoft.plaf.vsnet.VsnetMenuUI;
import com.jidesoft.swing.*;
import com.jidesoft.utils.SecurityUtils;
-import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import javax.swing.*;
import javax.swing.event.MouseInputListener;
@@ -979,7 +979,7 @@ public class BasicJideSplitButtonUI extends VsnetMenuUI {
int mnemonicIndex = menuItem.getDisplayedMnemonicIndex();
// W2K Feature: Check to see if the Underscore should be rendered.
- if (WindowsLookAndFeel.isMnemonicHidden()) {
+ if (LookAndFeelFactory.isMnemonicHidden()) {
mnemonicIndex = -1;
}
=====================================
src/com/jidesoft/plaf/basic/BasicPainter.java
=====================================
--- a/src/com/jidesoft/plaf/basic/BasicPainter.java
+++ b/src/com/jidesoft/plaf/basic/BasicPainter.java
@@ -1,14 +1,13 @@
package com.jidesoft.plaf.basic;
import com.jidesoft.jdk.JdkSpecificClass;
+import com.jidesoft.plaf.LookAndFeelFactory;
import com.jidesoft.plaf.UIDefaultsLookup;
import com.jidesoft.plaf.XPUtils;
import com.jidesoft.swing.*;
import com.jidesoft.utils.ColorUtils;
import com.jidesoft.utils.SecurityUtils;
import com.jidesoft.utils.SystemInfo;
-import com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel;
-import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import javax.swing.*;
import javax.swing.plaf.ColorUIResource;
@@ -844,7 +843,7 @@ public class BasicPainter implements SwingConstants, ThemePainter {
*/
protected boolean shouldDisplayOnTop() {
return SystemInfo.isWindowsVistaAbove() &&
- (UIManager.getLookAndFeel() instanceof WindowsLookAndFeel && !(UIManager.getLookAndFeel() instanceof WindowsClassicLookAndFeel)) && XPUtils.isXPStyleOn();
+ (LookAndFeelFactory.isWindowsLookAndFeel(UIManager.getLookAndFeel()) && !LookAndFeelFactory.isWindowsClassicLookAndFeel(UIManager.getLookAndFeel())) && XPUtils.isXPStyleOn();
}
public void fillBackground(JComponent c, Graphics g, Rectangle rect, int orientation, int state, Color color) {
=====================================
src/com/jidesoft/plaf/basic/BasicStyledLabelUI.java
=====================================
--- a/src/com/jidesoft/plaf/basic/BasicStyledLabelUI.java
+++ b/src/com/jidesoft/plaf/basic/BasicStyledLabelUI.java
@@ -5,12 +5,12 @@
*/
package com.jidesoft.plaf.basic;
+import com.jidesoft.plaf.LookAndFeelFactory;
import com.jidesoft.plaf.UIDefaultsLookup;
import com.jidesoft.swing.FontUtils;
import com.jidesoft.swing.JideSwingUtilities;
import com.jidesoft.swing.StyleRange;
import com.jidesoft.swing.StyledLabel;
-import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
@@ -686,8 +686,8 @@ public class BasicStyledLabelUI extends BasicLabelUI implements SwingConstants {
int endX = paintWidth + startX;
int x = startX;
int mnemonicIndex = label.getDisplayedMnemonicIndex();
- if (UIManager.getLookAndFeel() instanceof WindowsLookAndFeel &&
- WindowsLookAndFeel.isMnemonicHidden()) {
+ if (LookAndFeelFactory.isWindowsLookAndFeel(UIManager.getLookAndFeel()) &&
+ LookAndFeelFactory.isMnemonicHidden()) {
mnemonicIndex = -1;
}
@@ -1083,8 +1083,8 @@ public class BasicStyledLabelUI extends BasicLabelUI implements SwingConstants {
paintWidth = Math.min(paintWidth, rightMostX - leftAlignmentX);
int mnemonicIndex = label.getDisplayedMnemonicIndex();
- if (UIManager.getLookAndFeel() instanceof WindowsLookAndFeel &&
- WindowsLookAndFeel.isMnemonicHidden()) {
+ if (LookAndFeelFactory.isWindowsLookAndFeel(UIManager.getLookAndFeel()) &&
+ LookAndFeelFactory.isMnemonicHidden()) {
mnemonicIndex = -1;
}
=====================================
src/com/jidesoft/plaf/eclipse/EclipseMenuItemUI.java
=====================================
--- a/src/com/jidesoft/plaf/eclipse/EclipseMenuItemUI.java
+++ b/src/com/jidesoft/plaf/eclipse/EclipseMenuItemUI.java
@@ -7,13 +7,13 @@
package com.jidesoft.plaf.eclipse;
import com.jidesoft.icons.IconsFactory;
+import com.jidesoft.plaf.LookAndFeelFactory;
import com.jidesoft.plaf.UIDefaultsLookup;
import com.jidesoft.plaf.basic.ThemePainter;
+import com.jidesoft.plaf.windows.WindowsGraphicsUtilsPort;
import com.jidesoft.swing.ButtonStyle;
import com.jidesoft.swing.JideSwingUtilities;
import com.jidesoft.swing.TopLevelMenuContainer;
-import com.sun.java.swing.plaf.windows.WindowsGraphicsUtils;
-import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import javax.swing.*;
import javax.swing.event.*;
@@ -805,13 +805,13 @@ public class EclipseMenuItemUI extends MenuItemUI {
if (!model.isEnabled()) {
// *** paint the text disabled
- WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);
+ WindowsGraphicsUtilsPort.paintText(g, menuItem, textRect, text, 0);
}
else {
FontMetrics fm = g.getFontMetrics();
int mnemonicIndex = menuItem.getDisplayedMnemonicIndex();
// W2K Feature: Check to see if the Underscore should be rendered.
- if (WindowsLookAndFeel.isMnemonicHidden()) {
+ if (LookAndFeelFactory.isMnemonicHidden()) {
mnemonicIndex = -1;
}
=====================================
src/com/jidesoft/plaf/eclipse/EclipseMenuUI.java
=====================================
--- a/src/com/jidesoft/plaf/eclipse/EclipseMenuUI.java
+++ b/src/com/jidesoft/plaf/eclipse/EclipseMenuUI.java
@@ -6,11 +6,11 @@
package com.jidesoft.plaf.eclipse;
+import com.jidesoft.plaf.LookAndFeelFactory;
import com.jidesoft.plaf.UIDefaultsLookup;
+import com.jidesoft.plaf.windows.WindowsGraphicsUtilsPort;
import com.jidesoft.swing.JideSwingUtilities;
import com.jidesoft.swing.TopLevelMenuContainer;
-import com.sun.java.swing.plaf.windows.WindowsGraphicsUtils;
-import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import javax.swing.*;
import javax.swing.border.Border;
@@ -807,13 +807,13 @@ public class EclipseMenuUI extends EclipseMenuItemUI {
if (!model.isEnabled()) {
// *** paint the text disabled
textRect.y++;
- WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);
+ WindowsGraphicsUtilsPort.paintText(g, menuItem, textRect, text, 0);
}
else {
FontMetrics fm = g.getFontMetrics();
int mnemonicIndex = menuItem.getDisplayedMnemonicIndex();
// W2K Feature: Check to see if the Underscore should be rendered.
- if (WindowsLookAndFeel.isMnemonicHidden()) {
+ if (LookAndFeelFactory.isMnemonicHidden()) {
mnemonicIndex = -1;
}
=====================================
src/com/jidesoft/plaf/vsnet/VsnetMenuItemUI.java
=====================================
--- a/src/com/jidesoft/plaf/vsnet/VsnetMenuItemUI.java
+++ b/src/com/jidesoft/plaf/vsnet/VsnetMenuItemUI.java
@@ -9,13 +9,13 @@ package com.jidesoft.plaf.vsnet;
import com.jidesoft.icons.IconsFactory;
import com.jidesoft.plaf.UIDefaultsLookup;
import com.jidesoft.plaf.basic.ThemePainter;
+import com.jidesoft.plaf.windows.WindowsGraphicsUtilsPort;
import com.jidesoft.swing.ButtonStyle;
import com.jidesoft.swing.JideSplitButton;
import com.jidesoft.swing.JideSwingUtilities;
import com.jidesoft.swing.TopLevelMenuContainer;
import com.jidesoft.utils.SecurityUtils;
-import com.sun.java.swing.plaf.windows.WindowsGraphicsUtils;
-import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
+import com.jidesoft.utils.SystemInfo;
import javax.swing.*;
import javax.swing.event.*;
@@ -883,12 +883,12 @@ public class VsnetMenuItemUI extends MenuItemUI {
if (!model.isEnabled()) {
// *** paint the text disabled
- WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);
+ WindowsGraphicsUtilsPort.paintText(g, menuItem, textRect, text, 0);
}
else {
int mnemonicIndex = menuItem.getDisplayedMnemonicIndex();
// W2K Feature: Check to see if the Underscore should be rendered.
- if (WindowsLookAndFeel.isMnemonicHidden()) {
+ if (SystemInfo.isMnemonicHidden()) {
mnemonicIndex = -1;
}
=====================================
src/com/jidesoft/plaf/vsnet/VsnetMenuUI.java
=====================================
--- a/src/com/jidesoft/plaf/vsnet/VsnetMenuUI.java
+++ b/src/com/jidesoft/plaf/vsnet/VsnetMenuUI.java
@@ -6,13 +6,13 @@
package com.jidesoft.plaf.vsnet;
+import com.jidesoft.plaf.LookAndFeelFactory;
import com.jidesoft.plaf.UIDefaultsLookup;
import com.jidesoft.plaf.basic.ThemePainter;
+import com.jidesoft.plaf.windows.WindowsGraphicsUtilsPort;
import com.jidesoft.swing.ButtonStyle;
import com.jidesoft.swing.JideSwingUtilities;
import com.jidesoft.swing.TopLevelMenuContainer;
-import com.sun.java.swing.plaf.windows.WindowsGraphicsUtils;
-import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import javax.swing.*;
import javax.swing.event.*;
@@ -858,13 +858,13 @@ public class VsnetMenuUI extends VsnetMenuItemUI {
if (!model.isEnabled()) {
// *** paint the text disabled
- WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);
+ WindowsGraphicsUtilsPort.paintText(g, menuItem, textRect, text, 0);
}
else {
FontMetrics fm = g.getFontMetrics();
int mnemonicIndex = menuItem.getDisplayedMnemonicIndex();
// W2K Feature: Check to see if the Underscore should be rendered.
- if (WindowsLookAndFeel.isMnemonicHidden()) {
+ if (LookAndFeelFactory.isMnemonicHidden()) {
mnemonicIndex = -1;
}
=====================================
src/com/jidesoft/plaf/windows/WindowsGraphicsUtilsPort.java
=====================================
--- /dev/null
+++ b/src/com/jidesoft/plaf/windows/WindowsGraphicsUtilsPort.java
@@ -0,0 +1,102 @@
+/*
+ * @(#)WindowsGraphicsUtilsPort.java 12/15/2017
+ *
+ * Copyright 2002 - 2017 JIDE Software Inc. All rights reserved.
+ */
+
+package com.jidesoft.plaf.windows;
+
+import com.jidesoft.swing.JideSwingUtilities;
+import com.jidesoft.utils.SystemInfo;
+
+import javax.swing.*;
+import java.awt.*;
+
+public class WindowsGraphicsUtilsPort {
+ /**
+ * Renders a text String in Windows without the mnemonic.
+ * This is here because the WindowsUI hierarchy doesn't match the Component hierarchy. All
+ * the overriden paintText methods of the ButtonUI delegates will call this static method.
+ *
+ * @param g Graphics context
+ * @param b Current button to render
+ * @param textRect Bounding rectangle to render the text.
+ * @param text String to render
+ */
+ public static void paintText(Graphics g, AbstractButton b,
+ Rectangle textRect, String text,
+ int textShiftOffset) {
+ FontMetrics fm = JideSwingUtilities.getFontMetrics(b, g);
+
+ int mnemIndex = b.getDisplayedMnemonicIndex();
+ // W2K Feature: Check to see if the Underscore should be rendered.
+ if (SystemInfo.isMnemonicHidden()) {
+ mnemIndex = -1;
+ }
+
+ paintClassicText(b, g, textRect.x + textShiftOffset,
+ textRect.y + fm.getAscent() + textShiftOffset,
+ text, mnemIndex);
+ }
+
+ static void paintClassicText(AbstractButton b, Graphics g, int x, int y,
+ String text, int mnemIndex) {
+ ButtonModel model = b.getModel();
+
+ /* Draw the Text */
+ Color color = b.getForeground();
+ if (model.isEnabled()) {
+ /*** paint the text normally */
+ if (!(b instanceof JMenuItem && model.isArmed())
+ && !(b instanceof JMenu && (model.isSelected() || model.isRollover()))) {
+ /* We shall not set foreground color for selected menu or
+ * armed menuitem. Foreground must be set in appropriate
+ * Windows* class because these colors passes from
+ * BasicMenuItemUI as protected fields and we can't
+ * reach them from this class */
+ g.setColor(b.getForeground());
+ }
+ JideSwingUtilities.drawStringUnderlineCharAt(b, g, text, mnemIndex, x, y);
+ }
+ else { /*** paint the text disabled ***/
+ color = getDisabledTextColor(b);
+ if (color == null) {
+ color = UIManager.getColor("Button.shadow");
+ }
+ Color shadow = UIManager.getColor("Button.disabledShadow");
+ if (model.isArmed()) {
+ color = UIManager.getColor("Button.disabledForeground");
+ }
+ else {
+ if (shadow == null) {
+ shadow = b.getBackground().darker();
+ }
+ g.setColor(shadow);
+ JideSwingUtilities.drawStringUnderlineCharAt(b, g, text, mnemIndex,
+ x + 1, y + 1);
+ }
+ if (color == null) {
+ color = b.getBackground().brighter();
+ }
+ g.setColor(color);
+ JideSwingUtilities.drawStringUnderlineCharAt(b, g, text, mnemIndex, x, y);
+ }
+ }
+
+ private static Color getDisabledTextColor(AbstractButton b) {
+ if (b instanceof JCheckBox) {
+ return UIManager.getColor("CheckBox.disabledText");
+ }
+ else if (b instanceof JRadioButton) {
+ return UIManager.getColor("RadioButton.disabledText");
+ }
+ else if (b instanceof JToggleButton) {
+ return UIManager.getColor("ToggleButton.disabledText");
+ }
+ else if (b instanceof JButton) {
+ return UIManager.getColor("Button.disabledText");
+ }
+ return null;
+ }
+
+}
=====================================
src/com/jidesoft/swing/Animator.java
=====================================
--- a/src/com/jidesoft/swing/Animator.java
+++ b/src/com/jidesoft/swing/Animator.java
@@ -24,6 +24,9 @@ public class Animator implements ActionListener {
private final int _totalSteps;
private int _currentStep;
+ protected int _delay;
+ protected int _initialDelay;
+
/**
* The list of all registered AnimatorListeners.
*
@@ -52,9 +55,15 @@ public class Animator implements ActionListener {
public Animator(Component source, int initDelay, int delay, int totalSteps) {
_source = source;
_totalSteps = totalSteps;
+ _delay = delay;
+ _initialDelay = initDelay;
+
+ }
- _timer = createTimer(delay, this);
- _timer.setInitialDelay(initDelay);
+ protected Timer createTimer(int initDelay, int delay) {
+ Timer timer = createTimer(delay, this);
+ timer.setInitialDelay(initDelay);
+ return timer;
}
/**
@@ -140,13 +149,16 @@ public class Animator implements ActionListener {
}
void startTimer() {
- if (_timer != null)
- _timer.start();
+ if (_timer == null) {
+ _timer = createTimer(_initialDelay, _delay);
+ }
+ _timer.start();
}
void stopTimer() {
if (_timer != null) {
_timer.stop();
+ _timer = null;
}
}
@@ -163,16 +175,21 @@ public class Animator implements ActionListener {
* @return true if animator is running. Otherwise, returns false.
*/
public boolean isRunning() {
- return _timer != null && _timer.isRunning();
+ return _timer != null;
}
public void setDelay(int delay) {
- _timer.setDelay(delay);
+ _delay = delay;
+ if (_timer != null) {
+ _timer.setDelay(_delay);
+ }
}
public void dispose() {
stop();
- _timer.removeActionListener(this);
- _timer = null;
+ if (_timer != null) {
+ _timer.removeActionListener(this);
+ _timer = null;
+ }
}
}
=====================================
src/com/jidesoft/swing/Flashable.java
=====================================
--- a/src/com/jidesoft/swing/Flashable.java
+++ b/src/com/jidesoft/swing/Flashable.java
@@ -73,10 +73,12 @@ public abstract class Flashable {
if (_synchronizedFlashTimer != null) {
_synchronizedFlashTimer.removeActionListener(this);
}
+ super.stopTimer();
}
@Override
void startTimer() {
+ super.startTimer();
if (_synchronizedFlashTimer != null) {
_synchronizedFlashTimer.removeActionListener(this);
_synchronizedFlashTimer.addActionListener(this);
=====================================
src/com/jidesoft/swing/Searchable.java
=====================================
--- a/src/com/jidesoft/swing/Searchable.java
+++ b/src/com/jidesoft/swing/Searchable.java
@@ -5,6 +5,15 @@
*/
package com.jidesoft.swing;
+import com.jidesoft.plaf.UIDefaultsLookup;
+import com.jidesoft.popup.JidePopup;
+import com.jidesoft.swing.event.SearchableEvent;
+import com.jidesoft.swing.event.SearchableListener;
+import com.jidesoft.utils.DefaultWildcardSupport;
+import com.jidesoft.utils.WildcardSupport;
+
+import javax.swing.*;
+import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.beans.PropertyChangeListener;
@@ -16,16 +25,6 @@ import java.util.Set;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
-import javax.swing.*;
-import javax.swing.event.*;
-
-import com.jidesoft.plaf.UIDefaultsLookup;
-import com.jidesoft.popup.JidePopup;
-import com.jidesoft.swing.event.SearchableEvent;
-import com.jidesoft.swing.event.SearchableListener;
-import com.jidesoft.utils.DefaultWildcardSupport;
-import com.jidesoft.utils.WildcardSupport;
-
/**
* JList, JTable and JTree are three data-rich components. They can be used to display a huge amount of data so
* searching function will be very a useful feature in those components. <code>Searchable</code> is such a class that
@@ -1750,7 +1749,7 @@ public abstract class Searchable {
}
/**
- * Checks the searching order. By default the searchable starts searching from top to bottom. If this flag is false,
+ * Checks the searching order. By default the searchable starts searching from top to bottom. If this flag is true,
* it searches from bottom to top.
*
* @return the reverseOrder flag.
@@ -1760,7 +1759,7 @@ public abstract class Searchable {
}
/**
- * Sets the searching order. By default the searchable starts searching from top to bottom. If this flag is false,
+ * Sets the searching order. By default the searchable starts searching from top to bottom. If this flag is true,
* it searches from bottom to top.
*
* @param reverseOrder the flag if searching from top to bottom or from bottom to top
=====================================
src/com/jidesoft/swing/TreeSearchable.java
=====================================
--- a/src/com/jidesoft/swing/TreeSearchable.java
+++ b/src/com/jidesoft/swing/TreeSearchable.java
@@ -8,7 +8,6 @@ package com.jidesoft.swing;
import javax.swing.*;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
-import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import java.beans.PropertyChangeEvent;
@@ -76,7 +75,7 @@ public class TreeSearchable extends Searchable implements TreeModelListener, Pro
/**
* Sets the recursive attribute.
* <p/>
- * If TreeSearchable is recursive, it will all tree nodes including those which are not visible to find the matching
+ * If TreeSearchable is recursive, it will consider all tree nodes including those which are not visible to find the matching
* node. Obviously, if your tree has unlimited number of tree nodes or a potential huge number of tree nodes (such
* as a tree to represent file system), the recursive attribute should be false. To avoid this potential problem in
* this case, we default it to false.
=====================================
src/com/jidesoft/utils/MathUtils.java
=====================================
--- a/src/com/jidesoft/utils/MathUtils.java
+++ b/src/com/jidesoft/utils/MathUtils.java
@@ -8,7 +8,8 @@ import com.jidesoft.range.Range;
import java.util.ArrayList;
import java.util.List;
-import static java.lang.Double.*;
+import static java.lang.Double.MAX_VALUE;
+import static java.lang.Double.NaN;
/**
* A collection of several util methods related to Math. We only used it in DefaultSummaryCalculator in JIDE Pivot Grid
@@ -67,7 +68,7 @@ public final class MathUtils {
* @return the max number in the numbers list.
*/
public static double max(List<Number> numbers) {
- double max = MIN_VALUE;
+ double max = -MAX_VALUE;
for (Number value : numbers) {
double v = value.doubleValue();
if (v > max) {
@@ -141,7 +142,7 @@ public final class MathUtils {
*/
public static Range<Double> range(List<Number> numbers) {
double min = MAX_VALUE;
- double max = MIN_VALUE;
+ double max = -MAX_VALUE;
for (Number value : numbers) {
double v = value.doubleValue();
if (v < min) {
@@ -162,7 +163,7 @@ public final class MathUtils {
*/
public static Range<Integer> rangeInteger(List<Number> numbers) {
double min = Integer.MAX_VALUE;
- double max = Integer.MIN_VALUE;
+ double max = -Integer.MAX_VALUE;
for (Number value : numbers) {
double v = value.doubleValue();
if (v < min) {
@@ -183,7 +184,7 @@ public final class MathUtils {
*/
public static Range<Long> rangeLong(List<Number> numbers) {
double min = Long.MAX_VALUE;
- double max = Long.MIN_VALUE;
+ double max = -Long.MAX_VALUE;
for (Number value : numbers) {
double v = value.doubleValue();
if (v < min) {
View it on GitLab: https://salsa.debian.org/java-team/libjide-oss-java/commit/c237d96b2b9736482487f436ada063e11667a136
--
View it on GitLab: https://salsa.debian.org/java-team/libjide-oss-java/commit/c237d96b2b9736482487f436ada063e11667a136
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20180628/44704c3a/attachment.html>
More information about the pkg-java-commits
mailing list