Scrollbar thumb handle image added.

cusax-fix
Yana Stamcheva 20 years ago
parent cf53646a75
commit 057a304d79

@ -85,8 +85,6 @@ public void addCustomEntriesToTable(UIDefaults table) {
"RadioButton.rollover", Boolean.TRUE,
"RadioButtonMenuItem.gradient", buttonGradient,
"ScrollBar.width", new Integer(12),
"Slider.altTrackColor", new ColorUIResource(0xD2E2EF),
"Slider.gradient", sliderGradient,
@ -95,15 +93,20 @@ public void addCustomEntriesToTable(UIDefaults table) {
"SplitPane.oneTouchButtonsOpaque", Boolean.FALSE,
"SplitPane.dividerFocusColor", LIGHT_BLUE_GRAY,
"SplitPane.dividerSize", new Integer(5),
"ScrollBar.width", new Integer(12),
"ScrollBar.horizontalThumbIcon",
ImageLoader.getImage(ImageLoader.SCROLLBAR_HORIZONTAL),
ImageLoader.getImage(ImageLoader.SCROLLBAR_THUMB_HORIZONTAL),
"ScrollBar.verticalThumbIcon",
ImageLoader.getImage(ImageLoader.SCROLLBAR_VERTICAL),
ImageLoader.getImage(ImageLoader.SCROLLBAR_THUMB_VERTICAL),
"ScrollBar.horizontalThumbHandleIcon",
ImageLoader.getImage(ImageLoader.SCROLLBAR_THUMB_HANDLE_HORIZONTAL),
"ScrollBar.verticalThumbHandleIcon",
ImageLoader.getImage(ImageLoader.SCROLLBAR_THUMB_HANDLE_VERTICAL),
"ScrollBar.trackHighlight", GRAY,
"ScrollBar.highlight", LIGHT_GRAY,
"ScrollBar.darkShadow", GRAY,
"TabbedPane.borderHightlightColor", LIGHT_BLUE,
"TabbedPane.contentBorderInsets", new Insets(2, 2, 3, 3),
"TabbedPane.selected", LIGHT_GRAY,

@ -6,6 +6,7 @@
*/
package net.java.sip.communicator.impl.gui.lookandfeel;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Rectangle;
@ -26,10 +27,18 @@ public class SIPCommScrollBarUI extends MetalScrollBarUI {
private BufferedImage horizontalThumb;
private BufferedImage verticalThumb;
private BufferedImage horizontalThumbHandle;
private BufferedImage verticalThumbHandle;
public SIPCommScrollBarUI(){
horizontalThumb = (BufferedImage)UIManager.get("ScrollBar.horizontalThumbIcon");
verticalThumb = (BufferedImage)UIManager.get("ScrollBar.verticalThumbIcon");
horizontalThumb = (BufferedImage)UIManager
.get("ScrollBar.horizontalThumbIcon");
verticalThumb = (BufferedImage)UIManager
.get("ScrollBar.verticalThumbIcon");
horizontalThumbHandle = (BufferedImage)UIManager
.get("ScrollBar.horizontalThumbHandleIcon");
verticalThumbHandle = (BufferedImage)UIManager
.get("ScrollBar.verticalThumbHandleIcon");
}
// ********************************
@ -103,9 +112,9 @@ protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
int imgHeight;
int indentWidth = 10;
if ( scrollbar.getOrientation() == JScrollBar.VERTICAL )
if(scrollbar.getOrientation() == JScrollBar.VERTICAL)
{
if ( !isFreeStanding ) {
if(!isFreeStanding) {
thumbBounds.width += 2;
if ( !leftToRight ) {
@ -137,16 +146,23 @@ protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
g.drawImage(bottomImage, thumbBounds.x, thumbBounds.height-indentWidth,
thumbBounds.width-2, indentWidth, null);
if ( !isFreeStanding ) {
g.drawImage(verticalThumbHandle,
thumbBounds.width/2-verticalThumbHandle.getWidth()/2,
thumbBounds.height/2-verticalThumbHandle.getHeight()/2,
verticalThumbHandle.getWidth(),
verticalThumbHandle.getHeight(), null);
if (!isFreeStanding) {
thumbBounds.width -= 2;
if ( !leftToRight ) {
if(!leftToRight) {
g.translate( 1, 0 );
}
}
}
else // HORIZONTAL
{
if ( !isFreeStanding ) {
if (!isFreeStanding) {
thumbBounds.height += 2;
}
imgWidth = horizontalThumb.getWidth();
@ -173,10 +189,25 @@ protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
g.drawImage(rightImage, thumbBounds.width-indentWidth, thumbBounds.y,
indentWidth, thumbBounds.height, null);
if ( !isFreeStanding ) {
g.drawImage(horizontalThumbHandle,
thumbBounds.width/2-horizontalThumbHandle.getWidth()/2,
thumbBounds.height/2-horizontalThumbHandle.getHeight()/2,
horizontalThumbHandle.getWidth(),
horizontalThumbHandle.getHeight(), null);
if (!isFreeStanding) {
thumbBounds.height -= 2;
}
}
g.translate( -thumbBounds.x, -thumbBounds.y );
g.translate(-thumbBounds.x, -thumbBounds.y);
}
protected Dimension getMinimumThumbSize()
{
if(scrollbar.getOrientation() == JScrollBar.VERTICAL)
return new Dimension(scrollBarWidth, verticalThumbHandle.getHeight()+4);
else
return new Dimension(horizontalThumbHandle.getWidth()+4, scrollBarWidth);
}
}

@ -43,12 +43,18 @@ public class ImageLoader {
public static final ImageID SPLITPANE_VERTICAL
= new ImageID("SPLITPANE_VERTICAL");
public static final ImageID SCROLLBAR_VERTICAL
public static final ImageID SCROLLBAR_THUMB_VERTICAL
= new ImageID("SCROLLBAR_VERTICAL");
public static final ImageID SCROLLBAR_HORIZONTAL
public static final ImageID SCROLLBAR_THUMB_HORIZONTAL
= new ImageID("SCROLLBAR_HORIZONTAL");
public static final ImageID SCROLLBAR_THUMB_HANDLE_HORIZONTAL
= new ImageID("SCROLLBAR_THUMB_HORIZONTAL");
public static final ImageID SCROLLBAR_THUMB_HANDLE_VERTICAL
= new ImageID("SCROLLBAR_THUMB_VERTICAL");
/*------------------------------------------------------------------------
* ============================APPLICATION ICONS =========================
* -----------------------------------------------------------------------

@ -150,4 +150,6 @@ SPLITPANE_HORIZONTAL=net/java/sip/communicator/impl/gui/resources/lookandfeel/sp
SPLITPANE_VERTICAL=net/java/sip/communicator/impl/gui/resources/lookandfeel/splitpaneVertical.png
SCROLLBAR_HORIZONTAL=net/java/sip/communicator/impl/gui/resources/lookandfeel/scrollbar_horiz2.png
SCROLLBAR_VERTICAL=net/java/sip/communicator/impl/gui/resources/lookandfeel/scrollbar_vert1.png
SCROLLBAR_VERTICAL=net/java/sip/communicator/impl/gui/resources/lookandfeel/scrollbar_vert1.png
SCROLLBAR_THUMB_HORIZONTAL=net/java/sip/communicator/impl/gui/resources/lookandfeel/horizThumbHandle.png
SCROLLBAR_THUMB_VERTICAL=net/java/sip/communicator/impl/gui/resources/lookandfeel/vertThumbHandle.png

Loading…
Cancel
Save