From: <doc...@us...> - 2007-09-12 21:46:57
|
Revision: 168 http://openpcl.svn.sourceforge.net/openpcl/?rev=168&view=rev Author: documentsystems Date: 2007-09-12 14:46:58 -0700 (Wed, 12 Sep 2007) Log Message: ----------- Howard Hoagland. Added text color change in addition to the already background color change as user hovers over the different choices in the toolbar button drop down dialogs. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/util/PosToolbarDropdownItemRenderer.java Modified: openpcl/src/com/openpcl/viewer/util/PosToolbarDropdownItemRenderer.java =================================================================== --- openpcl/src/com/openpcl/viewer/util/PosToolbarDropdownItemRenderer.java 2007-09-08 00:53:51 UTC (rev 167) +++ openpcl/src/com/openpcl/viewer/util/PosToolbarDropdownItemRenderer.java 2007-09-12 21:46:58 UTC (rev 168) @@ -21,7 +21,9 @@ public class PosToolbarDropdownItemRenderer extends DefaultListCellRenderer { private static final long serialVersionUID = 1L; private Color mBkgSelectionColor = null; + private Color mFrgSelectionColor = null; private Color mBkgNonSelectionColor = null; + private Color mFrgNonSelectionColor = null; @Override public Component getListCellRendererComponent( @@ -32,7 +34,9 @@ // Need to get the color again every time because the user might have changed the Look and Feel from last time mBkgSelectionColor = UIManager.getColor("List.selectionBackground"); + mFrgSelectionColor = UIManager.getColor("List.selectionForeground"); mBkgNonSelectionColor = UIManager.getColor("List.background"); + mFrgNonSelectionColor = UIManager.getColor("List.foreground"); if (pValue instanceof JLabel) { JLabel tJLabel = (JLabel)pValue; @@ -43,8 +47,10 @@ // Setting the vertical alignment to TOP doesn't change the text placement when a JLabel is in a JList, but this // is a trick to use something in a JLabel to know which JLabel in the JList the mouse is hovering over right now. setBackground(mBkgSelectionColor); + setForeground(mFrgSelectionColor); } else { setBackground(mBkgNonSelectionColor); + setForeground(mFrgNonSelectionColor); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |