当前位置: 首页>>代码示例>>Java>>正文


Java PropertyChangeEvent.getNewValue方法代码示例

本文整理汇总了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);
  }
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:20,代码来源:ShowServerStatusAction.java

示例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();
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:StepIntoJSHandler.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:Repository.java

示例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();
    }
}
 
开发者ID:PtitNoony,项目名称:FxTreeMap,代码行数:19,代码来源:FxTreeMap.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:AnnotationImplTest.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:EmbeddedFrame.java

示例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

        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:WordMatch.java

示例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();
        }
    }
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:11,代码来源:ImagePreview.java

示例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);
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:EditorBookmarksModule.java

示例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();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:11,代码来源:PopupPanel.java

示例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");
        }
    }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:12,代码来源:CarTracker.java

示例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;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:36,代码来源:Test4353056.java

示例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();
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:40,代码来源:NbToolTip.java

示例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 );
            }

        }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:CustomizerDialog.java

示例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;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:OpenProjectListTest.java


注:本文中的java.beans.PropertyChangeEvent.getNewValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。