PyutSDMessage.py :  » UML » Python-UML-Tool » pyut-1.4.0 » src » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » UML » Python UML Tool 
Python UML Tool » pyut 1.4.0 » src » PyutSDMessage.py
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

__version__ = "$Revision: 1.11 $"
__author__ = "EI5, eivd, Group Burgbacher - Waelti"
__date__ = "2001-12-05"

#from PyutObject      import PyutObject
from PyutLink import PyutLink
from types import *
DEBUG=False

class PyutSDMessage(PyutLink):
    """
    A message between two lifeline of two CDInstances.
    Note : don't use getxxxTime, but getSrcY, getDstY

    :version: $Revision: 1.11 $
    :author: C.Dutoit
    """

    def __init__(self, message="", src=None, srcTime=0, dst=None, dstTime=0,  \
                 oglObject = None):
        """
        Constructor.

        @param string message  : for the message
        @param PyutCDInstance src : source of the link
        @param int srcTime : time on the source
        @param PyutCDInstance dst : where goes the link
        @param int dstTime : time on the destination
        @param oglObject : my OGL parent object
        @author C.Dutoit
        @tips : add time scale zoomer ?! and ofset..ter ?
        """
        if DEBUG:
            print "PyutSDMessage.__init__", srcTime, dstTime
        PyutLink.__init__(self, source=src, destination=dst)
        self._message = message
        self._srcTime = srcTime
        self._dstTime = dstTime
        self._oglObject = oglObject
    
    #>------------------------------------------------------------------------
    def setOglObject(self, obj):
        """
        Define the ogl object
        @author C.Dutoit
        """
        self._oglObject = obj
        
    #>------------------------------------------------------------------------

    def getSrcY(self):
        """
        Return Y position on source
        @author C.Dutoit
        """
        return self._srcTime

    #>------------------------------------------------------------------------

    def getDstY(self):
        """
        Return Y position on destination
        @author C.Dutoit
        """
        return self._dstTime

    #>------------------------------------------------------------------------

    def setSrcY(self):
        """
        Return Y position on source
        @author C.Dutoit
        """
        return self._srcTime

    #>------------------------------------------------------------------------

    def setDstY(self):
        """
        Return Y position on destination
        @author C.Dutoit
        """
        return self._dstTime

    #>------------------------------------------------------------------------

    def getSrcTime(self):
        """
        Return time on source
        DON'T use it, or only for saving purpose
        @author C.Dutoit
        """
        return self._srcTime

    #>------------------------------------------------------------------------

    def getDstTime(self):
        """
        Return time on destination
        DON'T use it, or only for saving purpose
        @author C.Dutoit
        """
        return self._dstTime

    #>------------------------------------------------------------------------

    def setSrcTime(self, value, updateOGLObject = True):
        """
        Define time on source
        DON'T use it, or only for saving purpose
        @author C.Dutoit
        """
        self._srcTime = int(value)
        if updateOGLObject and self._oglObject is not None:
            self._oglObject.updatePositions()

    #>------------------------------------------------------------------------

    def setDstTime(self, value, updateOGLObject = True):
        """
        Define time on destination
        DON'T use it, or only for saving purpose
        @author C.Dutoit
        """
        self._dstTime = int(value)
        if updateOGLObject and self._oglObject is not None:
            self._oglObject.updatePositions()

    #>------------------------------------------------------------------------

    def getSrcID(self):
        """
        Return Y position on source
        @author C.Dutoit
        """
        return self._src.getId()

    #>------------------------------------------------------------------------

    def getDstID(self):
        """
        Return Y position on source
        @author C.Dutoit
        """
        return self._dest.getId()

    #>------------------------------------------------------------------------

    def getSource(self):
        """
        Return Y position on source
        @author C.Dutoit
        """
        return self._src

    #>------------------------------------------------------------------------

    def getDest(self):
        """
        Return Y position on source
        @author C.Dutoit
        """
        return self._dest



    #>------------------------------------------------------------------------

    def __str__(self):
        """
        String representation.

        @return : string representing this object
        @author C.Dutoit
        """
        return _("(%s) link to %s") % (self._source, self._destination)

    #>------------------------------------------------------------------------

    def getMessage(self):
        """
        Return the message as a string
        @return String : message
        @author C.Dutoit
        """
        return self._message

    #>------------------------------------------------------------------------

    def setMessage(self, value):
        """
        Define the message
        @param String value : value of the message
        @author C.Dutoit
        """
        self._message = value

    #>------------------------------------------------------------------------

    def setSource(self, src=None, srcTime=-1):
        """
        Define the source
        @param src : Source object
        @param srcTime : Time on the source
        @author C.Dutoit
        """
        if src is not None: 
            #self._src = src
            PyutLink.setSource(self, src)
        if srcTime!=-1:
            if DEBUG:
                print "PyutSDMessage - Setting srcTime to ", srcTime
            self.setSrcTime(srcTime)

    #>------------------------------------------------------------------------

    def setDestination(self, dst=None, dstTime=-1):
        """
        Define the destination
        @param dst : destination object
        @param dstTime : Time on the destination
        @author C.Dutoit
        """
        if dst is not None: 
            PyutLink.setDestination(self, dst)
            #self._dest = dst
        if dstTime!=-1:
            print "PyutSDMessage - Setting dstTime to ", dstTime
            self.setDstTime(dstTime)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.