svn commit: r17736 - trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java
Bob Tarling <[email protected]>
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: bobtarling
Date: 2010-01-05 03:47:08-0800
New Revision: 17736
Modified:
trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java
Log:
Deprecate some methods we don't need any more and tie the Fig to closely to the model.
Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java?view=diff&pathrev=17736&r1=17735&r2=17736
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java 2010-01-05 03:47:08-0800
@@ -110,16 +110,8 @@
}
/**
- * Updates the operations box. Called from updateLayout if there is
- * a model event effecting the attributes and from renderingChanged in all
- * cases.
- * TODO: The above statement means that the entire contents of the
- * FigOperationsCompartment is being rebuilt whenever an add/remove
- * of an operation or a reception is detected. It would be better to
- * have FigOperationsCompartment itself listen for add and remove events
- * and make minimum change rather than entirely rebuild.
- * Remark MVW: This is a bit exaggerated, since the populate()
- * method is already heavily optimized.
+ * @deprecated by Bob Tarling in 0.29.3 use
+ * updateCompartment(Model.getMetaTypes().getAttribute())
*/
protected void updateOperations() {
if (!isOperationsVisible()) {
@@ -223,6 +215,10 @@
}
}
+ /**
+ * @deprecated by Bob Tarling in 0.29.3 use
+ * updateCompartment(Model.getMetaTypes().getAttribute())
+ */
protected void updateAttributes() {
FigCompartment fc = getCompartment(Model.getMetaTypes().getAttribute());
if (!fc.isVisible()) {
@@ -234,18 +230,44 @@
setBounds(getBounds());
}
+ /**
+ * Updates a compartment box. Called from updateLayout if there is
+ * a model event effecting the attributes/operations and from
+ * renderingChanged in all cases.
+ * TODO: The above statement means that the entire contents of the
+ * compartments are being rebuilt whenever an add/remove
+ * of an attribute, operation or a reception is detected. It would be
+ * better to have compartments listen for add and remove events
+ * and make minimum change rather than entirely rebuild.
+ * Remark MVW: This is a bit exaggerated, since the populate()
+ * method is already heavily optimized.
+ */
+ protected void updateCompartment(Object metaType) {
+ FigCompartment fc = getCompartment(metaType);
+ if (!fc.isVisible()) {
+ return;
+ }
+ fc.populate();
+
+ // TODO: make setBounds, calcBounds and updateBounds consistent
+ setBounds(getBounds());
+ }
/**
- * @return The Fig for the operations compartment
+ * @return The graphics for the UML operations (if any).
+ * @deprecated in 0.29.3 use
+ * getCompartment(Model.getUmlFactory(Model.getMetaTypes(),getOperation()))
+ * to determine if an operation compartment exists and return it.
+ * The operationsCompartment should be created by the concrete class
*/
protected FigOperationsCompartment getOperationsFig() {
return operationsFigCompartment;
}
/**
- * Get the bounds of the operations compartment.
- *
- * @return the bounds of the operations compartment
+ * @deprecated by Bob Tarling in 0.29.3 use
+ * getCompartment(Model.getMetaTypes().getOperation()).getBounds()
+ * @return the bounds
*/
public Rectangle getOperationsBounds() {
return operationsFigCompartment.getBounds();
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2434867
To unsubscribe from this discussion, e-mail: [[email protected]].