Exemplo n.º 1
0
 /**
  * Returns the display string for a specified field. Returns, for snumber and dnumber, the name of
  * the objecttype they represent, and for rnumber the display (GUI) string for the indicated
  * relation definition.
  *
  * @param field The name of the field to retrieve
  * @param node Node from which to retrieve the data
  * @return A <code>String</code> describing the content of the field
  */
 @Override
 public String getGUIIndicator(String field, MMObjectNode node) {
   try {
     if (field.equals("snumber")) {
       return mmb.getTypeDef().getValue(node.getIntValue("snumber"));
     } else if (field.equals("dnumber")) {
       return mmb.getTypeDef().getValue(node.getIntValue("dnumber"));
     } else if (field.equals("rnumber")) {
       MMObjectNode reldef = mmb.getRelDef().getNode(node.getIntValue("rnumber"));
       return (reldef != null ? reldef.getGUIIndicator() : "???");
     }
   } catch (Exception e) {
   }
   return null;
 }
Exemplo n.º 2
0
 /**
  * Returns the display string for this node It returns a commbination of objecttypes and rolename
  * : "source->destination (role)".
  *
  * @param node Node from which to retrieve the data
  * @return A <code>String</code> describing the content of the node
  */
 @Override
 public String getGUIIndicator(MMObjectNode node) {
   try {
     String source = mmb.getTypeDef().getValue(node.getIntValue("snumber"));
     String destination = mmb.getTypeDef().getValue(node.getIntValue("dnumber"));
     MMObjectNode role = mmb.getRelDef().getNode(node.getIntValue("rnumber"));
     return source
         + "->"
         + destination
         + " ("
         + (role != null ? role.getGUIIndicator() : "???")
         + ")";
   } catch (Exception e) {
     log.warn(e);
   }
   return null;
 }