本文整理了Java中org.netbeans.api.visual.widget.Widget.getScene()
方法的一些代码示例,展示了Widget.getScene()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Widget.getScene()
方法的具体详情如下:
包路径:org.netbeans.api.visual.widget.Widget
类名称:Widget
方法名:getScene
[英]Returns a scene where the widget is assigned
[中]返回分配小部件的场景
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public DevolveWidgetLayout (Widget widget, Layout devolveLayout, boolean animate) {
super (widget.getScene ());
assert devolveLayout != null;
this.widget = widget;
this.devolveLayout = devolveLayout;
this.animate = animate;
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public DevolveWidgetLayout (Widget widget, Layout devolveLayout, boolean animate) {
super (widget.getScene ());
assert devolveLayout != null;
this.widget = widget;
this.devolveLayout = devolveLayout;
this.animate = animate;
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public boolean switchPreviousFocus (Widget widget) {
Scene scene = widget.getScene ();
return scene instanceof ObjectScene && switchFocus ((ObjectScene) scene, false);
}
代码示例来源:origin: net.sourceforge.javydreamercsw/Client-UI
@Override
public void select(Widget widget, Point localLocation,
boolean invertSelection) {
LOG.log(Level.FINE,
"sel.select {0}", localLocation);
widget.getScene().setFocusedWidget(widget);
}
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public boolean switchNextFocus (Widget widget) {
Scene scene = widget.getScene ();
return scene instanceof ObjectScene && switchFocus ((ObjectScene) scene, true);
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public Locale getLocale () throws IllegalComponentStateException {
JComponent view = widget.getScene ().getView ();
return view != null ? view.getLocale () : Locale.getDefault ();
}
代码示例来源:origin: nl.cloudfarming.client/geoviewer-editor
@Override
public State keyPressed(Widget widget, WidgetKeyEvent event) {
if (event.getKeyCode() == KeyEvent.VK_SHIFT) {
widget.getScene().setActiveTool(CONNECT_TOOL);
}
return State.REJECTED;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf-navigation
public void edit(Widget widget) {
PageFlowScene scene = (PageFlowScene) widget.getScene();
PageFlowSceneElement element = (PageFlowSceneElement) scene.findObject(widget);
MapActionUtility.openPageFlowSceneElement(element);
}
}
代码示例来源:origin: nl.cloudfarming.client/geoviewer-editor
@Override
public State keyReleased(Widget widget, WidgetKeyEvent event) {
if (event.getKeyCode() == KeyEvent.VK_SHIFT) {
widget.getScene().setActiveTool(null);
}
return State.REJECTED;
}
}
代码示例来源:origin: nl.cloudfarming.client/geoviewer-editor
@Override
public State keyPressed(Widget widget, WidgetKeyEvent event) {
if (event.getKeyCode() == KeyEvent.VK_CONTROL) {
widget.getScene().setActiveTool(MOVE_TOOL);
}
return State.REJECTED;
}
代码示例来源:origin: nl.cloudfarming.client/geoviewer-editor
@Override
public State keyReleased(Widget widget, WidgetKeyEvent event) {
if (event.getKeyCode() == KeyEvent.VK_CONTROL) {
widget.getScene().setActiveTool(null);
}
return State.REJECTED;
}
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public void notifyClosing (EditorController controller, Widget widget, JTextField editor, boolean commit) {
editor.getDocument ().removeDocumentListener (documentListener);
editor.removeFocusListener (focusListener);
editor.removeKeyListener (keyListener);
if (commit) {
this.editor.setText (widget, editor.getText ());
if (widget != null)
widget.getScene ().validate ();
}
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public void notifyClosing (EditorController controller, Widget widget, JTextField editor, boolean commit) {
editor.getDocument ().removeDocumentListener (documentListener);
editor.removeFocusListener (focusListener);
editor.removeKeyListener (keyListener);
if (commit) {
this.editor.setText (widget, editor.getText ());
if (widget != null)
widget.getScene ().validate ();
}
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public State mouseMoved (Widget widget, WidgetMouseEvent event) {
updateForViewPoint (widget.getScene ().convertSceneToView (widget.convertLocalToScene (event.getPoint ())));
return State.CONSUMED;
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public State mouseDragged (Widget widget, WidgetMouseEvent event) {
updateForViewPoint (widget.getScene ().convertSceneToView (widget.convertLocalToScene (event.getPoint ())));
return State.CONSUMED;
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
private boolean move (Widget widget, Point point) {
if (sourceWidget != widget)
return false;
Point targetSceneLocation = widget.convertLocalToScene (point);
targetWidget = resolveTargetWidgetCore (interractionLayer.getScene (), targetSceneLocation);
Anchor targetAnchor = null;
if (targetWidget != null)
targetAnchor = decorator.createTargetAnchor (targetWidget);
if (targetAnchor == null)
targetAnchor = decorator.createFloatAnchor (targetSceneLocation);
connectionWidget.setTargetAnchor (targetAnchor);
return true;
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
private boolean move (Widget widget, Point point) {
if (sourceWidget != widget)
return false;
Point targetSceneLocation = widget.convertLocalToScene (point);
targetWidget = resolveTargetWidgetCore (interractionLayer.getScene (), targetSceneLocation);
Anchor targetAnchor = null;
if (targetWidget != null)
targetAnchor = decorator.createTargetAnchor (targetWidget);
if (targetAnchor == null)
targetAnchor = decorator.createFloatAnchor (targetSceneLocation);
connectionWidget.setTargetAnchor (targetAnchor);
return true;
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
/**
* Sets a focused widget of the scene.
* @param focusedWidget the focused widget; if null, then the scene itself is taken as the focused widget
*/
public final void setFocusedWidget (Widget focusedWidget) {
if (focusedWidget == null)
focusedWidget = this;
else
assert focusedWidget.getScene () == this;
this.focusedWidget.setState (this.focusedWidget.getState ().deriveWidgetFocused (false));
this.focusedWidget = focusedWidget;
this.focusedWidget.setState (this.focusedWidget.getState ().deriveWidgetFocused (true));
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
protected void performLayout () {
devolveLayout.layout (widget);
for (Widget child : widget.getChildren ()) {
if (animate)
widget.getScene ().getSceneAnimator ().animatePreferredLocation (child, child.getLocation ());
else
child.setPreferredLocation (child.getLocation ());
child.revalidate ();
}
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
protected void performLayout () {
devolveLayout.layout (widget);
for (Widget child : widget.getChildren ()) {
if (animate)
widget.getScene ().getSceneAnimator ().animatePreferredLocation (child, child.getLocation ());
else
child.setPreferredLocation (child.getLocation ());
child.revalidate ();
}
}
内容来源于网络,如有侵权,请联系作者删除!