svn commit: r12683 - trunk/src_new/org/argouml/uml/diagram/ui/FigMessage.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2007-05-26 17:20:29-0700
New Revision: 12683

Modified:
   trunk/src_new/org/argouml/uml/diagram/ui/FigMessage.java

Log:
Put back improvements with a modified Vector build.

Modified: trunk/src_new/org/argouml/uml/diagram/ui/FigMessage.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/FigMessage.java?view=diff&rev=12683&p1=trunk/src_new/org/argouml/uml/diagram/ui/FigMessage.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/FigMessage.java&r1=12682&r2=12683
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/FigMessage.java	(original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/FigMessage.java	2007-05-26 17:20:29-0700
@@ -49,7 +49,7 @@
  */
 public class FigMessage extends FigNodeModelElement {
 
-    private static Vector arrowDirections = new Vector(4);
+    private static Vector<String> arrowDirections;
 
     private FigPoly figPoly;
 
@@ -82,11 +82,11 @@
 	figPoly.setPolygon(polygon);
 	figPoly.setBounds(100, 10, 5, 18);
 
-        arrowDirections.setSize(4);
-        arrowDirections.setElementAt("North", NORTH);
-        arrowDirections.setElementAt("South", SOUTH);
-        arrowDirections.setElementAt("East", EAST);
-        arrowDirections.setElementAt("West", WEST);
+	arrowDirections = new Vector<String>(4);
+        arrowDirections.add(SOUTH, "South");
+        arrowDirections.add(EAST, "East");
+        arrowDirections.add(WEST, "West");
+        arrowDirections.add(NORTH, "North");
 
         getBigPort().setFilled(false);
         getBigPort().setLineWidth(0);
@@ -114,6 +114,7 @@
     /*
      * @see org.argouml.uml.diagram.ui.FigNodeModelElement#getNotationProviderType()
      */
+    @Override
     protected int getNotationProviderType() {
         return NotationProviderFactory2.TYPE_MESSAGE;
     }
@@ -122,6 +123,7 @@
      * @see org.argouml.uml.diagram.ui.FigNodeModelElement#updateListeners(
      * java.lang.Object, java.lang.Object)
      */
+    @Override
     protected void updateListeners(Object oldOwner, Object newOwner) {
         if (oldOwner != null) {
             removeElementListener(oldOwner);
@@ -134,11 +136,14 @@
     /*
      * @see org.argouml.uml.diagram.ui.FigNodeModelElement#placeString()
      */
-    public String placeString() { return "new Message"; }
+    @Override
+    public String placeString() {
+        // TODO: I18N
+        return "new Message";
+    }
 
-    /*
-     * @see java.lang.Object#clone()
-     */
+
+    @Override
     public Object clone() {
 	FigMessage figClone = (FigMessage) super.clone();
 	Iterator it = figClone.getFigs().iterator();
@@ -151,6 +156,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setLineColor(java.awt.Color)
      */
+    @Override
     public void setLineColor(Color col) {
 	figPoly.setLineColor(col);
 	getNameFig().setLineColor(col);
@@ -159,6 +165,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#getLineColor()
      */
+    @Override
     public Color getLineColor() {
         return figPoly.getLineColor();
     }
@@ -166,6 +173,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setFillColor(java.awt.Color)
      */
+    @Override
     public void setFillColor(Color col) {
 	//figPoly.setFillColor(col);
 	getNameFig().setFillColor(col);
@@ -174,6 +182,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#getFillColor()
      */
+    @Override
     public Color getFillColor() {
         return getNameFig().getFillColor();
     }
@@ -181,12 +190,14 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setFilled(boolean)
      */
+    @Override
     public void setFilled(boolean f) {
     }
 
     /*
      * @see org.tigris.gef.presentation.Fig#getFilled()
      */
+    @Override
     public boolean getFilled() {
         return true;
     }
@@ -194,12 +205,18 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setLineWidth(int)
      */
-    public void setLineWidth(int w) { figPoly.setLineWidth(w); }
+    @Override
+    public void setLineWidth(int w) {
+        figPoly.setLineWidth(w);
+    }
 
     /*
      * @see org.tigris.gef.presentation.Fig#getLineWidth()
      */
-    public int getLineWidth() { return figPoly.getLineWidth(); }
+    @Override
+    public int getLineWidth() {
+        return figPoly.getLineWidth();
+    }
 
     /**
      * @param direction for the arrow
@@ -257,6 +274,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#getMinimumSize()
      */
+    @Override
     public Dimension getMinimumSize() {
 	Dimension nameMin = getNameFig().getMinimumSize();
 	Dimension figPolyMin = figPoly.getSize();
@@ -270,6 +288,7 @@
      * Override setBounds to keep shapes looking right.
      * @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
      */
+    @Override
     protected void setBoundsImpl(int x, int y, int w, int h) {
         if (getNameFig() == null) {
             return;
@@ -302,7 +321,8 @@
      * 
      * @author Decki,Endi,Yayan, Politechnic of Bandung. Computer Departement
      * method for changing text of Message
-     */	
+     */
+    @Override
     protected void modelChanged(PropertyChangeEvent mee) {
         super.modelChanged(mee);
         
@@ -405,7 +425,7 @@
      * 
      * @author Decki,Endi,Yayan, Politechnic of Bandung. Computer Departement
      * method for changing text of Message
-     * @param newOwner
+     * @param newOwner model element which should now be listened to
      */
     protected void updateListeners(Object newOwner) {
         // Our superclass no longer has this method, so perhaps this whole
@@ -503,6 +523,7 @@
     /*
      * @see org.argouml.uml.diagram.ui.FigNodeModelElement#renderingChanged()
      */
+    @Override
     public void renderingChanged() {
         super.renderingChanged();
         updateArrow();
@@ -511,7 +532,7 @@
     /**
      * @return Returns the arrowDirections.
      */
-    public static Vector getArrowDirections() {
+    public static Vector<String> getArrowDirections() {
         return arrowDirections;
     }
-} /* end class FigMessage */
+}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.