Search in sources :

Example 1 with BetweenZeroAndOneValidator

use of org.gephi.lib.validation.BetweenZeroAndOneValidator in project gephi by gephi.

the class RandomGraphPanel method createValidationPanel.

public static ValidationPanel createValidationPanel(RandomGraphPanel innerPanel) {
    ValidationPanel validationPanel = new ValidationPanel();
    if (innerPanel == null) {
        innerPanel = new RandomGraphPanel();
    }
    validationPanel.setInnerComponent(innerPanel);
    ValidationGroup group = validationPanel.getValidationGroup();
    //Node field
    group.add(innerPanel.nodeField, Validators.REQUIRE_NON_EMPTY_STRING, new PositiveNumberValidator());
    //Edge field
    group.add(innerPanel.edgeField, Validators.REQUIRE_NON_EMPTY_STRING, new BetweenZeroAndOneValidator());
    return validationPanel;
}
Also used : PositiveNumberValidator(org.gephi.lib.validation.PositiveNumberValidator) ValidationGroup(org.netbeans.validation.api.ui.ValidationGroup) BetweenZeroAndOneValidator(org.gephi.lib.validation.BetweenZeroAndOneValidator) ValidationPanel(org.netbeans.validation.api.ui.ValidationPanel)

Aggregations

BetweenZeroAndOneValidator (org.gephi.lib.validation.BetweenZeroAndOneValidator)1 PositiveNumberValidator (org.gephi.lib.validation.PositiveNumberValidator)1 ValidationGroup (org.netbeans.validation.api.ui.ValidationGroup)1 ValidationPanel (org.netbeans.validation.api.ui.ValidationPanel)1