コード例 #1
0
 /** @param np The notationProvider to set. */
 void setNotationProvider(NotationProvider np) {
   if (notationProvider != null) {
     notationProvider.cleanListener(this, getOwner());
   }
   this.notationProvider = np;
   initNotationArguments();
 }
コード例 #2
0
 @Override
 public void propertyChange(PropertyChangeEvent pce) {
   if (notationProvider != null) {
     notationProvider.updateListener(this, getOwner(), pce);
   }
   super.propertyChange(pce);
 }
コード例 #3
0
 /**
  * @param modelElement the UML element
  * @param args a set of arguments that may influence the generated notation
  * @return a string which represents the path
  */
 static String generatePath(Object modelElement, Map args) {
   if (NotationProvider.isValue("pathVisible", args)) {
     return generatePath(modelElement);
   } else {
     return "";
   }
 }
コード例 #4
0
 /**
  * @param modelElement the UML element
  * @param args a set of arguments that may influence the generated notation
  * @return a string which represents the visibility
  * @deprecated for 0.27.3 by tfmorris. Use {@link #generateVisibility(Object)} or {@link
  *     #generateVisibility(Object, org.argouml.notation.NotationSettings)}
  */
 @Deprecated
 static String generateVisibility(Object modelElement, Map args) {
   String s = "";
   if (NotationProvider.isValue("visibilityVisible", args)) {
     s = NotationUtilityJava.generateVisibility(modelElement);
   }
   return s;
 }
コード例 #5
0
  /**
   * This is a template method called by the ArgoUML framework as the result of a change to a model
   * element. Do not call this method directly yourself.
   *
   * <p>Override this in any subclasses in order to redisplay the Fig due to change of any model
   * element that this Fig is listening to.
   *
   * <p>This method is guaranteed by the framework to be running on the Swing/AWT thread.
   *
   * @param event the UmlChangeEvent that caused the change
   */
  protected void updateLayout(UmlChangeEvent event) {
    assert event != null;

    if (notationProvider != null
        && (!"remove".equals(event.getPropertyName())
            || event.getSource() != getOwner())) { // not???
      this.setText(notationProvider.toString(getOwner(), getNotationSettings()));
      damage();
    }
  }
コード例 #6
0
 protected void initNotationProviders() {
   if (notationProvider != null) {
     notationProvider.cleanListener(this, getOwner());
   }
   if (getOwner() != null) {
     NotationName notation = Notation.findNotation(getNotationSettings().getNotationLanguage());
     notationProvider =
         NotationProviderFactory2.getInstance()
             .getNotationProvider(getNotationProviderType(), getOwner(), this, notation);
     initNotationArguments();
   }
 }
コード例 #7
0
 @Override
 protected void setText() {
   assert getOwner() != null;
   assert notationProvider != null;
   setText(notationProvider.toString(getOwner(), getNotationSettings()));
 }
コード例 #8
0
 /** Parse the edited text to adapt the UML model. */
 protected void textEdited() {
   notationProvider.parse(getOwner(), getText());
   setText();
 }
コード例 #9
0
 @Override
 public void removeFromDiagram() {
   ArgoEventPump.removeListener(ArgoEventTypes.ANY_NOTATION_EVENT, this);
   notationProvider.cleanListener(this, getOwner());
   super.removeFromDiagram();
 }