/*
* Copyright (c) 2005-2008 Substance Kirill Grouchnikov. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* o Neither the name of Substance Kirill Grouchnikov nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.jvnet.substance;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.GeneralPath;
import java.awt.image.BufferedImage;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.EnumSet;
import java.util.Set;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.BasicScrollBarUI;
import org.jvnet.lafwidget.animation.*;
import org.jvnet.lafwidget.layout.TransitionLayout;
import org.jvnet.substance.api.*;
import org.jvnet.substance.api.SubstanceConstants.ScrollPaneButtonPolicyKind;
import org.jvnet.substance.api.SubstanceConstants.Side;
import org.jvnet.substance.painter.border.SimplisticSoftBorderPainter;
import org.jvnet.substance.painter.border.SubstanceBorderPainter;
import org.jvnet.substance.painter.gradient.SimplisticGradientPainter;
import org.jvnet.substance.painter.gradient.SubstanceGradientPainter;
import org.jvnet.substance.painter.utils.SubstanceFillBackgroundDelegate;
import org.jvnet.substance.shaper.ClassicButtonShaper;
import org.jvnet.substance.shaper.SubstanceButtonShaper;
import org.jvnet.substance.utils.*;
import org.jvnet.substance.utils.icon.ArrowButtonTransitionAwareIcon;
import org.jvnet.substance.utils.scroll.SubstanceScrollButton;
/**
* UI for scroll bars in <b>Substance </b> look and feel.
*
* @author Kirill Grouchnikov
*/
public class SubstanceScrollBarUI extends BasicScrollBarUI implements Trackable {
/**
* The second decrease button. Is shown under
* {@link SubstanceConstants.ScrollPaneButtonPolicyKind#ADJACENT},
* {@link SubstanceConstants.ScrollPaneButtonPolicyKind#MULTIPLE} and
* {@link SubstanceConstants.ScrollPaneButtonPolicyKind#MULTIPLE_BOTH}
* modes.
*
* @since version 3.1
*/
protected JButton mySecondDecreaseButton;
/**
* The second increase button. Is shown only under
* {@link SubstanceConstants.ScrollPaneButtonPolicyKind#MULTIPLE_BOTH} mode.
*
* @since version 3.1
*/
protected JButton mySecondIncreaseButton;
/**
* Surrogate button model for tracking the thumb transitions.
*/
private ButtonModel thumbModel;
/**
* Stores computed images for vertical thumbs.
*/
private static LazyResettableHashMap<BufferedImage> thumbVerticalMap = new LazyResettableHashMap<BufferedImage>(
"SubstanceScrollBarUI.thumbVertical");
/**
* Stores computed images for horizontal thumbs.
*/
private static LazyResettableHashMap<BufferedImage> thumbHorizontalMap = new LazyResettableHashMap<BufferedImage>(
"SubstanceScrollBarUI.thumbHorizontal");
/**
* Stores computed images for full vertical tracks under
* {@link DefaultControlBackgroundComposite}.
*/
private static LazyResettableHashMap<BufferedImage> trackFullVerticalMap = new LazyResettableHashMap<BufferedImage>(
"SubstanceScrollBarUI.trackFullVertical");
/**
* Stores computed images for full horizontal tracks under
* {@link DefaultControlBackgroundComposite}.
*/
private static LazyResettableHashMap<BufferedImage> trackFullHorizontalMap = new LazyResettableHashMap<BufferedImage>(
"SubstanceScrollBarUI.trackFullHorizontal");
/**
* Mouse listener on the associated scroll bar.
*/
private MouseListener substanceMouseListener;
/**
* Listener for thumb fade animations.
*/
private RolloverControlListener substanceThumbRolloverListener;
/**
* Listener for fade animations.
*/
protected FadeStateListener substanceFadeStateListener;
/**
* Property change listener.
*
*/
private PropertyChangeListener substancePropertyListener;
/**
* Scroll bar width.
*/
protected int scrollBarWidth;
/**
* Cache of images for horizontal tracks.
*/
private static LazyResettableHashMap<BufferedImage> trackHorizontalMap = new LazyResettableHashMap<BufferedImage>(
"SubstanceScrollBarUI.trackHorizontal");
/**
* Cache of images for vertical tracks.
*/
private static LazyResettableHashMap<BufferedImage> trackVerticalMap = new LazyResettableHashMap<BufferedImage>(
"SubstanceScrollBarUI.trackVertical");
/**
* Listener on adjustments made to the scrollbar model - this is for the
* overlay mode (see {@link SubstanceLookAndFeel#OVERLAY_PROPERTY} and
* repaiting both scrollbars with the viewport.
*
* @since version 3.2
*/
protected AdjustmentListener substanceAdjustmentListener;
/**
* Surrogate model to sync between rollover effects of scroll buttons and
* scroll track / scroll thumb.
*
* @since version 3.2
*/
protected CompositeButtonModel compositeScrollTrackModel;
/**
* Surrogate model to sync between rollover effects of scroll buttons and
* scroll track / scroll thumb.
*
* @since version 3.2
*/
protected CompositeButtonModel compositeButtonsModel;
/*
* (non-Javadoc)
*
* @see javax.swing.plaf.ComponentUI#createUI(javax.swing.JComponent)
*/
public static ComponentUI createUI(JComponent comp) {
SubstanceCoreUtilities.testComponentCreationThreadingViolation(comp);
return new SubstanceScrollBarUI(comp);
}
/**
* Simple constructor.
*
* @param b
* Associated component.
*/
protected SubstanceScrollBarUI(JComponent b) {
super();
this.thumbModel = new DefaultButtonModel();
this.thumbModel.setArmed(false);
this.thumbModel.setSelected(false);
this.thumbModel.setPressed(false);
this.thumbModel.setRollover(false);
b.setOpaque(false);
}
/**
* Creates a decrease button.
*
* @param orientation
* Button orientation.
* @param isRegular
* if <code>true</code>, the regular (upper / left) decrease
* button is created, if <code>false</code>, the additional
* (lower / right) decrease button is created for
* {@link SubstanceConstants.ScrollPaneButtonPolicyKind#ADJACENT}
* ,
* {@link SubstanceConstants.ScrollPaneButtonPolicyKind#MULTIPLE}
* and
* {@link SubstanceConstants.ScrollPaneButtonPolicyKind#MULTIPLE_BOTH}
* kinds.
* @return Decrease button.
*/
protected JButton createGeneralDecreaseButton(final int orientation,
boolean
没有合适的资源?快使用搜索试试~ 我知道了~
java look and feel 界面包
共2000个文件
html:1175个
java:577个
png:349个
4星 · 超过85%的资源 需积分: 31 192 下载量 168 浏览量
2008-09-17
17:57:05
上传
评论 5
收藏 12.02MB ZIP 举报
温馨提示
java 界面包,美化很好,包括30多种的界面包,里面有学习文档,很好用的。
资源推荐
资源详情
资源评论
收起资源包目录
java look and feel 界面包 (2000个子文件)
stylesheet.css 1KB
Thumbs.db 8KB
Thumbs.db 6KB
Thumbs.db 6KB
Thumbs.db 6KB
Thumbs.db 5KB
CMYKChooser.form 14KB
HTMLChooser.form 13KB
HSBChooser.form 11KB
GrayChooser.form 11KB
RGBChooser.form 10KB
ColorPalettesChooser.form 4KB
ColorChooserMainPanel.form 4KB
ColorSlidersChooser.form 2KB
Quaqua15ColorPicker.form 2KB
ColorWheelChooser.form 2KB
SwatchesChooser.form 1KB
Crayons.form 904B
QuaquaColorPreviewPanel.form 420B
ColorWheel.form 215B
SwatchPanel.form 215B
CrayonsChooser.form 213B
brushed.gif 20KB
dukeplug.gif 2KB
button_yellow.gif 981B
JColorChooserColor16.gif 582B
JButtonColor16.gif 330B
JToggleButtonColor16.gif 330B
JComboBoxColor16.gif 329B
JFileChooserColor16.gif 255B
JDialogColor16.gif 248B
JCheckBoxColor16.gif 186B
JDesktopPaneColor16.gif 166B
JLayeredPaneColor16.gif 156B
JListColor16.gif 155B
JTableColor16.gif 154B
JTreeColor16.gif 152B
JScrollPaneColor16.gif 146B
JFrameColor16.gif 144B
JSliderColor16.gif 144B
JTextPaneColor16.gif 143B
JMenuBarColor16.gif 140B
JSpinnerColor16.gif 135B
JProgressBarColor16.gif 124B
JSplitPaneColor16.gif 120B
JTabbedPaneColor16.gif 115B
JWindowColor16.gif 115B
JInternalFrameColor16.gif 114B
JRadioButtonColor16.gif 90B
JLabelColor16.gif 88B
inherit.gif 57B
index-7.html 414KB
index-18.html 236KB
SubstanceColorScheme.html 217KB
SubstanceLookAndFeel.html 135KB
serialized-form.html 127KB
overview-tree.html 123KB
SubstanceCoreUtilities.html 108KB
index-3.html 102KB
RegisterTabCloseChangeListener_Specific.html 98KB
RegisterTabCloseChangeListener_General.html 97KB
index-15.html 95KB
index-9.html 88KB
SubstanceSkin.html 88KB
SubstanceImageCreator.html 79KB
SubstanceTrait.html 76KB
index-12.html 76KB
allclasses-frame.html 73KB
ColorWheelPanel.html 68KB
allclasses-noframe.html 65KB
SubstanceSizeUtils.html 64KB
SubstanceTabbedPaneUI.html 63KB
ComponentState.html 59KB
SubstanceColorUtilities.html 58KB
constant-values.html 57KB
index-20.html 56KB
index-17.html 51KB
SubstanceScrollBarUI.html 50KB
index-19.html 50KB
Options.html 50KB
SubstanceApi.html 49KB
SubstanceDefaultTreeCellRenderer.html 49KB
BaseColorScheme.html 48KB
SubstanceColorSchemeBundle.html 47KB
Methods.html 44KB
SubstanceTitlePane.html 44KB
GetFontPolicy.html 43KB
SubstanceSkin.html 43KB
SubstanceTableUI.html 42KB
SubstanceTreeUI.html 41KB
overview.html 40KB
index-2.html 38KB
SetFontPolicy.html 38KB
SubstanceInternalFrameTitlePane.html 38KB
DecorationAreaType.html 37KB
index-6.html 37KB
SubstanceSliderUI.html 36KB
package-use.html 36KB
colorschemebundles.html 35KB
ColorSliderUI.html 35KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
lgrong1011
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页