| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
|
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
package org.argouml.uml.diagram.deployment.ui; |
| 40 | |
|
| 41 | |
import java.awt.Point; |
| 42 | |
import java.awt.Rectangle; |
| 43 | |
import java.beans.PropertyVetoException; |
| 44 | |
import java.util.ArrayList; |
| 45 | |
import java.util.Collection; |
| 46 | |
|
| 47 | |
import javax.swing.Action; |
| 48 | |
|
| 49 | |
import org.apache.log4j.Logger; |
| 50 | |
import org.argouml.i18n.Translator; |
| 51 | |
import org.argouml.model.Facade; |
| 52 | |
import org.argouml.model.Model; |
| 53 | |
import org.argouml.ui.CmdCreateNode; |
| 54 | |
import org.argouml.uml.diagram.DiagramElement; |
| 55 | |
import org.argouml.uml.diagram.DiagramSettings; |
| 56 | |
import org.argouml.uml.diagram.deployment.DeploymentDiagramGraphModel; |
| 57 | |
import org.argouml.uml.diagram.static_structure.ui.FigClass; |
| 58 | |
import org.argouml.uml.diagram.static_structure.ui.FigComment; |
| 59 | |
import org.argouml.uml.diagram.static_structure.ui.FigInterface; |
| 60 | |
import org.argouml.uml.diagram.static_structure.ui.FigPackage; |
| 61 | |
import org.argouml.uml.diagram.ui.ActionSetAddAssociationMode; |
| 62 | |
import org.argouml.uml.diagram.ui.ActionSetMode; |
| 63 | |
import org.argouml.uml.diagram.ui.FigNodeAssociation; |
| 64 | |
import org.argouml.uml.diagram.ui.FigNodeModelElement; |
| 65 | |
import org.argouml.uml.diagram.ui.RadioAction; |
| 66 | |
import org.argouml.uml.diagram.ui.UMLDiagram; |
| 67 | |
import org.argouml.uml.diagram.use_case.ui.FigActor; |
| 68 | |
import org.argouml.uml.diagram.use_case.ui.FigUseCase; |
| 69 | |
import org.argouml.util.ToolBarUtility; |
| 70 | |
import org.tigris.gef.base.LayerPerspective; |
| 71 | |
import org.tigris.gef.base.LayerPerspectiveMutable; |
| 72 | |
import org.tigris.gef.base.ModeCreatePolyEdge; |
| 73 | |
import org.tigris.gef.presentation.FigNode; |
| 74 | |
|
| 75 | |
|
| 76 | |
|
| 77 | |
|
| 78 | |
|
| 79 | |
|
| 80 | |
|
| 81 | |
|
| 82 | |
|
| 83 | |
|
| 84 | |
public class UMLDeploymentDiagram extends UMLDiagram { |
| 85 | |
|
| 86 | |
|
| 87 | |
|
| 88 | 19 | private static final Logger LOG = |
| 89 | |
Logger.getLogger(UMLDeploymentDiagram.class); |
| 90 | |
|
| 91 | |
|
| 92 | |
|
| 93 | |
|
| 94 | |
private Action actionMNode; |
| 95 | |
private Action actionMNodeInstance; |
| 96 | |
private Action actionMComponent; |
| 97 | |
private Action actionMComponentInstance; |
| 98 | |
private Action actionMClass; |
| 99 | |
private Action actionMInterface; |
| 100 | |
private Action actionMObject; |
| 101 | |
private Action actionMDependency; |
| 102 | |
private Action actionMAssociation; |
| 103 | |
private Action actionMLink; |
| 104 | |
private Action actionAssociation; |
| 105 | |
private Action actionAggregation; |
| 106 | |
private Action actionComposition; |
| 107 | |
private Action actionUniAssociation; |
| 108 | |
private Action actionUniAggregation; |
| 109 | |
private Action actionUniComposition; |
| 110 | |
private Action actionMGeneralization; |
| 111 | |
private Action actionMAbstraction; |
| 112 | |
|
| 113 | |
|
| 114 | |
|
| 115 | |
|
| 116 | |
|
| 117 | |
|
| 118 | |
|
| 119 | |
@Deprecated |
| 120 | 19 | public UMLDeploymentDiagram() { |
| 121 | |
try { |
| 122 | 19 | setName(getNewDiagramName()); |
| 123 | 19 | } catch (PropertyVetoException pve) { } |
| 124 | |
|
| 125 | 19 | setGraphModel(createGraphModel()); |
| 126 | 19 | } |
| 127 | |
|
| 128 | |
|
| 129 | |
|
| 130 | |
|
| 131 | |
|
| 132 | |
|
| 133 | |
@Deprecated |
| 134 | |
public UMLDeploymentDiagram(Object namespace) { |
| 135 | 19 | this(); |
| 136 | 19 | setNamespace(namespace); |
| 137 | 19 | } |
| 138 | |
|
| 139 | |
|
| 140 | |
|
| 141 | |
|
| 142 | |
|
| 143 | |
|
| 144 | |
|
| 145 | |
|
| 146 | |
|
| 147 | |
|
| 148 | |
|
| 149 | |
|
| 150 | |
|
| 151 | |
|
| 152 | |
|
| 153 | |
|
| 154 | |
|
| 155 | |
public void setNamespace(Object handle) { |
| 156 | 19 | if (!Model.getFacade().isANamespace(handle)) { |
| 157 | 0 | LOG.error( |
| 158 | |
"Illegal argument. Object " + handle + " is not a namespace"); |
| 159 | 0 | throw new IllegalArgumentException( |
| 160 | |
"Illegal argument. Object " + handle + " is not a namespace"); |
| 161 | |
} |
| 162 | 19 | Object m = handle; |
| 163 | 19 | boolean init = (null == getNamespace()); |
| 164 | 19 | super.setNamespace(m); |
| 165 | 19 | DeploymentDiagramGraphModel gm = createGraphModel(); |
| 166 | 19 | gm.setHomeModel(m); |
| 167 | 19 | if (init) { |
| 168 | 19 | LayerPerspective lay = |
| 169 | |
new LayerPerspectiveMutable(Model.getFacade().getName(m), gm); |
| 170 | 19 | DeploymentDiagramRenderer rend = new DeploymentDiagramRenderer(); |
| 171 | 19 | lay.setGraphNodeRenderer(rend); |
| 172 | 19 | lay.setGraphEdgeRenderer(rend); |
| 173 | 19 | setLayer(lay); |
| 174 | |
} |
| 175 | 19 | } |
| 176 | |
|
| 177 | |
|
| 178 | |
|
| 179 | |
private DeploymentDiagramGraphModel createGraphModel() { |
| 180 | 38 | if ((getGraphModel() instanceof DeploymentDiagramGraphModel)) { |
| 181 | 19 | return (DeploymentDiagramGraphModel) getGraphModel(); |
| 182 | |
} else { |
| 183 | 19 | return new DeploymentDiagramGraphModel(); |
| 184 | |
} |
| 185 | |
} |
| 186 | |
|
| 187 | |
|
| 188 | |
|
| 189 | |
|
| 190 | |
protected Object[] getUmlActions() { |
| 191 | 19 | Object[] actions = { |
| 192 | |
getActionMNode(), |
| 193 | |
getActionMNodeInstance(), |
| 194 | |
getActionMComponent(), |
| 195 | |
getActionMComponentInstance(), |
| 196 | |
getActionMGeneralization(), |
| 197 | |
getActionMAbstraction(), |
| 198 | |
getActionMDependency(), |
| 199 | |
getAssociationActions(), |
| 200 | |
getActionMObject(), |
| 201 | |
getActionMLink(), |
| 202 | |
}; |
| 203 | 19 | return actions; |
| 204 | |
} |
| 205 | |
|
| 206 | |
private Object[] getAssociationActions() { |
| 207 | 19 | Object[][] actions = { |
| 208 | |
{getActionAssociation(), getActionUniAssociation() }, |
| 209 | |
{getActionAggregation(), getActionUniAggregation() }, |
| 210 | |
{getActionComposition(), getActionUniComposition() }, |
| 211 | |
}; |
| 212 | 19 | ToolBarUtility.manageDefault(actions, "diagram.deployment.association"); |
| 213 | 19 | return actions; |
| 214 | |
} |
| 215 | |
|
| 216 | |
|
| 217 | |
|
| 218 | |
|
| 219 | |
static final long serialVersionUID = -375918274062198744L; |
| 220 | |
|
| 221 | |
|
| 222 | |
|
| 223 | |
|
| 224 | |
public String getLabelName() { |
| 225 | 19 | return Translator.localize("label.deployment-diagram"); |
| 226 | |
} |
| 227 | |
|
| 228 | |
|
| 229 | |
|
| 230 | |
|
| 231 | |
|
| 232 | |
|
| 233 | |
|
| 234 | |
|
| 235 | |
protected Action getActionAggregation() { |
| 236 | 19 | if (actionAggregation == null) { |
| 237 | 19 | actionAggregation = |
| 238 | |
new RadioAction( |
| 239 | |
new ActionSetAddAssociationMode( |
| 240 | |
Model.getAggregationKind().getAggregate(), |
| 241 | |
false, |
| 242 | |
"button.new-aggregation")); |
| 243 | |
} |
| 244 | 19 | return actionAggregation; |
| 245 | |
} |
| 246 | |
|
| 247 | |
|
| 248 | |
|
| 249 | |
|
| 250 | |
protected Action getActionAssociation() { |
| 251 | 19 | if (actionAssociation == null) { |
| 252 | 19 | actionAssociation = |
| 253 | |
new RadioAction( |
| 254 | |
new ActionSetAddAssociationMode( |
| 255 | |
Model.getAggregationKind().getNone(), |
| 256 | |
false, |
| 257 | |
"button.new-association")); |
| 258 | |
} |
| 259 | 19 | return actionAssociation; |
| 260 | |
} |
| 261 | |
|
| 262 | |
|
| 263 | |
|
| 264 | |
|
| 265 | |
protected Action getActionComposition() { |
| 266 | 19 | if (actionComposition == null) { |
| 267 | 19 | actionComposition = |
| 268 | |
new RadioAction( |
| 269 | |
new ActionSetAddAssociationMode( |
| 270 | |
Model.getAggregationKind().getComposite(), |
| 271 | |
false, |
| 272 | |
"button.new-composition")); |
| 273 | |
} |
| 274 | 19 | return actionComposition; |
| 275 | |
} |
| 276 | |
|
| 277 | |
|
| 278 | |
|
| 279 | |
|
| 280 | |
protected Action getActionMAssociation() { |
| 281 | 0 | if (actionMAssociation == null) { |
| 282 | 0 | actionMAssociation = |
| 283 | |
new RadioAction(new ActionSetMode( |
| 284 | |
ModeCreatePolyEdge.class, |
| 285 | |
"edgeClass", |
| 286 | |
Model.getMetaTypes().getAssociation(), |
| 287 | |
"button.new-association")); |
| 288 | |
} |
| 289 | 0 | return actionMAssociation; |
| 290 | |
} |
| 291 | |
|
| 292 | |
|
| 293 | |
|
| 294 | |
|
| 295 | |
protected Action getActionMClass() { |
| 296 | 0 | if (actionMClass == null) { |
| 297 | 0 | actionMClass = |
| 298 | |
new RadioAction( |
| 299 | |
new CmdCreateNode(Model.getMetaTypes().getUMLClass(), |
| 300 | |
"button.new-class")); |
| 301 | |
} |
| 302 | 0 | return actionMClass; |
| 303 | |
} |
| 304 | |
|
| 305 | |
|
| 306 | |
|
| 307 | |
|
| 308 | |
protected Action getActionMComponent() { |
| 309 | 19 | if (actionMComponent == null) { |
| 310 | 19 | actionMComponent = |
| 311 | |
new RadioAction( |
| 312 | |
new CmdCreateNode( |
| 313 | |
Model.getMetaTypes().getComponent(), |
| 314 | |
"button.new-component")); |
| 315 | |
} |
| 316 | 19 | return actionMComponent; |
| 317 | |
} |
| 318 | |
|
| 319 | |
|
| 320 | |
|
| 321 | |
|
| 322 | |
protected Action getActionMComponentInstance() { |
| 323 | 19 | if (actionMComponentInstance == null) { |
| 324 | 19 | actionMComponentInstance = |
| 325 | |
new RadioAction(new CmdCreateNode( |
| 326 | |
Model.getMetaTypes().getComponentInstance(), |
| 327 | |
"button.new-componentinstance")); |
| 328 | |
} |
| 329 | 19 | return actionMComponentInstance; |
| 330 | |
} |
| 331 | |
|
| 332 | |
|
| 333 | |
|
| 334 | |
|
| 335 | |
protected Action getActionMDependency() { |
| 336 | 19 | if (actionMDependency == null) { |
| 337 | 19 | actionMDependency = |
| 338 | |
new RadioAction(new ActionSetMode( |
| 339 | |
ModeCreatePolyEdge.class, |
| 340 | |
"edgeClass", |
| 341 | |
Model.getMetaTypes().getDependency(), |
| 342 | |
"button.new-dependency")); |
| 343 | |
} |
| 344 | 19 | return actionMDependency; |
| 345 | |
} |
| 346 | |
|
| 347 | |
|
| 348 | |
|
| 349 | |
|
| 350 | |
protected Action getActionMGeneralization() { |
| 351 | 19 | if (actionMGeneralization == null) { |
| 352 | 19 | actionMGeneralization = |
| 353 | |
new RadioAction(new ActionSetMode( |
| 354 | |
ModeCreatePolyEdge.class, |
| 355 | |
"edgeClass", |
| 356 | |
Model.getMetaTypes().getGeneralization(), |
| 357 | |
"button.new-generalization")); |
| 358 | |
} |
| 359 | 19 | return actionMGeneralization; |
| 360 | |
} |
| 361 | |
|
| 362 | |
|
| 363 | |
|
| 364 | |
|
| 365 | |
protected Action getActionMAbstraction() { |
| 366 | 19 | if (actionMAbstraction == null) { |
| 367 | 19 | actionMAbstraction = |
| 368 | |
new RadioAction(new ActionSetMode( |
| 369 | |
ModeCreatePolyEdge.class, |
| 370 | |
"edgeClass", |
| 371 | |
Model.getMetaTypes().getAbstraction(), |
| 372 | |
"button.new-realization")); |
| 373 | |
} |
| 374 | 19 | return actionMAbstraction; |
| 375 | |
} |
| 376 | |
|
| 377 | |
|
| 378 | |
|
| 379 | |
|
| 380 | |
protected Action getActionMInterface() { |
| 381 | 0 | if (actionMInterface == null) { |
| 382 | 0 | actionMInterface = |
| 383 | |
new RadioAction( |
| 384 | |
new CmdCreateNode( |
| 385 | |
Model.getMetaTypes().getInterface(), |
| 386 | |
"button.new-interface")); |
| 387 | |
} |
| 388 | 0 | return actionMInterface; |
| 389 | |
} |
| 390 | |
|
| 391 | |
|
| 392 | |
|
| 393 | |
|
| 394 | |
protected Action getActionMLink() { |
| 395 | 19 | if (actionMLink == null) { |
| 396 | 19 | actionMLink = |
| 397 | |
new RadioAction(new ActionSetMode( |
| 398 | |
ModeCreatePolyEdge.class, |
| 399 | |
"edgeClass", |
| 400 | |
Model.getMetaTypes().getLink(), |
| 401 | |
"button.new-link")); |
| 402 | |
} |
| 403 | 19 | return actionMLink; |
| 404 | |
} |
| 405 | |
|
| 406 | |
|
| 407 | |
|
| 408 | |
|
| 409 | |
protected Action getActionMNode() { |
| 410 | 19 | if (actionMNode == null) { |
| 411 | 19 | actionMNode = |
| 412 | |
new RadioAction(new CmdCreateNode( |
| 413 | |
Model.getMetaTypes().getNode(), |
| 414 | |
"button.new-node")); |
| 415 | |
} |
| 416 | 19 | return actionMNode; |
| 417 | |
} |
| 418 | |
|
| 419 | |
|
| 420 | |
|
| 421 | |
|
| 422 | |
protected Action getActionMNodeInstance() { |
| 423 | 19 | if (actionMNodeInstance == null) { |
| 424 | 19 | actionMNodeInstance = |
| 425 | |
new RadioAction(new CmdCreateNode( |
| 426 | |
Model.getMetaTypes().getNodeInstance(), |
| 427 | |
"button.new-nodeinstance")); |
| 428 | |
} |
| 429 | 19 | return actionMNodeInstance; |
| 430 | |
} |
| 431 | |
|
| 432 | |
|
| 433 | |
|
| 434 | |
|
| 435 | |
protected Action getActionMObject() { |
| 436 | 19 | if (actionMObject == null) { |
| 437 | 19 | actionMObject = |
| 438 | |
new RadioAction( |
| 439 | |
new CmdCreateNode(Model.getMetaTypes().getObject(), |
| 440 | |
"button.new-object")); |
| 441 | |
} |
| 442 | 19 | return actionMObject; |
| 443 | |
} |
| 444 | |
|
| 445 | |
|
| 446 | |
|
| 447 | |
|
| 448 | |
protected Action getActionUniAggregation() { |
| 449 | 19 | if (actionUniAggregation == null) { |
| 450 | 19 | actionUniAggregation = |
| 451 | |
new RadioAction( |
| 452 | |
new ActionSetAddAssociationMode( |
| 453 | |
Model.getAggregationKind().getAggregate(), |
| 454 | |
true, "button.new-uniaggregation")); |
| 455 | |
} |
| 456 | 19 | return actionUniAggregation; |
| 457 | |
} |
| 458 | |
|
| 459 | |
|
| 460 | |
|
| 461 | |
|
| 462 | |
protected Action getActionUniAssociation() { |
| 463 | 19 | if (actionUniAssociation == null) { |
| 464 | 19 | actionUniAssociation = |
| 465 | |
new RadioAction( |
| 466 | |
new ActionSetAddAssociationMode( |
| 467 | |
Model.getAggregationKind().getNone(), |
| 468 | |
true, "button.new-uniassociation")); |
| 469 | |
} |
| 470 | 19 | return actionUniAssociation; |
| 471 | |
} |
| 472 | |
|
| 473 | |
|
| 474 | |
|
| 475 | |
|
| 476 | |
protected Action getActionUniComposition() { |
| 477 | 19 | if (actionUniComposition == null) { |
| 478 | 19 | actionUniComposition = |
| 479 | |
new RadioAction( |
| 480 | |
new ActionSetAddAssociationMode( |
| 481 | |
Model.getAggregationKind().getComposite(), |
| 482 | |
true, "button.new-unicomposition")); |
| 483 | |
} |
| 484 | 19 | return actionUniComposition; |
| 485 | |
} |
| 486 | |
|
| 487 | |
|
| 488 | |
|
| 489 | |
|
| 490 | |
public boolean isRelocationAllowed(Object base) { |
| 491 | 0 | return Model.getFacade().isAPackage(base); |
| 492 | |
} |
| 493 | |
|
| 494 | |
@SuppressWarnings("unchecked") |
| 495 | |
public Collection getRelocationCandidates(Object root) { |
| 496 | 0 | return |
| 497 | |
Model.getModelManagementHelper().getAllModelElementsOfKindWithModel( |
| 498 | |
root, Model.getMetaTypes().getPackage()); |
| 499 | |
} |
| 500 | |
|
| 501 | |
|
| 502 | |
|
| 503 | |
|
| 504 | |
public boolean relocate(Object base) { |
| 505 | 0 | setNamespace(base); |
| 506 | 0 | damage(); |
| 507 | 0 | return true; |
| 508 | |
} |
| 509 | |
|
| 510 | |
|
| 511 | |
|
| 512 | |
|
| 513 | |
|
| 514 | |
|
| 515 | |
|
| 516 | |
|
| 517 | |
public void setModelElementNamespace( |
| 518 | |
Object modelElement, |
| 519 | |
Object namespace) { |
| 520 | 0 | Facade facade = Model.getFacade(); |
| 521 | 0 | if (facade.isANode(modelElement) |
| 522 | |
|| facade.isANodeInstance(modelElement) |
| 523 | |
|| facade.isAComponent(modelElement) |
| 524 | |
|| facade.isAComponentInstance(modelElement)) { |
| 525 | 0 | LOG.info("Setting namespace of " + modelElement); |
| 526 | 0 | super.setModelElementNamespace(modelElement, namespace); |
| 527 | |
} |
| 528 | 0 | } |
| 529 | |
|
| 530 | |
|
| 531 | |
|
| 532 | |
|
| 533 | |
|
| 534 | |
|
| 535 | |
|
| 536 | |
|
| 537 | |
|
| 538 | |
|
| 539 | |
public void encloserChanged(FigNode enclosed, FigNode oldEncloser, |
| 540 | |
FigNode newEncloser) { |
| 541 | 0 | if (oldEncloser != null && newEncloser == null |
| 542 | |
&& Model.getFacade().isAComponent(oldEncloser.getOwner())) { |
| 543 | 0 | Collection<Object> er1 = Model.getFacade().getElementResidences( |
| 544 | |
enclosed.getOwner()); |
| 545 | 0 | Collection er2 = Model.getFacade().getResidentElements( |
| 546 | |
oldEncloser.getOwner()); |
| 547 | 0 | Collection<Object> common = new ArrayList<Object>(er1); |
| 548 | 0 | common.retainAll(er2); |
| 549 | 0 | for (Object elementResidence : common) { |
| 550 | 0 | Model.getUmlFactory().delete(elementResidence); |
| 551 | |
} |
| 552 | |
} |
| 553 | 0 | } |
| 554 | |
|
| 555 | |
@Override |
| 556 | |
public boolean doesAccept(Object objectToAccept) { |
| 557 | 0 | if (Model.getFacade().isANode(objectToAccept)) { |
| 558 | 0 | return true; |
| 559 | 0 | } else if (Model.getFacade().isAAssociation(objectToAccept)) { |
| 560 | 0 | return true; |
| 561 | 0 | } else if (Model.getFacade().isANodeInstance(objectToAccept)) { |
| 562 | 0 | return true; |
| 563 | 0 | } else if (Model.getFacade().isAComponent(objectToAccept)) { |
| 564 | 0 | return true; |
| 565 | 0 | } else if (Model.getFacade().isAComponentInstance(objectToAccept)) { |
| 566 | 0 | return true; |
| 567 | 0 | } else if (Model.getFacade().isAClass(objectToAccept)) { |
| 568 | 0 | return true; |
| 569 | 0 | } else if (Model.getFacade().isAInterface(objectToAccept)) { |
| 570 | 0 | return true; |
| 571 | 0 | } else if (Model.getFacade().isAObject(objectToAccept)) { |
| 572 | 0 | return true; |
| 573 | 0 | } else if (Model.getFacade().isAComment(objectToAccept)) { |
| 574 | 0 | return true; |
| 575 | 0 | } else if (Model.getFacade().isAActor(objectToAccept)) { |
| 576 | 0 | return true; |
| 577 | |
} |
| 578 | 0 | return false; |
| 579 | |
} |
| 580 | |
|
| 581 | |
|
| 582 | |
public DiagramElement createDiagramElement( |
| 583 | |
final Object modelElement, |
| 584 | |
final Rectangle bounds) { |
| 585 | |
|
| 586 | 0 | FigNodeModelElement figNode = null; |
| 587 | |
|
| 588 | 0 | DiagramSettings settings = getDiagramSettings(); |
| 589 | |
|
| 590 | 0 | if (Model.getFacade().isANode(modelElement)) { |
| 591 | 0 | figNode = new FigMNode(modelElement, bounds, settings); |
| 592 | 0 | } else if (Model.getFacade().isAAssociation(modelElement)) { |
| 593 | 0 | figNode = |
| 594 | |
createNaryAssociationNode(modelElement, bounds, settings); |
| 595 | 0 | } else if (Model.getFacade().isANodeInstance(modelElement)) { |
| 596 | 0 | figNode = new FigNodeInstance(modelElement, bounds, settings); |
| 597 | 0 | } else if (Model.getFacade().isAComponent(modelElement)) { |
| 598 | 0 | figNode = new FigComponent(modelElement, bounds, settings); |
| 599 | 0 | } else if (Model.getFacade().isAComponentInstance(modelElement)) { |
| 600 | 0 | figNode = new FigComponentInstance(modelElement, bounds, settings); |
| 601 | 0 | } else if (Model.getFacade().isAClass(modelElement)) { |
| 602 | 0 | figNode = new FigClass(modelElement, bounds, settings); |
| 603 | 0 | } else if (Model.getFacade().isAInterface(modelElement)) { |
| 604 | 0 | figNode = new FigInterface(modelElement, bounds, settings); |
| 605 | 0 | } else if (Model.getFacade().isAObject(modelElement)) { |
| 606 | 0 | figNode = new FigObject(modelElement, bounds, settings); |
| 607 | 0 | } else if (Model.getFacade().isAActor(modelElement)) { |
| 608 | 0 | figNode = new FigActor(modelElement, bounds, settings); |
| 609 | 0 | } else if (Model.getFacade().isAComment(modelElement)) { |
| 610 | 0 | figNode = new FigComment(modelElement, bounds, settings); |
| 611 | |
} |
| 612 | |
|
| 613 | 0 | if (figNode != null) { |
| 614 | 0 | LOG.debug("Model element " + modelElement + " converted to " |
| 615 | |
+ figNode); |
| 616 | |
} else { |
| 617 | 0 | LOG.debug("Dropped object NOT added " + figNode); |
| 618 | |
} |
| 619 | 0 | return figNode; |
| 620 | |
} |
| 621 | |
} |