Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

org.argouml.ui

Class Target


public class Target

Title: Target

Description: Encapsulates the current target in Poseidon. A target may consist of several selected items. Each item may be a diagram, a fig or a model element. If a model element is included in the target, then any currently shown fig is also automatically included. In the same way any included fig will also cause inclusion of its model element. So, currently target is UML specific. (If there ever _really_ should be other project types, there need to be a superclass or interface. However the trichotomy Diagram/Fig/Model Element should be valid for other project types, too, but concrete diagram and model element types will differ.)

Copyright: Copyright (c) 2002

Company: Gentleware AG


 Attribute Summary
public static Target  EMPTY_TARGET
The only instance representing an epty target 
arrow_up
 

 Association Summary
protected Object  _source
The source object that requested this target 
protected List  _diagrams
A list that contains all selected diagrams (ArgoDiagram) 
protected List  _elements
A list that contains all selected model elements (ModelElement) 
protected List  _figs
A list that contains all selected figs (Fig) 
arrow_up
 

 Constructor Summary
protected   Target()
Constructs an empty target 
protected   Target(Object source , Collection items )
Constructs a target using a collection of selected items. 
protected   Target(Object source , ArgoDiagram diagram )
Construct a target containing a single diagram  
protected   Target(Object source , Object element , boolean dummy )
Construct a target containing a single model element. 
protected   Target(Object source , Fig fig )
Construct a target containing a single fig. 
arrow_up
 

 Method Summary
public boolean   contains(Object item )
Checks wether the given item is contained in this target, i. 
protected Target   createTarget(Object source , Object object )
Constructs a target using an object of either ArgoDiagram/ModelElement/Fig class or a collection of these objects. 
public boolean   equals(Object other )
All attributes are checked for equality, i. 
public static ArgoPresentationController   getController()
An exercise in defensive programming: At startup any particular object may not yet be present/initialized. 
public ArgoDiagram   getDiagram()
 
public List   getDiagrams()
 
public Object   getElement()
 
public Object   getElement(int index )
 
public int   getElementCount()
 
public static Object   getElementForFig( Fig fig )
 
public List   getElements()
 
public Fig   getFig()
 
public Fig   getFig(int index )
 
public int   getFigCount()
 
public static Fig   getFigForElement(Object selement )
 
public List   getFigs()
 
public Object   getItem()
Returns the first selected item in the most specific form, i. 
public Object   getSource()
 
public String   toString()
 
arrow_up
 

 

 Attribute Detail

EMPTY_TARGET

public static Target EMPTY_TARGET

The only instance representing an epty target 
arrow_up
 

 Association Detail

_source

protected Object _source

The source object that requested this target 
arrow_up
 
 

_diagrams

protected List _diagrams

A list that contains all selected diagrams (ArgoDiagram) 
arrow_up
 
 

_elements

protected List _elements

A list that contains all selected model elements (ModelElement) 
arrow_up
 
 

_figs

protected List _figs

A list that contains all selected figs (Fig) 
arrow_up
 

 Constructor Detail

Target

protected Target Target()

Constructs an empty target 
arrow_up
 
 

Target

protected Target Target(Object source , Collection items )

Constructs a target using a collection of selected items. Each item that is neither an UMLDiagram, ModelElement nor Fig is ignored (and an error message is logged.)
Parameters:
source - a source object that will be remembered as having created this target
items -
 
arrow_up
 
 

Target

protected Target Target(Object source , ArgoDiagram diagram )

Construct a target containing a single diagram
Parameters:
source - a source object that will be remembered as having created this target
diagram -
 
arrow_up
 
 

Target

protected Target Target(Object source , Object element , boolean dummy )

Construct a target containing a single model element. If it has a corresponding fig, it will be added, too.
Parameters:
source - a source object that will be remembered as having created this target
element -
dummy - Just to differentiate the other constructors from this one.
 
arrow_up
 
 

Target

protected Target Target(Object source , Fig fig )

Construct a target containing a single fig. If it has a corresponding model element, it will be added, too.
Parameters:
source - a source object that will be remembered as having created this target
fig -
 
arrow_up
 

 Method Detail

contains

public boolean contains(Object item )

Checks wether the given item is contained in this target, i.e. is part of the selection.
Parameters:
item -
 
arrow_up
 
 

createTarget

protected Target createTarget(Object source , Object object )

Constructs a target using an object of either ArgoDiagram/ModelElement/Fig class or a collection of these objects. If object is of another class, the target will be empty and an error message will be logged.
Parameters:
object -
 
arrow_up
 
 

equals

public boolean equals(Object other )

All attributes are checked for equality, i.e. two targets are equals, if all their diagrams, model elements and figs are equal.
Parameters:
other -
 
arrow_up
 
 

getController

public static ArgoPresentationController getController()

An exercise in defensive programming: At startup any particular object may not yet be present/initialized.
Returns:
 
arrow_up
 
 

getDiagram

public ArgoDiagram getDiagram()

Returns:
null if this target does not contain a diagram, else the first diagram
 
arrow_up
 
 

getDiagrams

public List getDiagrams()

Returns:
an umodifiable list of all diagrams in this target
 
arrow_up
 
 

getElement

public Object getElement()

Returns:
null if this target does not contain a model element, else the first model element
 
arrow_up
 
 

getElement

public Object getElement(int index )

Parameters:
index -
 
arrow_up
 
 

getElementCount

public int getElementCount()

Returns:
 
arrow_up
 
 

getElementForFig

public static Object getElementForFig( Fig fig )

 
arrow_up
 
 

getElements

public List getElements()

Returns:
a list of all model elements in this target Beware: The collection does not include nulls. So the association to figs cannot be made by index.
 
arrow_up
 
 

getFig

public Fig getFig()

Returns:
null if this target does not contain a fig, else the first fig
 
arrow_up
 
 

getFig

public Fig getFig(int index )

Parameters:
index -
 
arrow_up
 
 

getFigCount

public int getFigCount()

Returns:
 
arrow_up
 
 

getFigForElement

public static Fig getFigForElement(Object selement )

 
arrow_up
 
 

getFigs

public List getFigs()

Returns:
an umodifiable list of all figs in this target Beware: The collection does not include nulls. So the association to model elements cannot be made by index.
 
arrow_up
 
 

getItem

public Object getItem()

Returns the first selected item in the most specific form, i.e. a Fig (if there is one), else a ModelElement (if there is one), else an ArgoDiagram (if there is one), else null
Returns:
 
arrow_up
 
 

getSource

public Object getSource()

Returns:
the source that caused this target to be created
 
arrow_up
 
 

toString

public String toString()

 
arrow_up
 

Created  2003 - 3 - 4

    Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in Germany, USA and other countries. Copyright 2001 Gentleware AG, Vogt-Kölln-Str.30, 22527 Hamburg, Germany. All Rights Reserved.

UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.