org.devaki.nextobjects.util
Class ModelMan

java.lang.Object
  extended byorg.devaki.nextobjects.util.ModelMan

public final class ModelMan
extends java.lang.Object

the model manager this class manage all the objects,UIs around models

Author:
Emmanuel Florent

Method Summary
static void addAssociation(ConceptualModel pMerise, Association pAssoc)
          Function used to paste an association when using the clipboard
static Association addAssociation(ConceptualModel pMerise, java.awt.Point p)
          Add an association
static AssociationLink addAssociationLink(ConceptualModel pMerise, AssociationLink pAssocLink)
          Add an associationLink
static Constraint addConstraint(PhysicalModel pDatabase, Constraint pConstraint)
          Add a constraint
static void addCurrentObject(BaseObject pCurrentObject)
          Define the current selected object
static void addEntity(ConceptualModel pMerise, Entity pEntity)
          Function used to paste an entity when using the clipboard
static Entity addEntity(ConceptualModel pMerise, java.awt.Point p)
          Conveniency method for the ConceptualView.java to add an entity.
static void addInheritanceLink(BaseModel pModel, InheritanceLink pInheritanceLink)
          Conveniency method for the ConceptualView.java to add an InheritanceLink.
static void addLabel(BaseModel pModel, Label lbl)
          Method to add a label
static void addLabel(BaseModel pModel, java.awt.Point p)
          method for the ModelView to add a label
static Table addTable(PhysicalModel pDatabase, java.awt.Point p)
          Add a new table
static void addTable(PhysicalModel pDatabase, Table pTable)
          Function used by to create (using the popup menu) or paste a new table
static void delete()
          Delete an object when using the action 'Delete' on the popup menu
static BaseModel getCurrentModel()
          Get the current model
static BaseObject getCurrentObject()
          Return the first selected object
static java.util.Vector getCurrentObjects()
          Return the current selected object
static BaseObject getDraggedObject()
          get the dragged object
static BaseObject getDropTargetObject()
          get the drop target object
static java.lang.String getJavaName(java.lang.String schemaName)
          Converts a database schema name to java object name.
static java.util.Vector getModels()
          Return the list of models
static BaseClass getObjectToResize()
          Get the object currently being resized
static void moveCurrentObjects(int xi, int yi)
          Move all selected objects and log it
static void newConceptualDatamodel(ConceptualModel pMerise)
          Create a new Conceptual Data Model
static void newObject(java.awt.Point p)
          Add an object when using the action 'New' on the popup menu
static void newPhysicalDatamodel(PhysicalModel pDatabase)
          Create a new Physical Data Model
static void removeLabel(BaseModel pModel, Label pLabel)
          Remove a label from a model
static void removeModel(BaseModel pNOModel)
          get rid of a model
static void removeTable(PhysicalModel pDatabase, Table t)
          Remove a table from a database
static void resetActionLocations()
          Description of the Method
static void resetCurrentObjects()
          Return the current selected object
static void resizeCurrentObject(int xi, int yi)
          Resize all currents objects and log it.
static void resizeModelObjects(BaseModel pModel)
          Compute best size for classes and best positions for links
static void setCurrentModel(BaseModel pNOModel)
          Define the current model
static void setCurrentObject(BaseObject pCurrentObject)
          Define the current selected object
static void setDraggedObject(BaseObject pDraggedObject)
          Define the current dragged object
static void setDropTargetObject(BaseObject pDropTargetObject)
          Define the current Drop Target Object
static void setObjectToResize(BaseClass pObjectToResize)
          Define the object currently being resized
static void verify(BaseModel pModel)
          Call the right verifier according to the model type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newConceptualDatamodel

public static void newConceptualDatamodel(ConceptualModel pMerise)
Create a new Conceptual Data Model

Parameters:
pMerise - the Conceptual Data Model

addEntity

public static Entity addEntity(ConceptualModel pMerise,
                               java.awt.Point p)
Conveniency method for the ConceptualView.java to add an entity.

Parameters:
pMerise - the CM
p - point
Returns:
the entity

addEntity

public static void addEntity(ConceptualModel pMerise,
                             Entity pEntity)
Function used to paste an entity when using the clipboard

Parameters:
pMerise - the model
pEntity - the entity

addAssociation

public static void addAssociation(ConceptualModel pMerise,
                                  Association pAssoc)
Function used to paste an association when using the clipboard

Parameters:
pMerise - the model
pAssoc - the association

addAssociation

public static Association addAssociation(ConceptualModel pMerise,
                                         java.awt.Point p)
Add an association

Parameters:
pMerise - the model
p - the point
Returns:
the association

addAssociationLink

public static AssociationLink addAssociationLink(ConceptualModel pMerise,
                                                 AssociationLink pAssocLink)
Add an associationLink

