當前位置: 首頁>>代碼示例>>Java>>正文


Java StatusListener類代碼示例

本文整理匯總了Java中gate.event.StatusListener的典型用法代碼示例。如果您正苦於以下問題:Java StatusListener類的具體用法?Java StatusListener怎麽用?Java StatusListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


StatusListener類屬於gate.event包,在下文中一共展示了StatusListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: removeStatusListener

import gate.event.StatusListener; //導入依賴的package包/類
/**
 * Removes a {@link gate.event.StatusListener} from the list of listeners for
 * this processing resource
 */
public synchronized void removeStatusListener(StatusListener l) {
  if(statusListeners != null && statusListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<StatusListener> v = (Vector<StatusListener>)statusListeners.clone();
    v.removeElement(l);
    statusListeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:13,代碼來源:AbstractController.java

示例2: addStatusListener

import gate.event.StatusListener; //導入依賴的package包/類
/**
 * Adds a {@link gate.event.StatusListener} to the list of listeners for this
 * processing resource
 */
public synchronized void addStatusListener(StatusListener l) {
  @SuppressWarnings("unchecked")
  Vector<StatusListener> v =
    statusListeners == null ? new Vector<StatusListener>(2) : (Vector<StatusListener>)statusListeners.clone();
  if(!v.contains(l)) {
    v.addElement(l);
    statusListeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:14,代碼來源:AbstractController.java

示例3: removeStatusListener

import gate.event.StatusListener; //導入依賴的package包/類
public synchronized void removeStatusListener(StatusListener l) {
  if (statusListeners != null && statusListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<StatusListener> v = (Vector<StatusListener>) statusListeners.clone();
    v.removeElement(l);
    statusListeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:9,代碼來源:SerialControllerEditor.java

示例4: parseJape

import gate.event.StatusListener; //導入依賴的package包/類
protected void parseJape() 
  throws IOException, ParseException, ResourceInstantiationException
{		
  ParseCpsl parser = Factory.newJapeParser(grammarURL, encoding);
  parser.setSptClass(SinglePhaseTransducerPDA.class);

  StatusListener listener = new StatusListener(){
    public void statusChanged(String text){
      fireStatusChanged(text);
    }
  };
  parser.addStatusListener(listener);
  MultiPhaseTransducer intermediate =  parser.MultiPhaseTransducer();
  parser.removeStatusListener(listener);
  
  singlePhaseTransducersData = new SPTData[intermediate.getPhases().size()];
  SPTBuilder builder = new SPTBuilder();
  for(int i = 0; i < intermediate.getPhases().size(); i++){
    singlePhaseTransducersData[i] = builder.buildSPT(
        (SinglePhaseTransducer)intermediate.getPhases().get(i),classLoader);
  }
}
 
開發者ID:victorward,項目名稱:recruitervision,代碼行數:23,代碼來源:Transducer.java

示例5: unpackMarkup

import gate.event.StatusListener; //導入依賴的package包/類
/**
 * Unpack the markup in the document. This converts markup from the
 * native format (e.g. XML) into annotations in GATE format. Uses the
 * markupElementsMap to determine which elements to convert, and what
 * annotation type names to use. If the document was created from a
 * String, then is recomandable to set the doc's sourceUrl to <b>null</b>.
 * So, if the document has a valid URL, then the parser will try to
 * parse the XML document pointed by the URL.If the URL is not valid,
 * or is null, then the doc's content will be parsed. If the doc's
 * content is not a valid XML then the parser might crash.
 *
 * @param doc The gate document you want to parse. If
 *          <code>doc.getSourceUrl()</code> returns <b>null</b>
 *          then the content of doc will be parsed. Using a URL is
 *          recomended because the parser will report errors corectlly
 *          if the XML document is not well formed.
 */
@Override
public void unpackMarkup(Document doc, RepositioningInfo repInfo,
        RepositioningInfo ampCodingInfo) throws DocumentFormatException {
  if((doc == null)
          || (doc.getSourceUrl() == null && doc.getContent() == null)) {

    throw new DocumentFormatException(
            "GATE document is null or no content found. Nothing to parse!");
  }// End if

  // Create a status listener
  StatusListener statusListener = new StatusListener() {
    @Override
    public void statusChanged(String text) {
      // This is implemented in DocumentFormat.java and inherited here
      fireStatusChanged(text);
    }
  };

  // determine whether we have a GATE format XML document or another
  // kind
  String content = doc.getContent().toString();
  if(content.length() > 2048) {
    content = content.substring(0, 2048);
  }
  boolean gateFormat = isGateXmlFormat(content);

  if(gateFormat) {
    unpackGateFormatMarkup(doc, statusListener);
  }
  else {
    unpackGeneralXmlMarkup(doc, repInfo, ampCodingInfo, statusListener);
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:52,代碼來源:XmlDocumentFormat.java

示例6: fireStatusChangedEvent

import gate.event.StatusListener; //導入依賴的package包/類
/**
 * This methos is called whenever we need to inform the listener about an
 * event.
 */
protected void fireStatusChangedEvent(String text) {
  Iterator<StatusListener> listenersIter = myStatusListeners.iterator();
  while (listenersIter.hasNext()) {
    listenersIter.next().statusChanged(text);
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:11,代碼來源:XmlDocumentHandler.java

示例7: addStatusListener

import gate.event.StatusListener; //導入依賴的package包/類
public synchronized void addStatusListener(StatusListener l) {
  @SuppressWarnings("unchecked")
  Vector<StatusListener> v = statusListeners == null ? new Vector<StatusListener>(2) : (Vector<StatusListener>) statusListeners.clone();
  if (!v.contains(l)) {
    v.addElement(l);
    statusListeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:9,代碼來源:DocumentFormat.java

示例8: removeStatusListener

import gate.event.StatusListener; //導入依賴的package包/類
/**
 * Removes a {@link gate.event.StatusListener} from the list of listeners for
 * this processing resource
 */
public synchronized void removeStatusListener(StatusListener l) {
  if (statusListeners != null && statusListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<StatusListener> v = (Vector<StatusListener>)statusListeners.clone();
    v.removeElement(l);
    statusListeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:13,代碼來源:AbstractProcessingResource.java

示例9: addStatusListener

import gate.event.StatusListener; //導入依賴的package包/類
/**
 * Adds a {@link gate.event.StatusListener} to the list of listeners for
 * this processing resource
 */
public synchronized void addStatusListener(StatusListener l) {
  @SuppressWarnings("unchecked")
  Vector<StatusListener> v = statusListeners == null ? new Vector<StatusListener>(2) : (Vector<StatusListener>)statusListeners.clone();
  if (!v.contains(l)) {
    v.addElement(l);
    statusListeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:13,代碼來源:AbstractProcessingResource.java

示例10: fireStatusChanged

import gate.event.StatusListener; //導入依賴的package包/類
/**
 * Notifies all the {@link gate.event.StatusListener}s of a change of status.
 * @param e the message describing the status change
 */
protected void fireStatusChanged(String e) {
  if (statusListeners != null) {
    Vector<StatusListener> listeners = statusListeners;
    int count = listeners.size();
    for (int i = 0; i < count; i++) {
      listeners.elementAt(i).statusChanged(e);
    }
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:14,代碼來源:AbstractProcessingResource.java

示例11: fireStatusChanged

import gate.event.StatusListener; //導入依賴的package包/類
/**
 * Notifies all the {@link gate.event.StatusListener}s of a change of status.
 * 
 * @param e
 *          the message describing the status change
 */
protected void fireStatusChanged(String e) {
  if(statusListeners != null) {
    Vector<StatusListener> listeners = statusListeners;
    int count = listeners.size();
    for(int i = 0; i < count; i++) {
      listeners.elementAt(i).statusChanged(e);
    }
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:16,代碼來源:AbstractController.java

示例12: getPersistentRepresentation

import gate.event.StatusListener; //導入依賴的package包/類
/**
 * Recursively traverses the provided object and replaces it and all
 * its contents with the appropriate persistent equivalent classes.
 *
 * @param target the object to be analysed and translated into a
 *          persistent equivalent.
 * @return the persistent equivalent value for the provided target
 */
public static Serializable getPersistentRepresentation(Object target)
        throws PersistenceException {
  if(target == null) return null;
  // first check we don't have it already
  Persistence res = existingPersistentReplacements
          .get().getFirst().get(new ObjectHolder(target));
  if(res != null) return res;

  Class<? extends Object> type = target.getClass();
  Class<?> newType = getMostSpecificPersistentType(type);
  if(newType == null) {
    // no special handler
    if(target instanceof Serializable)
      return (Serializable)target;
    else throw new PersistenceException(
            "Could not find a serialisable replacement for " + type);
  }

  // we have a new type; create the new object, populate and return it
  try {
    res = (Persistence)newType.newInstance();
  }
  catch(Exception e) {
    throw new PersistenceException(e);
  }
  if(target instanceof NameBearer) {
    StatusListener sListener = (StatusListener)Gate.getListeners().get(
            "gate.event.StatusListener");
    if(sListener != null) {
      sListener.statusChanged("Storing " + ((NameBearer)target).getName());
    }
  }
  res.extractDataFromSource(target);
  existingPersistentReplacements.get().getFirst().put(new ObjectHolder(target), res);
  return res;
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:45,代碼來源:PersistenceManager.java

示例13: XJMenu

import gate.event.StatusListener; //導入依賴的package包/類
public XJMenu(Action a, StatusListener listener){
  super(a);
  this.description = (String)a.getValue(Action.SHORT_DESCRIPTION);
  this.listener = listener;
  // stop showing tooltip in the menu, status bar is enough
  setToolTipText(null);
  initListeners();
  getPopupMenu().setLayout(new MenuLayout());
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:10,代碼來源:XJMenu.java

示例14: XJMenuItem

import gate.event.StatusListener; //導入依賴的package包/類
public XJMenuItem(Action a, StatusListener listener){
  super(a);
  this.description = (String) a.getValue(Action.SHORT_DESCRIPTION);
  this.listener = listener;
  // stop showing tooltip in the menu, status bar is enough
  setToolTipText(null);
  initListeners();
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:9,代碼來源:XJMenuItem.java

示例15: removeStatusListener

import gate.event.StatusListener; //導入依賴的package包/類
@SuppressWarnings("unchecked")
public synchronized void removeStatusListener(StatusListener l) {
  if(statusListeners != null && statusListeners.contains(l)) {
    Vector<StatusListener> v = (Vector<StatusListener>)statusListeners
            .clone();
    v.removeElement(l);
    statusListeners = v;
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:10,代碼來源:NameBearerHandle.java


注:本文中的gate.event.StatusListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。