Skip to content
Commits on Source (3)
2018-06-22 frank <frank@jidesoft.com>
* README.txt: update README.txt
2018-06-22 jidesoft <anderson@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@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@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@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@jidesoft.com>
* src/com/jidesoft/plaf/windows/WindowsGraphicsUtilsPort.java:
Common,B,WindowsGraphicsUtilsPort,Added WindowsGraphicsUtilsPort
2018-05-03 jidesoft <anderson@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@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@jidesoft.com>
* : Merge pull request #29 from yGuy/patch-1 Workaround Java 10 Issue /w missing Windows LnF
2018-03-20 jidesoft <anderson@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@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@jidesoft.com>
 
* build.properties, pom.xml: 3.7.2
......@@ -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" />
......
......@@ -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.
......@@ -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
......
libjide-oss-java (3.7.4+dfsg-1) UNRELEASED; urgency=medium
*
-- Markus Koschany <apo@debian.org> Thu, 28 Jun 2018 21:55:51 +0200
libjide-oss-java (3.7.2+dfsg-2) unstable; urgency=medium
* Use default-jdk as build-dependency again. (Closes: #897321)
......
......@@ -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>
......
......@@ -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();
}
}
......
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();
}
}
}
......@@ -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,17 +573,8 @@ 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);
}
}
/**
* Paint a skin at a defined position and size. This method does not trigger animation. It is needed for the
......
......@@ -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;
......@@ -195,6 +194,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.
*/
......@@ -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
......@@ -1517,6 +1524,15 @@ public class LookAndFeelFactory implements ProductNames {
return isLnfInstalled(A03_LNF);
}
/**
* 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.
*
......@@ -1838,6 +1854,58 @@ public class LookAndFeelFactory implements ProductNames {
return _productsUsed;
}
/**
* 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
......@@ -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));
......
......@@ -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;
}
......
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) {
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......