Parameters:
pMerise - the model
pAssocLink - the association
Returns:
the association link

newPhysicalDatamodel

public static void newPhysicalDatamodel(PhysicalModel pDatabase)
Create a new Physical Data Model

Parameters:
pDatabase - the database

addTable

public static Table addTable(PhysicalModel pDatabase,
                             java.awt.Point p)
Add a new table

Parameters:
pDatabase - the database
p - the point
Returns:
the table

addTable

public static void addTable(PhysicalModel pDatabase,
                            Table pTable)
Function used by to create (using the popup menu) or paste a new table

Parameters:
pDatabase - the database
pTable - the table

addConstraint

public static Constraint addConstraint(PhysicalModel pDatabase,
                                       Constraint pConstraint)
Add a constraint

Parameters:
pDatabase - the databse
pConstraint - the contraint
Returns:
the constraint

addInheritanceLink

public static void addInheritanceLink(BaseModel pModel,
                                      InheritanceLink pInheritanceLink)
Conveniency method for the ConceptualView.java to add an InheritanceLink.

Parameters:
pModel - the model
pInheritanceLink - the link

addLabel

public static void addLabel(BaseModel pModel,
                            java.awt.Point p)
method for the ModelView to add a label

Parameters:
pModel - the model
p - the point

addLabel

public static void addLabel(BaseModel pModel,
                            Label lbl)
Method to add a label

Parameters:
pModel - the model
lbl - the label

removeTable

public static void removeTable(PhysicalModel pDatabase,
                               Table t)
Remove a table from a database

Parameters:
pDatabase - the database
t - the table

removeLabel

public static void removeLabel(BaseModel pModel,
                               Label pLabel)
Remove a label from a model

Parameters:
pModel - the model
pLabel - the label

getModels

public static java.util.Vector getModels()
Return the list of models

Returns:
the models

newObject

public static void newObject(java.awt.Point p)
Add an object when using the action 'New' on the popup menu

Parameters:
p - the point

getCurrentModel

public static BaseModel getCurrentModel()
Get the current model

Returns:
the model

setCurrentModel

public static void setCurrentModel(BaseModel pNOModel)
Define the current model

Parameters:
pNOModel - the modell

getCurrentObjects

public static java.util.Vector getCurrentObjects()
Return the current selected object

Returns:
all the selected objects

getCurrentObject

public static BaseObject getCurrentObject()
Return the first selected object

Returns:
the last selected object

addCurrentObject

public static void addCurrentObject(BaseObject pCurrentObject)
Define the current selected object

Parameters:
pCurrentObject - the objects

setCurrentObject

public static void setCurrentObject(BaseObject pCurrentObject)
Define the current selected object

Parameters:
pCurrentObject - the" object

resetCurrentObjects

public static void resetCurrentObjects()
Return the current selected object


setDraggedObject

public static void setDraggedObject(BaseObject pDraggedObject)
Define the current dragged object

Parameters:
pDraggedObject - the object

getDraggedObject

public static BaseObject getDraggedObject()
get the dragged object

Returns:
the object

setDropTargetObject

public static void setDropTargetObject(BaseObject pDropTargetObject)
Define the current Drop Target Object

Parameters:
pDropTargetObject - the object

getDropTargetObject

public static BaseObject getDropTargetObject()
get the drop target object

Returns:
the object

setObjectToResize

public static void setObjectToResize(BaseClass pObjectToResize)
Define the object currently being resized

Parameters:
pObjectToResize - the object

getObjectToResize

public static BaseClass getObjectToResize()
Get the object currently being resized

Returns:
the object

resizeCurrentObject

public static void resizeCurrentObject(int xi,
                                       int yi)
Resize all currents objects and log it.

Parameters:
xi - x width
yi - height

moveCurrentObjects

public static void moveCurrentObjects(int xi,
                                      int yi)
Move all selected objects and log it

Parameters:
xi - the delta x
yi - the delta y

resetActionLocations

public static void resetActionLocations()
Description of the Method


delete

public static void delete()
Delete an object when using the action 'Delete' on the popup menu


removeModel

public static void removeModel(BaseModel pNOModel)
get rid of a model

Parameters:
pNOModel - the model

verify

public static void verify(BaseModel pModel)
Call the right verifier according to the model type.

Parameters:
pModel - the model

resizeModelObjects

public static void resizeModelObjects(BaseModel pModel)
Compute best size for classes and best positions for links

Parameters:
pModel - the model

getJavaName

public static java.lang.String getJavaName(java.lang.String schemaName)
Converts a database schema name to java object name. Operates same as underscoreMethod but does not convert anything to lowercase.

Parameters:
schemaName - name to be converted.
Returns:
converted name.
See Also:
org.apache.torque.engine.database.model.NameGenerator, #underscoreMethod(String)


Copyright © 2002-2004 devaki.org. All Rights Reserved.