1 18 19 package org.objectweb.jac.ide.diagrams; 20 21 import java.awt.Color ; 22 import org.objectweb.jac.ide.ModelElement; 23 24 public abstract class MemberFigure extends TextFigure 25 implements ModelElementFigure 26 { 27 ClassFigure parentFigure; 28 29 public MemberFigure(ClassFigure parentFigure) { 30 this.parentFigure = parentFigure; 31 } 32 33 public Color getTextColor() { 34 return parentFigure.getColor(); 35 } 36 37 public String getType() { 38 String text = getText(); 39 int sep = text.indexOf(':'); 40 if (sep == -1) { 41 return ""; 42 } else { 43 return text.substring(sep+1).trim(); 44 } 45 } 46 47 public String getName() { 48 String text = getText(); 49 int sep = text.indexOf(':'); 50 if (sep == -1) { 51 return text.trim(); 52 } else { 53 return text.substring(0,sep).trim(); 54 } 55 } 56 57 public abstract ModelElement getSubstance(); 58 } 59 | Popular Tags |