Java 类javafx.scene.AccessibleAttribute 实例源码

项目:Gargoyle    文件:CPagenationSkin.java   
@Override
protected Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
    switch (attribute) {
    case FOCUS_ITEM:
        return navigation.indicatorButtons.getSelectedToggle();
    case ITEM_COUNT:
        return navigation.indicatorButtons.getToggles().size();
    case ITEM_AT_INDEX: {
        Integer index = (Integer) parameters[0];
        if (index == null)
            return null;
        return navigation.indicatorButtons.getToggles().get(index);
    }
    default:
        return super.queryAccessibleAttribute(attribute, parameters);
    }
}
项目:Gargoyle    文件:DockTabPaneSkin.java   
@Override
public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
    switch (attribute) {
    case FOCUS_ITEM:
        return tabHeaderArea.getTabHeaderSkin(selectedTab);
    case ITEM_COUNT:
        return tabHeaderArea.headersRegion.getChildren().size();
    case ITEM_AT_INDEX: {
        Integer index = (Integer) parameters[0];
        if (index == null)
            return null;
        return tabHeaderArea.headersRegion.getChildren().get(index);
    }
    default:
        return super.queryAccessibleAttribute(attribute, parameters);
    }
}
项目:Gargoyle    文件:CPagenationSkin.java   
private void updatePageIndicators() {
    for (int i = 0; i < indicatorButtons.getToggles().size(); i++) {
        IndicatorButton ib = (IndicatorButton) indicatorButtons.getToggles().get(i);
        if (ib.getPageNumber() == currentIndex) {
            ib.setSelected(true);
            updatePageInformation();
            break;
        }
    }
    getSkinnable().notifyAccessibleAttributeChanged(AccessibleAttribute.FOCUS_ITEM);
}
项目:Gargoyle    文件:CPagenationSkin.java   
@Override
public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
    switch (attribute) {
    case TEXT:
        return getText();
    case SELECTED:
        return isSelected();
    default:
        return super.queryAccessibleAttribute(attribute, parameters);
    }
}
项目:Gargoyle    文件:DockTabPane.java   
@Override
public void select(int index) {
    if (index < 0 || (getItemCount() > 0 && index >= getItemCount())
            || (index == getSelectedIndex() && getModelItem(index).isSelected())) {
        return;
    }

    // Unselect the old tab
    if (getSelectedIndex() >= 0 && getSelectedIndex() < tabPane.getTabs().size()) {
        tabPane.getTabs().get(getSelectedIndex()).setSelected(false);
    }

    setSelectedIndex(index);

    DockTab tab = getModelItem(index);
    if (tab != null) {
        setSelectedItem(tab);
    }

    // Select the new tab
    if (getSelectedIndex() >= 0 && getSelectedIndex() < tabPane.getTabs().size()) {
        tabPane.getTabs().get(getSelectedIndex()).setSelected(true);
    }

    /* Does this get all the change events */
    tabPane.notifyAccessibleAttributeChanged(AccessibleAttribute.FOCUS_ITEM);
}
项目:Gargoyle    文件:DockTabPaneSkin.java   
@Override
public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
    switch (attribute) {
    case TEXT:
        return getTab().getText();
    case SELECTED:
        return selectedTab == getTab();
    default:
        return super.queryAccessibleAttribute(attribute, parameters);
    }
}
项目:myWMS    文件:BasicEntityEditor.java   
@Override
public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
    switch (attribute) {
    case FOCUS_ITEM:
        /* Internally comboBox reassign its focus the text field.
         * For the accessibility perspective it is more meaningful
         * if the focus stays with the comboBox control.
         */
        return getParent();
    default: return super.queryAccessibleAttribute(attribute, parameters);
    }
}
项目:myWMS    文件:BasicEntityEditor.java   
@Override
public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
    switch (attribute) {
    case FOCUS_ITEM:
        /* Internally comboBox reassign its focus the text field.
         * For the accessibility perspective it is more meaningful
         * if the focus stays with the comboBox control.
         */
        return getParent();
    default: return super.queryAccessibleAttribute(attribute, parameters);
    }
}
项目:JFoenix    文件:FakeFocusJFXTextField.java   
@Override
public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
    switch (attribute) {
        case FOCUS_ITEM:
            // keep focus on parent control
            return getParent();
        default: return super.queryAccessibleAttribute(attribute, parameters);
    }
}
项目:bco.bcozy    文件:TabPaneSelectionModelImpl.java   
/**
 * {@inheritDoc}
 */
@Override
public void select(int index) {
    if (index < 0 || (getItemCount() > 0 && index >= getItemCount()) ||
            (index == getSelectedIndex() && getModelItem(index).isSelected())) {
        //Tab already selected, call listener and return
        if (Objects.nonNull(clickOnSelectedTabListener)) {
            clickOnSelectedTabListener.clickOnSelectedTab(getModelItem(index));
        }
        return;
    }
    // Unselect the old tab
    setSelected(false);

    setSelectedIndex(index);

    Tab tab = getModelItem(index);
    if (tab != null) {
        setSelectedItem(tab);
    }

    // Select the new tab
    setSelected(true);

        /* Does this get all the change events */
    tabPane.notifyAccessibleAttributeChanged(AccessibleAttribute.FOCUS_ITEM);
}
项目:shuffleboard    文件:FxUtils.java   
/**
 * Gets the label associated with a node. If the node does not have a label, an empty optional is returned.
 *
 * @param node the node to get the label for
 */
public static Optional<Label> getLabel(Node node) {
  return Optional.ofNullable((Label) node.queryAccessibleAttribute(AccessibleAttribute.LABELED_BY));
}