• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JFrameOperator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: minorTicks

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
private void minorTicks(JFrameOperator jfo, String accessibleName) {
    JSliderOperator jso = new JSliderOperator(jfo,
            new AccessibleNameChooser(accessibleName));
    if (accessibleName.equals(HORIZONTAL_MINOR_TICKS_SLIDER)) {
        checkMaximum(jso, HORIZONTAL_MINOR_TICKS_SLIDER_MAXIMUM);
        checkMinimum(jso, HORIZONTAL_MINOR_TICKS_SLIDER_MINIMUM);
        checkMoveForward(jso, 2);
        checkSnapToTick(jso, 5, 6);
        assertEquals(5, jso.getMajorTickSpacing());
        assertEquals(1, jso.getMinorTickSpacing());
    } else {
        checkMaximum(jso, VERTICAL_MINOR_TICKS_SLIDER_MAXIMUM);
        checkMinimum(jso, VERTICAL_MINOR_TICKS_SLIDER_MINIMUM);
        checkMoveForward(jso, 10);
        assertEquals(20, jso.getMajorTickSpacing());
        assertEquals(5, jso.getMinorTickSpacing());
    }
    assertTrue(jso.getPaintTicks());
    assertTrue(jso.getPaintLabels());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:SliderDemoTest.java


示例2: test

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
@Test
public void test() throws Exception {

    new ClassReference(SplitPaneDemo.class.getCanonicalName()).startApplication();

    JFrameOperator frame = new JFrameOperator(DEMO_TITLE);

    JSplitPaneOperator splitPane = new JSplitPaneOperator(frame);

    // Toggle OneTouch Expandable
    checkOneTouch(frame, splitPane, true);
    checkOneTouch(frame, splitPane, false);

    // Check changing divider size to minimum and maximum values
    changeDividerSize(frame, splitPane, 50);
    changeDividerSize(frame, splitPane, 6);

    // Check moving the divider
    checkDividerMoves(frame, splitPane, false);
    checkDividerMoves(frame, splitPane, true);

    // Check different minumum Day/Night sizes
    changeMinimumSizes(frame, splitPane, 100);
    changeMinimumSizes(frame, splitPane, 0);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:SplitPaneDemoTest.java


示例3: checkDividerMoves

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
public void checkDividerMoves(JFrameOperator frame, JSplitPaneOperator splitPane, boolean isVertical) throws Exception {
    if (isVertical) {
        new JRadioButtonOperator(frame, VERTICAL_SPLIT).doClick();
    } else {
        new JRadioButtonOperator(frame, HORIZONTAL_SPLIT).doClick();
    }

    splitPane.moveDivider(0.0);
    assertEquals("Move Minimum, dividerLocation is at minimumDividerLocation",
            splitPane.getMinimumDividerLocation(), splitPane.getDividerLocation());

    // use getMaximumDividerLocation() to move divider to here because using proportion 1.0 does not work
    splitPane.moveDivider(1.0);

    assertEquals("Move Maximum, dividerLocation is at maximumDividerLocation",
            splitPane.getMaximumDividerLocation(), splitPane.getDividerLocation());

    splitPane.moveDivider(0.5);
    assertEquals("Move Middle, dividerLocation is at the artithmetic average of minimum and maximum DividerLocations",
            (splitPane.getMaximumDividerLocation() + splitPane.getMinimumDividerLocation()) / 2, splitPane.getDividerLocation());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:SplitPaneDemoTest.java


示例4: test

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
@Test
public void test() throws Exception {

    new ClassReference(ProgressBarDemo.class.getCanonicalName()).startApplication();

    JFrameOperator frame = new JFrameOperator(DEMO_TITLE);

    JButtonOperator startButton = new JButtonOperator(frame, START_BUTTON);
    JButtonOperator stopButton = new JButtonOperator(frame, STOP_BUTTON);
    JProgressBarOperator jpbo = new JProgressBarOperator(frame);

    // Check that progress completes and corect enable/disable of start/stop buttons
    checkCompleteProgress(frame, startButton, stopButton, jpbo);

    // Check progess bar progression and start/stop button disabled/enabled states
    checkStartStop(frame, startButton, stopButton, jpbo);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:ProgressBarDemoTest.java


示例5: testToggleButtons

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
private void testToggleButtons(JFrameOperator jfo) {
    ComponentChooser directionPanelChooser = new ByClassChooser(DirectionPanel.class);

    String text_Position = LayoutControlPanel.TEXT_POSITION;
    ContainerOperator<?> textPositionContainer = getLabeledContainerOperator(jfo, text_Position);
    ContainerOperator<?> directionPanelOperator = new ContainerOperator<>(textPositionContainer, directionPanelChooser);
    testRadioButtons(directionPanelOperator, 9, (t, i) -> i == 5);

    // Unfortunately, both directionPanels are in the same parent container
    // so we have to use indexes here.
    // There is no guarantee that if the UI changes, the code would be still
    // valid in terms of which directionPanel is checked first. However, it
    // does guarantee that two different directionPanels are checked.
    String content_Alignment = LayoutControlPanel.CONTENT_ALIGNMENT;
    ContainerOperator<?> contentAlignmentContainer = getLabeledContainerOperator(jfo, content_Alignment);
    ContainerOperator<?> directionPanelOperator2 = new ContainerOperator<>(contentAlignmentContainer, directionPanelChooser,
            contentAlignmentContainer.getSource() == textPositionContainer.getSource() ? 1 : 0);
    testRadioButtons(directionPanelOperator2, 9, (t, i) -> i == 4);

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:ToggleButtonDemoTest.java


示例6: changeValues

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
private void changeValues(JFrameOperator jfo, int spinnerIndex) throws Exception {
    JSpinnerOperator spinner = new JSpinnerOperator(jfo, spinnerIndex);
    JTextFieldOperator jtfo = new JTextFieldOperator(spinner);
    float originalFieldValue = decimalFormat.parse(jtfo.getText()).floatValue();
    float finalFieldValue;

    // increment by one the value via spinner
    spinner.getIncreaseOperator().push();
    finalFieldValue = decimalFormat.parse(jtfo.getText()).floatValue();

    // check that the value was increased
    assertTrue("Increment Spinner " + spinner
            + " (originalFieldValue, actual value: " + originalFieldValue + " "
            + "< finalFieldValue, actual value = " + finalFieldValue + ")",
            originalFieldValue < finalFieldValue);

    // decrease value via spinner
    spinner.getDecreaseOperator().push();
    finalFieldValue = decimalFormat.parse(jtfo.getText()).floatValue();

    // check that the value was decrimented
    assertTrue("Decrement Spinner " + spinner
            + " (originalFieldValue, actual value: " + originalFieldValue + " "
            + ">= finalFieldValue, actual value = " + finalFieldValue + ")",
            originalFieldValue >= finalFieldValue);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:SpinnerDemoTest.java


示例7: getJCheckBoxOperator

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
private JCheckBoxOperator getJCheckBoxOperator(JFrameOperator frame, int index) {

        // We map first half of indexes to the Prefixes panel and the second half
        // to the Suffixes panel
        String labelText;
        int subindex;
        if (index < CHECKBOX_COUNT / 2) {
            labelText = "Prefixes";
            subindex = index;
        } else {
            labelText = "Suffixes";
            subindex = index - CHECKBOX_COUNT / 2;
        }

        JCheckBoxOperator result = new JCheckBoxOperator(getLabeledContainerOperator(frame, labelText), subindex);
        result.setVerification(true);
        return result;
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:ListDemoTest.java


示例8: checkButton

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
public void checkButton(JFrameOperator jfo, int i, Robot rob) {
    JButtonOperator button = new JButtonOperator(jfo, i);

    Point loc = button.getLocationOnScreen();
    rob.mouseMove(loc.x, loc.y);

    BufferedImage initialButtonImage = capture(rob, button);
    assertNotBlack(initialButtonImage);
    save(initialButtonImage, "button" + i + "_0initial.png");
    rob.mousePress(InputEvent.BUTTON1_MASK);
    try {
        waitPressed(button);
        BufferedImage pressedButtonImage = capture(rob, button);
        assertNotBlack(pressedButtonImage);
        save(pressedButtonImage, "button" + i + "_1pressed.png");

        StrictImageComparator sComparator = new StrictImageComparator();
        assertNotEquals("Button " + i + " Test", sComparator, initialButtonImage, pressedButtonImage);
    } finally {
        rob.mouseRelease(InputEvent.BUTTON1_MASK);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:ButtonDemoScreenshotTest.java


示例9: showInputDialog

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
public void showInputDialog(JFrameOperator jfo) throws Exception {
    // Cancel with text case
    useInputDialog(jfo, SOME_TEXT_TO_TYPE, CANCEL);
    //TODO: wait for no dialog displayed

    // Cancel with *NO* text case
    useInputDialog(jfo, null, CANCEL);
    //TODO: wait for no dialog displayed

    // Text field has *NO* input
    useInputDialog(jfo, null, OK);
    //TODO: wait for no dialog displayed

    // Text field has input
    {
        final String enteredText = "Rambo";

        useInputDialog(jfo, enteredText, OK);
        checkMessage(enteredText + INPUT_RESPONSE);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:OptionPaneDemoTest.java


示例10: showConfirmationDialog

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
public void showConfirmationDialog(JFrameOperator jfo) throws Exception {
    // Case: Yes option selected
    {
        callADialogAndClose(jfo, CONFIRM_BUTTON, SELECT_AN_OPTION, YES);
        checkMessage(CONFIRM_YES);
    }

    // Case: No option selected
    {
        callADialogAndClose(jfo, CONFIRM_BUTTON, SELECT_AN_OPTION, NO);
        checkMessage(CONFIRM_NO);
    }

    // Case: Cancel option selected
    {
        callADialogAndClose(jfo, CONFIRM_BUTTON, SELECT_AN_OPTION, CANCEL);
        //TODO: wait for no dialog displayed
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:OptionPaneDemoTest.java


示例11: getJCheckBoxOperator

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
private JCheckBoxOperator getJCheckBoxOperator(JFrameOperator frame, int index) {

        // We map first half of indexes to the Prefixes panel and the second half
        // to the Suffixes panel
        String labelText;
        int subindex;
        if (index < CHECKBOX_COUNT / 2) {
            labelText = "Prefixes";
            subindex = index;
        } else {
            labelText = "Suffixes";
            subindex = index - CHECKBOX_COUNT / 2;
        }

        return new JCheckBoxOperator(getLabeledContainerOperator(frame, labelText), subindex);
    }
 
开发者ID:campolake,项目名称:openjdk9,代码行数:17,代码来源:ListDemoTest.java


示例12: passwordField

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
public void passwordField(JFrameOperator jfo) throws Exception {
    JPasswordFieldOperator password1 = new JPasswordFieldOperator(jfo, 0);
    JPasswordFieldOperator password2 = new JPasswordFieldOperator(jfo, 1);

    password1.typeText("password");
    password2.typeText("password");

    // Check Matching Passwords
    assertEquals("Matching Passwords", Color.green, password1.getBackground());
    assertEquals("Matching Passwords", Color.green, password2.getBackground());

    // Check non-matching passwords
    password2.typeText("passwereertegrs");
    assertEquals("Non-Matching Passwords", Color.white, password1.getBackground());
    assertEquals("Non-Matching Passwords", Color.white, password2.getBackground());
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:17,代码来源:TextFieldDemoTest.java


示例13: setUp

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
@Before
public void setUp() {
    scene = Root.ROOT.lookup().wrap();
    parent = scene.as(Parent.class, Node.class);
    contentPane = parent.lookup(new ByID<Node>(JFXPanelScrollApp.SCROLL_CONTAINER_ID)).wrap();
    frame = new JFrameOperator(JFXPanelScrollApp.class.getSimpleName());
    fxpane = new JComponentOperator(frame, new ComponentChooser() {
        public boolean checkComponent(Component component) {
            if (JFXPanel.class.isInstance(component)) {
                return true;
            }
            return false;
        }
        public String getDescription() {
            return "JFXPanel chooser";
        }
    });
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:19,代码来源:JFXPanelScrollTest.java


示例14: setUpClass

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
@BeforeClass
public static void setUpClass() throws Exception {
    System.setProperty("javafx.swinginteroperability", "true");
    JFXPanelApp.main(null);
    JemmyProperties.setCurrentDispatchingModel(JemmyProperties.ROBOT_MODEL_MASK);
    frame = new JFrameOperator(JFXPanelApp.class.getSimpleName());
    menuBtn = new JButtonOperator(frame, JFXPanelApp.MENU_POPUP_BTN);
    alphaSlider = new JSliderOperator(frame);
    fxpanel = new JComponentOperator(frame, new ComponentChooser() {
        public boolean checkComponent(Component component) {
            return JFXPanel.class.isInstance(component);
        }

        public String getDescription() {
            return "JFXPanel chooser";
        }
    });
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:19,代码来源:JFXPanelTest.java


示例15: previewForm

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
/** Pushes "Preview Form" button and waits for a frame opened.
 * @param frameName Frame class name.
 * @return JFrameOperator instance of "Form Preview" window
 */
public JFrameOperator previewForm(String frameName) {
    btPreviewForm().push();
    return (new JFrameOperator(Bundle.getString("org.netbeans.modules.form.actions.Bundle",
            "FMT_TestingForm",
            new Object[]{frameName})));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:FormDesignerOperator.java


示例16: testPreviewForm

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
/** Test preview form mode of form designer. */
public void testPreviewForm() {
    FormDesignerOperator designer = new FormDesignerOperator(SAMPLE_FRAME);
    JFrameOperator myFrame = designer.previewForm(SAMPLE_FRAME.substring(0, SAMPLE_FRAME.indexOf('.')));
    myFrame.resize(400, 400);
    myFrame.requestClose();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:FormEditorOperatorTest.java


示例17: test

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
@Test
public void test() throws Exception {
    new ClassReference(SliderDemo.class.getCanonicalName()).startApplication();
    JFrameOperator frame = new JFrameOperator(DEMO_TITLE);
    plain(frame, HORIZONTAL_PLAIN_SLIDER);
    majorTicks(frame, HORIZONTAL_MAJOR_TICKS_SLIDER);
    minorTicks(frame, HORIZONTAL_MINOR_TICKS_SLIDER);
    disabled(frame, HORIZONTAL_DISABLED_SLIDER);
    plain(frame, VERTICAL_PLAIN_SLIDER);
    majorTicks(frame, VERTICAL_MAJOR_TICKS_SLIDER);
    minorTicks(frame, VERTICAL_MINOR_TICKS_SLIDER);
    disabled(frame, VERTICAL_DISABLED_SLIDER);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:SliderDemoTest.java


示例18: plain

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
private void plain(JFrameOperator jfo, String accessibleName) {
    JSliderOperator jso = new JSliderOperator(jfo,
            new AccessibleNameChooser(accessibleName));
    if (accessibleName.equals(HORIZONTAL_PLAIN_SLIDER)) {
        checkKeyboard(jso);
        checkMouse(jso);
    }
    checkMaximum(jso, PLAIN_SLIDER_MAXIMUM);
    checkMinimum(jso, PLAIN_SLIDER_MINIMUM);
    checkMoveForward(jso, 10);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:SliderDemoTest.java


示例19: majorTicks

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
private void majorTicks(JFrameOperator jfo, String accessibleName) {
    JSliderOperator jso = new JSliderOperator(jfo,
            new AccessibleNameChooser(accessibleName));
    checkMoveForward(jso, 40);
    assertTrue(jso.getPaintTicks());
    assertEquals(100, jso.getMajorTickSpacing());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:SliderDemoTest.java


示例20: disabled

import org.netbeans.jemmy.operators.JFrameOperator; //导入依赖的package包/类
private void disabled(JFrameOperator jfo, String accessibleName)
        throws InterruptedException {
    JSliderOperator jso = new JSliderOperator(jfo,
            new AccessibleNameChooser(accessibleName));
    int initialvalue;
    initialvalue = jso.getValue();
    jso.clickMouse(jso.getCenterXForClick(), jso.getCenterYForClick(), 10);
    Thread.sleep(500);
    assertFalse(jso.hasFocus());
    assertEquals(initialvalue, jso.getValue());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:SliderDemoTest.java



注:本文中的org.netbeans.jemmy.operators.JFrameOperator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MessageDispatch类代码示例发布时间:2022-05-23
下一篇:
Java JWEAlgorithm类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap