本文整理汇总了Java中java.beans.PropertyChangeEvent.getPropertyName方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyChangeEvent.getPropertyName方法的具体用法?Java PropertyChangeEvent.getPropertyName怎么用?Java PropertyChangeEvent.getPropertyName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.beans.PropertyChangeEvent
的用法示例。
在下文中一共展示了PropertyChangeEvent.getPropertyName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent ev) {
String prop = ev.getPropertyName();
if (prop == JConsoleContext.CONNECTION_STATE_PROPERTY) {
ConnectionState newState = (ConnectionState)ev.getNewValue();
// JConsole supports disconnection and reconnection
// The MBeanServerConnection will become invalid when
// disconnected. Need to use the new MBeanServerConnection object
// created at reconnection time.
if (newState == ConnectionState.CONNECTED && jtop != null) {
jtop.setMBeanServerConnection(
getContext().getMBeanServerConnection());
}
}
}
示例2: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent e) {
String name = e.getPropertyName();
if (name == "text" || "font" == name || "foreground" == name) {
// remove the old html view client property if one
// existed, and install a new one if the text installed
// into the JLabel is html source.
JLabel lbl = ((JLabel) e.getSource());
String text = lbl.getText();
BasicHTML.updateRenderer(lbl, text);
}
else if (name == "labelFor" || name == "displayedMnemonic") {
installKeyboardActions((JLabel) e.getSource());
}
}
示例3: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
String prop = evt.getPropertyName();
if (prop == JInternalFrame.IS_SELECTED_PROPERTY) {
repaint();
return;
}
if (prop == JInternalFrame.IS_ICON_PROPERTY ||
prop == JInternalFrame.IS_MAXIMUM_PROPERTY) {
setButtonIcons();
enableActions();
return;
}
if ("closable" == prop) {
if (evt.getNewValue() == Boolean.TRUE) {
add(closeButton);
} else {
remove(closeButton);
}
} else if ("maximizable" == prop) {
if (evt.getNewValue() == Boolean.TRUE) {
add(maxButton);
} else {
remove(maxButton);
}
} else if ("iconable" == prop) {
if (evt.getNewValue() == Boolean.TRUE) {
add(iconButton);
} else {
remove(iconButton);
}
}
enableActions();
revalidate();
repaint();
}
示例4: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
final String propName = evt.getPropertyName();
if (propName == null || additionalCompilerOptionsProperty.equals(propName)) {
cache = null;
listeners.fireChange();
}
}
示例5: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
/**
* This method gets called when a bound property is changed.
* @param e A <code>PropertyChangeEvent</code> object describing
* the event source and the property that has changed. Must not be null.
*
* @throws NullPointerException if the parameter is null.
* @since 1.5
*/
public void propertyChange(PropertyChangeEvent e) {
String propertyName = e.getPropertyName();
if (propertyName == "horizontalScrollBar" ||
propertyName == "verticalScrollBar") {
if (e.getNewValue() instanceof JScrollBar) {
setScrollBarRelations((JScrollBar)e.getNewValue());
}
}
}
示例6: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent e)
{
String name = e.getPropertyName();
if ( name.equals( FREE_STANDING_PROP ) )
{
handlePropertyChange( e.getNewValue() );
}
else {
super.propertyChange( e );
}
}
示例7: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent e) {
String prop = e.getPropertyName();
if (prop.equals(ZoomModel.ZOOM)) {
// mouse point
Point point = getMousePosition(true);
double oldZoom = ((Double) e.getOldValue()).doubleValue();
Rectangle r = getViewport().getViewRect();
double cx = (r.getX() + r.getWidth() / 2) / oldZoom;
double cy = (r.getY() + r.getHeight() / 2) / oldZoom;
double newZoom = ((Double) e.getNewValue()).doubleValue();
r = getViewport().getViewRect();
if (point != null) {// mouse is pointing something
int newX = (int) Math
.round(r.getX() / oldZoom * newZoom + point.getX() / oldZoom * newZoom - point.getX());
int newY = (int) Math
.round(r.getY() / oldZoom * newZoom + point.getY() / oldZoom * newZoom - point.getY());
getHorizontalScrollBar().setValue(newX);
getVerticalScrollBar().setValue(newY);
} else {// mouse is outside from canvas panel
int hv = (int) (cx * newZoom - r.getWidth() / 2);
int vv = (int) (cy * newZoom - r.getHeight() / 2);
getHorizontalScrollBar().setValue(hv);
getVerticalScrollBar().setValue(vv);
}
contents.recomputeSize();
}
}
示例8: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
String prop = evt.getPropertyName();
if (Component.Props.SIZE_PROP.equalsTo(prop)
|| Component.Props.LOCATION_PROP.equalsTo(prop) || Component.Props.EXECUTION_STATUS.equalsTo(prop)) {
refreshVisuals();
} else if (Component.Props.OUTPUTS.equalsTo(prop)) {
refreshSourceConnections();
} else if (Component.Props.INPUTS.equalsTo(prop)) {
refreshTargetConnections();
}
}
示例9: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(final PropertyChangeEvent ev) {
if( !SwingUtilities.isEventDispatchThread() ) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
propertyChange(ev);
}
});
return;
}
String pname = ev.getPropertyName();
if (NotifyDescriptor.PROP_TITLE.equals(pname)) {
dialog.setTitle(dd.getTitle());
} else if (NotifyDescriptor.PROP_NO_DEFAULT_CLOSE.equals(pname)) {
dialog.setDefaultCloseOperation(dd.isNoDefaultClose() ? JDialog.DO_NOTHING_ON_CLOSE : JDialog.DISPOSE_ON_CLOSE);
} else
if (NotifyDescriptor.PROP_MESSAGE.equals(pname)) {
dialog.updateMessage();
dialog.validate();
dialog.repaint();
} else
if (NotifyDescriptor.PROP_OPTIONS.equals(pname) || NotifyDescriptor.PROP_OPTION_TYPE.equals(pname)) {
dialog.updateOptions();
dialog.validate();
dialog.repaint();
} else if (NotifyDescriptor.PROP_INFO_NOTIFICATION.equals (ev.getPropertyName ())) {
updateNotificationLine (dialog, StandardDialog.MSG_TYPE_INFO, ev.getNewValue ());
} else if (NotifyDescriptor.PROP_WARNING_NOTIFICATION.equals (ev.getPropertyName ())) {
updateNotificationLine (dialog, StandardDialog.MSG_TYPE_WARNING, ev.getNewValue ());
} else if (NotifyDescriptor.PROP_ERROR_NOTIFICATION.equals (ev.getPropertyName ())) {
updateNotificationLine (dialog, StandardDialog.MSG_TYPE_ERROR, ev.getNewValue ());
}
}
示例10: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(@NonNull final PropertyChangeEvent event) {
final String propName = event.getPropertyName();
if (SourceRoots.PROP_ROOTS.equals(propName) ||
PROP_GENERATED_SOURCES.equals(propName)) {
activeNames = null;
}
changeSupport.fireChange();
}
示例11: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent ev) {
String prop = ev.getPropertyName();
if (AntSettings.PROP_ANT_HOME.equals(prop) ||
AntSettings.PROP_EXTRA_CLASSPATH.equals(prop) ||
AntSettings.PROP_AUTOMATIC_EXTRA_CLASSPATH.equals(prop)) {
LOG.log(Level.FINE, "AntBridge got settings change in {0}", prop);
fireChange();
} else if (ModuleInfo.PROP_ENABLED.equals(prop)) {
LOG.log(Level.FINE, "AntBridge got module enablement change on {0}", ev.getSource());
fireChange();
}
}
示例12: TypeMismatchException
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
/**
* Create a new TypeMismatchException.
* @param propertyChangeEvent the PropertyChangeEvent that resulted in the problem
* @param requiredType the required target type (or {@code null} if not known)
* @param cause the root cause (may be {@code null})
*/
public TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class<?> requiredType, Throwable cause) {
super(propertyChangeEvent,
"Failed to convert property value of type '" +
ClassUtils.getDescriptiveType(propertyChangeEvent.getNewValue()) + "'" +
(requiredType != null ?
" to required type '" + ClassUtils.getQualifiedName(requiredType) + "'" : "") +
(propertyChangeEvent.getPropertyName() != null ?
" for property '" + propertyChangeEvent.getPropertyName() + "'" : ""),
cause);
this.value = propertyChangeEvent.getNewValue();
this.requiredType = requiredType;
}
示例13: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange (PropertyChangeEvent evt) {
BreakpointsTreeModel m = getModel ();
if (m == null) return;
String propertyName = evt.getPropertyName();
if (propertyName == DebuggerManager.PROP_CURRENT_SESSION) {
m.fireTreeChanged ();
}
if (! (evt.getSource () instanceof Breakpoint))
return;
if (propertyName == Breakpoint.PROP_GROUP_NAME) {
m.fireTreeChanged ();
} else {
if (propertyName == Breakpoint.PROP_VALIDITY) {
Breakpoint b = (Breakpoint) evt.getSource();
if (m.isClosedProjectBreakpoint(b)) {
m.fireTreeChanged ();
return ;
}
}
m.fireTreeChanged (new ModelEvent.NodeChanged(
m, evt.getSource ()));
if (propertyName == Breakpoint.PROP_ENABLED) {
Breakpoint bp = (Breakpoint) evt.getSource ();
String groupName = bp.getGroupName();
if (groupName != null) {
m.fireTreeChanged (new ModelEvent.NodeChanged(
m, groupName));
}
}
}
}
示例14: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
String name = evt.getPropertyName();
if (name == null || "enabled".equals(name)) {
previousError.setEnabled(prevAction.isEnabled());
nextError.setEnabled(nextAction.isEnabled());
if (selectOnEnable && evt.getSource() == nextAction && nextAction.isEnabled()) {
selectOnEnable = false;
nextAction.actionPerformed(null);
}
selectOnEnable = false;
}
}
示例15: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent e) {
String prop = e.getPropertyName();
if (prop.equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) {
file = (File) e.getNewValue();
if (isShowing()) {
loadImage();
repaint();
}
}
}