本文整理了Java中org.netbeans.api.visual.widget.Widget.getState()
方法的一些代码示例,展示了Widget.getState()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Widget.getState()
方法的具体详情如下:
包路径:org.netbeans.api.visual.widget.Widget
类名称:Widget
方法名:getState
[英]Returns a state of the widget.
[中]返回小部件的状态。
代码示例来源:origin: eu.limetri.client/mapviewer-nb-swing
@Override
public void propertyChange(PropertyChangeEvent evt) {
LOGGER.log(Level.FINEST, "Received a PropertyChangeEvent for property {0}", evt.getPropertyName());
if (evt.getPropertyName().equals(Layer.PROP_PALETTE)) {
Palette palette = ((Palette) evt.getNewValue());
LOGGER.log(Level.FINEST, "Updating {0}'s palette to {1}", new String[]{node.getName(), palette.toString()});
List<Widget> widgets = scene.findWidgets(node);
for (Widget widget : widgets) {
Color color = ((Palette) evt.getNewValue()).getColorForState(widget.getState());
widget.setForeground(color);
}
scene.validate();
}
}
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public void setHovering (Widget widget) {
widget.setState (widget.getState ().deriveWidgetHovered (true));
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public void unsetHovering (Widget widget) {
widget.setState (widget.getState ().deriveWidgetHovered (false));
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public void setHovering (Widget widget) {
widget.setState (widget.getState ().deriveWidgetHovered (true));
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public void unsetHovering (Widget widget) {
widget.setState (widget.getState ().deriveWidgetHovered (false));
}
代码示例来源: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
private void updateState (Widget widget, Point localLocation) {
if (widget != null && ! widget.isHitAt (localLocation))
widget = null;
if (widget == aimedWidget)
return;
if (aimedWidget != null)
aimedWidget.setState (aimedWidget.getState ().deriveWidgetAimed (false));
aimedWidget = widget;
if (aimedWidget != null)
aimedWidget.setState (aimedWidget.getState ().deriveWidgetAimed (true));
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
private void updateState (Widget widget, Point localLocation) {
if (widget != null && ! widget.isHitAt (localLocation))
widget = null;
if (widget == aimedWidget)
return;
if (aimedWidget != null)
aimedWidget.setState (aimedWidget.getState ().deriveWidgetAimed (false));
aimedWidget = widget;
if (aimedWidget != null)
aimedWidget.setState (aimedWidget.getState ().deriveWidgetAimed (true));
}
代码示例来源:origin: org.netbeans.api/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: in.jlibs/org-netbeans-api-visual
objectStates.put (object, newState);
for (Widget widget : object2widgets.get (object))
widget.setState (widget.getState ().deriveSelected (false));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, object, previousState, newState);
objectStates.put (object, newState);
for (Widget widget : object2widgets.get (object))
widget.setState (widget.getState ().deriveSelected (true));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, object, previousState, newState);
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
objectStates.put (object, newState);
for (Widget widget : object2widgets.get (object))
widget.setState (widget.getState ().deriveSelected (false));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, object, previousState, newState);
objectStates.put (object, newState);
for (Widget widget : object2widgets.get (object))
widget.setState (widget.getState ().deriveSelected (true));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, object, previousState, newState);
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
objectStates.put (object, newState);
for (Widget widget : object2widgets.get (object))
widget.setState (widget.getState ().deriveHighlighted (false));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, object, previousState, newState);
objectStates.put (object, newState);
for (Widget widget : object2widgets.get (object))
widget.setState (widget.getState ().deriveHighlighted (true));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, object, previousState, newState);
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
objectStates.put (object, newState);
for (Widget widget : object2widgets.get (object))
widget.setState (widget.getState ().deriveHighlighted (false));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, object, previousState, newState);
objectStates.put (object, newState);
for (Widget widget : object2widgets.get (object))
widget.setState (widget.getState ().deriveHighlighted (true));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, object, previousState, newState);
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
objectStates.put (this.hoveredObject, newState);
for (Widget widget : object2widgets.get (this.hoveredObject))
widget.setState (widget.getState ().deriveObjectHovered (false));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, this.hoveredObject, previousState, newState);
objectStates.put (this.hoveredObject, newState);
for (Widget widget : object2widgets.get (this.hoveredObject))
widget.setState (widget.getState ().deriveObjectHovered (true));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, this.hoveredObject, previousState, newState);
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
objectStates.put (this.hoveredObject, newState);
for (Widget widget : object2widgets.get (this.hoveredObject))
widget.setState (widget.getState ().deriveObjectHovered (false));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, this.hoveredObject, previousState, newState);
objectStates.put (this.hoveredObject, newState);
for (Widget widget : object2widgets.get (this.hoveredObject))
widget.setState (widget.getState ().deriveObjectHovered (true));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, this.hoveredObject, previousState, newState);
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
objectStates.put (this.focusedObject, newState);
for (Widget widget : object2widgets.get (this.focusedObject))
widget.setState (widget.getState ().deriveObjectFocused (false));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, this.focusedObject, previousState, newState);
objectStates.put (this.focusedObject, newState);
for (Widget widget : object2widgets.get (this.focusedObject))
widget.setState (widget.getState ().deriveObjectFocused (true));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, this.focusedObject, previousState, newState);
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
objectStates.put (this.focusedObject, newState);
for (Widget widget : object2widgets.get (this.focusedObject))
widget.setState (widget.getState ().deriveObjectFocused (false));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, this.focusedObject, previousState, newState);
objectStates.put (this.focusedObject, newState);
for (Widget widget : object2widgets.get (this.focusedObject))
widget.setState (widget.getState ().deriveObjectFocused (true));
for (ObjectSceneListener listener : listeners)
listener.objectStateChanged (event, this.focusedObject, previousState, newState);
内容来源于网络,如有侵权,请联系作者删除!