• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java SliderOrientation类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.vaadin.shared.ui.slider.SliderOrientation的典型用法代码示例。如果您正苦于以下问题:Java SliderOrientation类的具体用法?Java SliderOrientation怎么用?Java SliderOrientation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

SliderOrientation类属于com.vaadin.shared.ui.slider包,在下文中一共展示了SliderOrientation类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: test

点赞 3

import com.vaadin.shared.ui.slider.SliderOrientation; //导入依赖的package包/类
@Test
public void test() {
    FSlider slider = new FSlider().withCaption("My Slider")
                                  .withEnabled(true)
                                  .withWidth("75%")
                                  .withMin(25.0)
                                  .withMax(75.0)
                                  .withResolution(1)
                                  .withOrientation(SliderOrientation.VERTICAL)
                                  .withValue(34.1);

    assertEquals("My Slider", slider.getCaption());
    assertTrue(slider.isEnabled());
    assertEquals(75, slider.getWidth(), 0);
    assertEquals(Unit.PERCENTAGE, slider.getWidthUnits());
    assertEquals(25, slider.getMin(), 0);
    assertEquals(34.1, slider.getValue(), 0);
    assertEquals(1, slider.getResolution());
    assertEquals(SliderOrientation.VERTICAL, slider.getOrientation());
}
 

开发者ID:viydaag,
项目名称:vaadin-fluent-api,
代码行数:21,
代码来源:FSliderTest.java

示例2: TaskSliderField

点赞 3

import com.vaadin.shared.ui.slider.SliderOrientation; //导入依赖的package包/类
public TaskSliderField() {
    progressLbl = new Label();
    progressLbl.setWidthUndefined();
    slider = new Slider();
    slider.setOrientation(SliderOrientation.HORIZONTAL);
    slider.setImmediate(true);
    slider.setWidth("150px");
    slider.addValueChangeListener(valueChangeEvent -> {
        Double value = (Double) valueChangeEvent.getProperty().getValue();
        if (value != null) {
            double roundValue = Math.ceil(value / 10) * 10;
            slider.setValue(roundValue);
            progressLbl.setValue(roundValue + "%");
            setInternalValue(roundValue);
        } else {
            slider.setValue(0d);
            progressLbl.setValue("0%");
            setInternalValue(0d);
        }
    });
    body = new MHorizontalLayout(slider, progressLbl);
}
 

开发者ID:MyCollab,
项目名称:mycollab,
代码行数:23,
代码来源:TaskSliderField.java

示例3: getOrientation

点赞 1

import com.vaadin.shared.ui.slider.SliderOrientation; //导入依赖的package包/类
/**
 * Get the current orientation of the slider (horizontal or vertical).
 * @return {@link SliderOrientation#HORIZONTAL} or {@link SliderOrientation#VERTICAL}
 */
public SliderOrientation getOrientation() {
	return getInternalField().getOrientation();
}
 

开发者ID:holon-platform,
项目名称:holon-vaadin7,
代码行数:8,
代码来源:SliderField.java

示例4: setOrientation

点赞 1

import com.vaadin.shared.ui.slider.SliderOrientation; //导入依赖的package包/类
/**
 * Set the orientation of the slider.
 * @param orientation The new orientation, either {@link SliderOrientation#HORIZONTAL} or
 *        {@link SliderOrientation#VERTICAL}
 */
public void setOrientation(SliderOrientation orientation) {
	getInternalField().setOrientation(orientation);
}
 

开发者ID:holon-platform,
项目名称:holon-vaadin7,
代码行数:9,
代码来源:SliderField.java

示例5: withOrientation

点赞 1

import com.vaadin.shared.ui.slider.SliderOrientation; //导入依赖的package包/类
/**
 * Sets the orientation of the slider.
 *
 * @param orientation
 *            the new orientation, either
 *            {@link SliderOrientation#HORIZONTAL} or
 *            {@link SliderOrientation#VERTICAL}
 * @return this for method chaining
 * @see Slider#setOrientation(SliderOrientation)
 */
@SuppressWarnings("unchecked")
public default THIS withOrientation(SliderOrientation orientation) {
    ((Slider) this).setOrientation(orientation);
    return (THIS) this;
}
 

开发者ID:viydaag,
项目名称:vaadin-fluent-api,
代码行数:16,
代码来源:FluentSlider.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)