org.netbeans.api.visual.widget.Widget.getActions()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(10.6k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中org.netbeans.api.visual.widget.Widget.getActions()方法的一些代码示例,展示了Widget.getActions()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Widget.getActions()方法的具体详情如下:
包路径:org.netbeans.api.visual.widget.Widget
类名称:Widget
方法名:getActions

Widget.getActions介绍

[英]Returns a default action chain.
[中]返回默认操作链。

代码示例

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

public State keyPressed (Widget widget, WidgetKeyEvent event) {
  WidgetAction.Chain actions = forwardedToTool != null ? widget.getActions (forwardedToTool) : widget.getActions ();
  return actions != null ? actions.keyPressed (forwardToWidget, event) : State.REJECTED;
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

public State keyTyped (Widget widget, WidgetKeyEvent event) {
  WidgetAction.Chain actions = forwardedToTool != null ? widget.getActions (forwardedToTool) : widget.getActions ();
  return actions != null ? actions.keyTyped (forwardToWidget, event) : State.REJECTED;
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

public State keyPressed (Widget widget, WidgetKeyEvent event) {
  WidgetAction.Chain actions = forwardedToTool != null ? widget.getActions (forwardedToTool) : widget.getActions ();
  return actions != null ? actions.keyPressed (forwardToWidget, event) : State.REJECTED;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

public State keyTyped (Widget widget, WidgetKeyEvent event) {
  WidgetAction.Chain actions = forwardedToTool != null ? widget.getActions (forwardedToTool) : widget.getActions ();
  return actions != null ? actions.keyTyped (forwardToWidget, event) : State.REJECTED;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

public State keyReleased (Widget widget, WidgetKeyEvent event) {
  WidgetAction.Chain actions = forwardedToTool != null ? widget.getActions (forwardedToTool) : widget.getActions ();
  return actions != null ? actions.keyReleased (forwardToWidget, event) : State.REJECTED;
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

public State keyReleased (Widget widget, WidgetKeyEvent event) {
  WidgetAction.Chain actions = forwardedToTool != null ? widget.getActions (forwardedToTool) : widget.getActions ();
  return actions != null ? actions.keyReleased (forwardToWidget, event) : State.REJECTED;
}

代码示例来源:origin: it.tidalwave.semantic/it-tidalwave-semantic-graph

@Override
 public Collection<? extends Widget> createWidgets (@Nonnull final ObjectScene scene, @Nonnull final Node node)
  {
   final Widget widget = new DefaultEntityWidget(scene, node);
   widget.getActions().addAction(ActionFactory.createMoveAction());
   return Collections.singletonList(widget);
  }
};

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf-navigation

public final void updateNodeWidgetActions(Page page) {
  Widget nodeWidget = findWidget(page);
  if (nodeWidget != null) {
    if (pageSpecificActionMapAction != null) {
      nodeWidget.getActions().removeAction(pageSpecificActionMapAction);
    }
    pageSpecificActionMapAction = createActionMapAction(page);
    if (pageSpecificActionMapAction != null) {
      nodeWidget.getActions().addAction(pageSpecificActionMapAction);
    }
  }
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

private WidgetAction.State processSingleOperator (Operator operator, String tool, Widget widget, WidgetAction.WidgetEvent event) {
  WidgetAction.State state;
  state = operator.operate (widget.getActions (), widget, event);
  if (state.isConsumed ())
    return state;
  WidgetAction.Chain actions = widget.getActions (tool);
  if (actions != null) {
    state = operator.operate (actions, widget, event);
    if (state.isConsumed ())
      return state;
  }
  return WidgetAction.State.REJECTED;
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

private WidgetAction.State processSingleOperator (Operator operator, String tool, Widget widget, WidgetAction.WidgetEvent event) {
  WidgetAction.State state;
  state = operator.operate (widget.getActions (), widget, event);
  if (state.isConsumed ())
    return state;
  WidgetAction.Chain actions = widget.getActions (tool);
  if (actions != null) {
    state = operator.operate (actions, widget, event);
    if (state.isConsumed ())
      return state;
  }
  return WidgetAction.State.REJECTED;
}

代码示例来源:origin: net.sourceforge.javydreamercsw/Client-UI

public void addWidgetActions(LayerWidget mainLayer, LayerWidget connectionLayer) {
  List<Widget> children = mainLayer.getChildren();
  for (Widget widget : children) {
    // the order is important to not consume events
    widget.getActions().addAction(ActionFactory.createSelectAction(
        new SelProvider()));
    widget.getActions().addAction(ActionFactory.createMoveAction());
    widget.getActions().addAction(ActionFactory.createResizeAction());
  }
  validate();
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

private WidgetAction.State processParentOperator (Operator operator, String tool, Widget widget, WidgetAction.WidgetKeyEvent event) {
  while (widget != null) {
    WidgetAction.State state;
    state = operator.operate (widget.getActions (), widget, event);
    if (state.isConsumed ())
      return state;
    WidgetAction.Chain actions = widget.getActions (tool);
    if (actions != null) {
      state = operator.operate (actions, widget, event);
      if (state.isConsumed ())
        return state;
    }
    widget = widget.getParentWidget ();
  }
  return WidgetAction.State.REJECTED;
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

private WidgetAction.State processParentOperator (Operator operator, String tool, Widget widget, WidgetAction.WidgetKeyEvent event) {
  while (widget != null) {
    WidgetAction.State state;
    state = operator.operate (widget.getActions (), widget, event);
    if (state.isConsumed ())
      return state;
    WidgetAction.Chain actions = widget.getActions (tool);
    if (actions != null) {
      state = operator.operate (actions, widget, event);
      if (state.isConsumed ())
        return state;
    }
    widget = widget.getParentWidget ();
  }
  return WidgetAction.State.REJECTED;
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

private WidgetAction.State processOperator (Operator operator, String tool, Widget widget, WidgetAction.WidgetEvent event) {
  if (! widget.isVisible ()  ||  ! widget.isEnabled ())
    return WidgetAction.State.REJECTED;
  WidgetAction.State state;
  List<Widget> children = widget.getChildren ();
  Widget[] childrenArray = children.toArray (new Widget[children.size ()]);
  for (int i = childrenArray.length - 1; i >= 0; i --) {
    Widget child = childrenArray[i];
    state = processOperator (operator, tool, child, event);
    if (state.isConsumed ())
      return state;
  }
  state = operator.operate (widget.getActions (), widget, event);
  if (state.isConsumed ())
    return state;
  WidgetAction.Chain actions = widget.getActions (tool);
  if (actions != null) {
    state = operator.operate (actions, widget, event);
    if (state.isConsumed ())
      return state;
  }
  return WidgetAction.State.REJECTED;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

private WidgetAction.State processOperator (Operator operator, String tool, Widget widget, WidgetAction.WidgetEvent event) {
  if (! widget.isVisible ()  ||  ! widget.isEnabled ())
    return WidgetAction.State.REJECTED;
  WidgetAction.State state;
  List<Widget> children = widget.getChildren ();
  Widget[] childrenArray = children.toArray (new Widget[children.size ()]);
  for (int i = childrenArray.length - 1; i >= 0; i --) {
    Widget child = childrenArray[i];
    state = processOperator (operator, tool, child, event);
    if (state.isConsumed ())
      return state;
  }
  state = operator.operate (widget.getActions (), widget, event);
  if (state.isConsumed ())
    return state;
  WidgetAction.Chain actions = widget.getActions (tool);
  if (actions != null) {
    state = operator.operate (actions, widget, event);
    if (state.isConsumed ())
      return state;
  }
  return WidgetAction.State.REJECTED;
}

代码示例来源:origin: nl.cloudfarming.client/geoviewer-editor

@Override
  protected Widget attachNodeWidget(GeoNode node) {
    Widget geoNodeWidget = new GeoNodeWidget(this, node);

    geoNodeWidget.createActions(MOVE_TOOL).addAction(ActionFactory.createMoveAction());
//        label.getActions ().addAction (createSelectAction ());
    geoNodeWidget.getActions().addAction(createObjectHoverAction());
    geoNodeWidget.createActions(CONNECT_TOOL).addAction(connectAction);
    mainLayer.addChild(geoNodeWidget);
    return geoNodeWidget;
  }

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

/**
 * Implements attaching a widget to a node. The widget is VMDNodeWidget and has object-hover, select, popup-menu and move actions.
 * @param node the node
 * @return the widget attached to the node
 */
protected Widget attachNodeWidget (String node) {
  VMDNodeWidget widget = new VMDNodeWidget (this, scheme);
  mainLayer.addChild (widget);
  widget.getHeader ().getActions ().addAction (createObjectHoverAction ());
  widget.getActions ().addAction (createSelectAction ());
  widget.getActions ().addAction (moveAction);
  return widget;
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

/**
 * Implements attaching a widget to a node. The widget is VMDNodeWidget and has object-hover, select, popup-menu and move actions.
 * @param node the node
 * @return the widget attached to the node
 */
protected Widget attachNodeWidget (String node) {
  VMDNodeWidget widget = new VMDNodeWidget (this, scheme);
  mainLayer.addChild (widget);
  widget.getHeader ().getActions ().addAction (createObjectHoverAction ());
  widget.getActions ().addAction (createSelectAction ());
  widget.getActions ().addAction (moveAction);
  return widget;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf-navigation

public void actionPerformed(ActionEvent e) {
  /* Cancel A11y Linking */
  Object sourceObj = e.getSource();
  if (sourceObj instanceof PageFlowScene) {
    PageFlowScene scene = (PageFlowScene) sourceObj;
    PageFlowSceneElement selElement = getSelectedPageFlowSceneElement(scene);
    Widget widget = scene.findWidget(selElement);
    assert widget != null;
    EditorController controller;
    if (widget instanceof VMDNodeWidget) {
      LabelWidget labelWidget = ((VMDNodeWidget) widget).getNodeNameWidget();
      controller = findEditorController(labelWidget.getActions().getActions());
      if (controller != null) {
        controller.openEditor(labelWidget);
      }
    } else if (widget instanceof VMDConnectionWidget) {
      List<Widget> childWidgets = widget.getChildren();
      for (Widget childWidget : childWidgets) {
        if (childWidget instanceof LabelWidget) {
          controller = findEditorController(childWidget.getActions().getActions());
          if (controller != null) {
            controller.openEditor(childWidget);
          }
        }
      }
    }
  }
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

/**
 * Creates a scroll widget.
 * @param scene
 */
public ScrollWidget (Scene scene) {
  super (scene);
  setLayout (new ScrollLayout ());
  setCheckClipping (true);
  viewport = new Widget (scene);
  viewport.setCheckClipping (true);
  addChild (viewport);
  addChild (upArrow = createUpArrow ());
  addChild (verticalSlider = createVerticalSlider ());
  addChild (downArrow = createDownArrow ());
  addChild (leftArrow = createLeftArrow ());
  addChild (horizontalSlider = createHorizontalSlider ());
  addChild (rightArrow = createRightArrow ());
  upArrow.getActions ().addAction (ActionFactory.createSelectAction (new UnitScrollProvider (0, -16)));
  downArrow.getActions ().addAction (ActionFactory.createSelectAction (new UnitScrollProvider (0, 16)));
  leftArrow.getActions ().addAction (ActionFactory.createSelectAction (new UnitScrollProvider (-16, 0)));
  rightArrow.getActions ().addAction (ActionFactory.createSelectAction (new UnitScrollProvider (16, 0)));
  horizontalSlider.getActions ().addAction (new BlockScrollAction (horizontalSlider, - 64, 0));
  verticalSlider.getActions ().addAction (new BlockScrollAction (verticalSlider, 0, - 64));
  horizontalSlider.getActions ().addAction (new SliderAction (horizontalSlider));
  verticalSlider.getActions ().addAction (new SliderAction (verticalSlider));
}

相关文章