本文整理匯總了Java中com.intellij.util.ui.UIUtil.setSliderIsFilled方法的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.setSliderIsFilled方法的具體用法?Java UIUtil.setSliderIsFilled怎麽用?Java UIUtil.setSliderIsFilled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.util.ui.UIUtil
的用法示例。
在下文中一共展示了UIUtil.setSliderIsFilled方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ContextRangePanel
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public ContextRangePanel() {
super(SwingConstants.HORIZONTAL, 0, TextDiffSettingsHolder.CONTEXT_RANGE_MODES.length - 1, 0);
setMinorTickSpacing(1);
setPaintTicks(true);
setPaintTrack(true);
setSnapToTicks(true);
UIUtil.setSliderIsFilled(this, true);
setPaintLabels(true);
//noinspection UseOfObsoleteCollectionType
Dictionary<Integer, JLabel> sliderLabels = new Hashtable<Integer, JLabel>();
for (int i = 0; i < TextDiffSettingsHolder.CONTEXT_RANGE_MODES.length; i++) {
sliderLabels.put(i, new JLabel(TextDiffSettingsHolder.CONTEXT_RANGE_MODE_LABELS[i]));
}
setLabelTable(sliderLabels);
}
示例2: createSettingsPanel
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private JComponent createSettingsPanel() {
JPanel result = new JPanel(new FlowLayout(FlowLayout.RIGHT, 3, 0));
result.add(new JLabel(ApplicationBundle.message("label.font.size")));
myFontSizeSlider = new JSlider(SwingConstants.HORIZONTAL, 0, FontSize.values().length - 1, 3);
myFontSizeSlider.setMinorTickSpacing(1);
myFontSizeSlider.setPaintTicks(true);
myFontSizeSlider.setPaintTrack(true);
myFontSizeSlider.setSnapToTicks(true);
UIUtil.setSliderIsFilled(myFontSizeSlider, true);
result.add(myFontSizeSlider);
result.setBorder(BorderFactory.createLineBorder(JBColor.border(), 1));
myFontSizeSlider.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (myIgnoreFontSizeSliderChange) {
return;
}
EditorColorsManager colorsManager = EditorColorsManager.getInstance();
EditorColorsScheme scheme = colorsManager.getGlobalScheme();
scheme.setQuickDocFontSize(FontSize.values()[myFontSizeSlider.getValue()]);
applyFontSize();
}
});
String tooltipText = ApplicationBundle.message("quickdoc.tooltip.font.size.by.wheel");
result.setToolTipText(tooltipText);
myFontSizeSlider.setToolTipText(tooltipText);
result.setVisible(false);
result.setOpaque(true);
myFontSizeSlider.setOpaque(true);
return result;
}