コード例 #1
0
 def init(self):
     self.setLayout( BorderLayout() )
     self.image = BackgroundPanel()
     self.image.setAddressPanel(self.getContext().getAddressPanel())
     if ((self.getContext().getAddressPanel().getRosterEntry() != None) and 
         (self.getContext().getAddressPanel().getRosterEntry().getImagePath() != None)):
         self.image.setImagePath( self.getContext().getAddressPanel().getRosterEntry().getImagePath() )
     self.setPreferredSize(java.awt.Dimension(320,200))
     self.add(self.image, BorderLayout.CENTER )        
     self.addComponentListener(self.image)
     self.getContext().getAddressPanel().addAddressListener(self.image)
コード例 #2
0
ファイル: RosterImage.py プロジェクト: Glasairman/JMRI
 def init(self):
     self.setLayout( BorderLayout() )
     self.image = BackgroundPanel()
     self.image.setAddressPanel(self.getContext().getAddressPanel())
     if ((self.getContext().getAddressPanel().getRosterEntry() != None) and 
         (self.getContext().getAddressPanel().getRosterEntry().getImagePath() != None)):
         self.image.setImagePath( self.getContext().getAddressPanel().getRosterEntry().getImagePath() )
     self.setPreferredSize(java.awt.Dimension(320,200))
     self.add(self.image, BorderLayout.CENTER )        
     self.addComponentListener(self.image)
     self.getContext().getAddressPanel().addAddressListener(self.image)
コード例 #3
0
ファイル: RosterImage.py プロジェクト: Glasairman/JMRI
class RosterImage(Jynstrument):
# Jynstrument mandatory part
# Here this JYnstrument like to be in a ThrottleFrame and no anywhere else
    def getExpectedContextClassName(self):
        return "jmri.jmrit.throttle.ThrottleFrame"

    def init(self):
        self.setLayout( BorderLayout() )
        self.image = BackgroundPanel()
        self.image.setAddressPanel(self.getContext().getAddressPanel())
        if ((self.getContext().getAddressPanel().getRosterEntry() != None) and 
            (self.getContext().getAddressPanel().getRosterEntry().getImagePath() != None)):
            self.image.setImagePath( self.getContext().getAddressPanel().getRosterEntry().getImagePath() )
        self.setPreferredSize(java.awt.Dimension(320,200))
        self.add(self.image, BorderLayout.CENTER )        
        self.addComponentListener(self.image)
        self.getContext().getAddressPanel().addAddressListener(self.image)

    def quit(self):   # very important to clean up everything to make sure GC will collect us
        self.getContext().getAddressPanel().removeAddressListener(self.image)
コード例 #4
0
class RosterImage(Jynstrument):
# Jynstrument mandatory part
# Here this JYnstrument like to be in a ThrottleFrame and no anywhere else
    def getExpectedContextClassName(self):
        return "jmri.jmrit.throttle.ThrottleFrame"

    def init(self):
        self.setLayout( BorderLayout() )
        self.image = BackgroundPanel()
        self.image.setAddressPanel(self.getContext().getAddressPanel())
        if ((self.getContext().getAddressPanel().getRosterEntry() != None) and 
            (self.getContext().getAddressPanel().getRosterEntry().getImagePath() != None)):
            self.image.setImagePath( self.getContext().getAddressPanel().getRosterEntry().getImagePath() )
        self.setPreferredSize(java.awt.Dimension(320,200))
        self.add(self.image, BorderLayout.CENTER )        
        self.addComponentListener(self.image)
        self.getContext().getAddressPanel().addAddressListener(self.image)

    def quit(self):   # very important to clean up everything to make sure GC will collect us
        self.getContext().getAddressPanel().removeAddressListener(self.image)