本文整理汇总了Java中java.beans.PropertyChangeEvent.getNewValue方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyChangeEvent.getNewValue方法的具体用法?Java PropertyChangeEvent.getNewValue怎么用?Java PropertyChangeEvent.getNewValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.beans.PropertyChangeEvent
的用法示例。
在下文中一共展示了PropertyChangeEvent.getNewValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
MessageBoard server = null;
String name = null;
if (evt.getNewValue() instanceof ServerStatus.ModuleSummary) {
final String moduleName = ((ServerStatus.ModuleSummary) evt.getNewValue()).getModuleName();
server = new HttpMessageServer(new PeerPoolInfo() {
public String getModuleName() {
return moduleName;
}
public String getUserName() {
return ((ChatServerConnection) GameModule.getGameModule().getServer()).getUserInfo().getName();
}
});
}
if (messageMgr != null) {
messageMgr.setServer(server, name);
}
}
示例2: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
if ("actionToBeRun".equals(evt.getPropertyName())) {
Object action = evt.getNewValue();
if (ActionsManager.ACTION_STEP_INTO.equals(action)) {
if (!isNotifyInvoke) {
for (MethodBreakpoint mb : scriptAccessBPs) {
logger.log(Level.FINE, "{0} enable", mb);
mb.enable();
}
}
logger.log(Level.FINE, "{0} enable", notifyInvokeBP);
notifyInvokeBP.enable();
//scriptBP.enable();
}
}
}
示例3: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
/** @param ev event with changes */
public void propertyChange(PropertyChangeEvent ev) {
if (ev.getPropertyName().equals("systemName")) {
// assign the property to new name
String ov = (String) ev.getOldValue();
String nv = (String) ev.getNewValue();
FileSystem fs = (FileSystem) ev.getSource();
if (fs.isValid()) {
// when a filesystem is valid then it is attached to a name
names.remove(ov);
}
// register name of the filesystem
names.put(nv, fs);
// the filesystem becomes valid
fs.setValid(true);
}
}
示例4: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (TreeMapUtils.ITEM_CLICKED.equals(evt.getPropertyName())) {
MapData data = (MapData) evt.getNewValue();
if (!mapLevels.containsKey(data)) {
FxMapModel newDataModel = new FxMapModel(this, data, 0, 0);
newDataModel.setTreeMapStyle(style);
mapLevels.put(data, newDataModel);
currentModel = newDataModel;
} else {
currentModel = mapLevels.get(data);
}
currentData = data;
updateBreadCrumbBar();
pane.getChildren().setAll(currentModel.getFxItems().stream().map(i -> i.getNode()).collect(Collectors.toList()));
requestLayoutUpdate();
}
}
示例5: assertEvent
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void assertEvent(String propertyName, Object old, Object now) {
for (PropertyChangeEvent e : events) {
if (propertyName.equals(e.getPropertyName())) {
if (old != null && ! old.equals(e.getOldValue()) ||
old == null && e.getOldValue() != null) {
continue;
}
if (now != null && ! now.equals(e.getNewValue()) ||
now == null && e.getNewValue() != null) {
continue;
}
return; //matched
}
}
assertTrue("Expect property change event on "+propertyName+" with "+old+" and "+now, false);
}
示例6: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
/**
* Needed to track which KeyboardFocusManager is current. We want to avoid memory
* leaks, so when KFM stops being current, we remove ourselves as listeners.
*/
public void propertyChange(PropertyChangeEvent evt) {
// We don't handle any other properties. Skip it.
if (!evt.getPropertyName().equals("managingFocus")) {
return;
}
// We only do it if it stops being current. Technically, we should
// never get an event about KFM starting being current.
if (evt.getNewValue() == Boolean.TRUE) {
return;
}
// should be the same as appletKFM
removeTraversingOutListeners((KeyboardFocusManager)evt.getSource());
appletKFM = KeyboardFocusManager.getCurrentKeyboardFocusManager();
if (isVisible()) {
addTraversingOutListeners(appletKFM);
}
}
示例7: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
String propName = evt.getPropertyName();
if (EditorUI.COMPONENT_PROPERTY.equals(propName)) {
if (prefs != null && weakListener != null) {
prefs.removePreferenceChangeListener(weakListener);
}
JTextComponent newC = (JTextComponent)evt.getNewValue();
if (newC != null) { // just installed
String mimeType = org.netbeans.lib.editor.util.swing.DocumentUtilities.getMimeType(newC);
prefs = MimeLookup.getLookup(mimeType).lookup(Preferences.class);
weakListener = WeakListeners.create(PreferenceChangeListener.class, prefsListener, prefs);
prefs.addPreferenceChangeListener(weakListener);
prefsListener.preferenceChange(null);
} else { // just deinstalled
}
}
}
示例8: 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();
}
}
}
示例9: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange (PropertyChangeEvent evt) {
// event for the editors tracker
if (evt.getSource () == EditorRegistry.class) {
if (evt.getPropertyName () == null ||
EditorRegistry.FOCUS_GAINED_PROPERTY.equals (evt.getPropertyName ())
) {
JTextComponent jtc = (JTextComponent) evt.getNewValue ();
PropertyChangeListener l = (PropertyChangeListener) jtc.getClientProperty (DOCUMENT_TRACKER_PROP);
if (l == null) {
jtc.putClientProperty (DOCUMENT_TRACKER_PROP, documentListener);
jtc.addPropertyChangeListener (documentListener);
}
myTask.schedule(100);
}
return;
}
// event for the document tracker
if (evt.getSource () instanceof JTextComponent) {
if (evt.getPropertyName () == null ||
"document".equals (evt.getPropertyName ())
) { //NOI18N
Document newDoc = (Document) evt.getNewValue ();
if (newDoc != null) {
myTask.schedule(100);
}
}
}
}
示例10: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
Component newValue = (Component) evt.getNewValue();
if (newValue == null) {
return;
}
if (!isFocusInside(newValue)) {
fireFocusLost();
}
}
示例11: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName() == SlotcarTrack.EVENT_TRACK_CHANGED) {
try {
track = (SlotcarTrack) evt.getNewValue();
setTrack(track);
} catch (Exception e) {
log.warning("caught " + e + " when handling property change");
}
}
}
示例12: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent event) {
Object value = event.getNewValue();
if (value.equals(event.getOldValue())) {
throw new Error("new value is equal to old one");
}
if (!this.name.equals(event.getPropertyName())) {
throw new Error("unexpected property name");
} else if (this.name.equals(COLOR)) {
if (!value.equals(this.color)) {
throw new Error("unexpected object value");
}
} else if (this.name.equals(BOOLEAN)) {
if (!value.equals(Boolean.valueOf(this.flag))) {
throw new Error("unexpected boolean value");
}
} else if (this.name.equals(INTEGER)) {
if (!value.equals(Integer.valueOf(this.value))) {
throw new Error("unexpected integer value");
}
} else {
throw new Error("unexpected property name");
}
if (event instanceof IndexedPropertyChangeEvent) {
IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
if (this.index != ipce.getIndex()) {
throw new Error("unexpected property index");
}
} else {
throw new Error("unexpected event type");
}
System.out.println(this.name + " at " + this.index + " is " + value);
this.name = null;
this.index = -1;
}
示例13: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
String propName = evt.getPropertyName();
if (Annotation.PROP_SHORT_DESCRIPTION.equals(propName) || AnnotationDesc.PROP_SHORT_DESCRIPTION.equals(propName)) {
final Object newValue = evt.getNewValue();
toolTipRP.post(new Runnable() {
@Override public void run() {
final String tipText;
if (newValue != null) {
tipText = (String) newValue;
} else {
if (isRequestValid()) {
tipText = getTooltipFromHighlightingLayers().toString();
if (tipText == null || tipText.isEmpty()) {
return ;
}
} else {
return ;
}
}
if (tipText != null) {
Utilities.runInEventDispatchThread( // ensure to run in AWT thread
new Runnable() {
public void run() {
final ToolTipSupport ftts = tts;
if (ftts != null) {
ftts.setToolTipText(tipText);
}
}
}
);
}
}
});
} else if (ToolTipSupport.PROP_STATUS.equals(propName)) {
if (((Integer)evt.getNewValue()).intValue() == ToolTipSupport.STATUS_HIDDEN) {
dismiss();
}
}
}
示例14: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange( PropertyChangeEvent evt ) {
if ( CustomizerPane.HELP_CTX_PROPERTY.equals( evt.getPropertyName() ) ) {
HelpCtx newHelp = (HelpCtx)evt.getNewValue();
dialogDescriptor.setHelpCtx( newHelp == null || newHelp == HelpCtx.DEFAULT_HELP ? defaultHelpCtx : newHelp );
}
}
示例15: propertyChange
import java.beans.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent arg0) {
if (OpenProjectList.PROPERTY_OPEN_PROJECTS.equals(arg0.getPropertyName())) {
Object old = arg0.getOldValue();
Object nw = arg0.getNewValue();
assertNotNull(old);
assertNotNull(nw);
Project[] oList = (Project[])old;
Project[] nList = (Project[])nw;
oldCount = oList.length;
newCount = nList.length;
}
}