Exemple #1
0
    def run(self):

        #-----------------------------------------------------------------------
        # Starting width, height & location of the application frame
        #-----------------------------------------------------------------------
        screenSize = Toolkit.getDefaultToolkit().getScreenSize()
        w = screenSize.width >> 1  # Use 1/2 screen width
        h = screenSize.height >> 1  # and 1/2 screen height
        x = (screenSize.width - w) >> 1  # Top left corner of frame
        y = (screenSize.height - h) >> 1

        #-----------------------------------------------------------------------
        # Center the application frame in the window
        #-----------------------------------------------------------------------
        frame = self.frame = JFrame('WASports_02',
                                    bounds=(x, y, w, h),
                                    defaultCloseOperation=JFrame.EXIT_ON_CLOSE)

        #-----------------------------------------------------------------------
        # Internal frames require us to use a JDesktopPane()
        #-----------------------------------------------------------------------
        desktop = JDesktopPane()

        #-----------------------------------------------------------------------
        # Create our initial internal frame, and add it to the desktop
        #-----------------------------------------------------------------------
        internal = InternalFrame('InternalFrame',
                                 size=Dimension(w >> 1, h >> 1),
                                 location=Point(5, 5))
        desktop.add(internal)

        frame.setContentPane(desktop)
        frame.setVisible(1)
    def run(self):
        self.frame = frame = JFrame('consoleTimeout_06',
                                    size=(428, 474),
                                    locationRelativeTo=None,
                                    defaultCloseOperation=JFrame.EXIT_ON_CLOSE)

        #-----------------------------------------------------------------------
        # Add the menu bar to the frame
        #-----------------------------------------------------------------------
        frame.setJMenuBar(self.MenuBar())

        #-----------------------------------------------------------------------
        # Internal frames must be added to a desktop pane
        #-----------------------------------------------------------------------
        desktop = JDesktopPane()

        #-----------------------------------------------------------------------
        # Here is where we have to decide what needs to be displayed.
        #-----------------------------------------------------------------------
        if globals().has_key('AdminConfig'):
            self.timeout = self.initialTimeout()
            self.inner = TextField(self)  # JTextField only
            desktop.add(self.inner)
            desktop.add(TextandButton(self))  # JTextField & JButton
        else:
            self.inner = self.noWSAS()  # WebSphere not found
            desktop.add(self.inner)

        #-----------------------------------------------------------------------
        # Next, we add the desktop to the application frame; make the application
        # frame visible, and request the focus on one of the inner frames
        #-----------------------------------------------------------------------
        frame.add(desktop)
        frame.setVisible(1)
        self.inner.setSelected(1)
Exemple #3
0
 def run(self):
     screenSize = Toolkit.getDefaultToolkit().getScreenSize()
     w = screenSize.width >> 1  # 1/2 screen width
     h = screenSize.height >> 1  # 1/2 screen height
     x = (screenSize.width - w) >> 1
     y = (screenSize.height - h) >> 1
     frame = JFrame(
         'iFrameEvents1',
         bounds=(x, y, w, h),  # location & size
         defaultCloseOperation=JFrame.EXIT_ON_CLOSE)
     desktop = JDesktopPane()
     desktop.add(eventLogger(), 0, 0)
     frame.setContentPane(desktop)
     frame.setVisible(1)
 def run(self):
     #-----------------------------------------------------------------------
     # First, we determine the size & location of the application frame
     #-----------------------------------------------------------------------
     screenSize = Toolkit.getDefaultToolkit().getScreenSize()
     w = screenSize.width >> 1  # 1/2 screen width
     h = screenSize.height >> 1  # 1/2 screen height
     x = (screenSize.width - w) >> 1
     y = (screenSize.height - h) >> 1
     frame = JFrame(
         'iFrameEvents2',
         bounds=(x, y, w, h),  # location & size
         defaultCloseOperation=JFrame.EXIT_ON_CLOSE)
     #-----------------------------------------------------------------------
     # Next, we create, and add the menubar
     #-----------------------------------------------------------------------
     frame.setJMenuBar(self.menuBar())
     #-----------------------------------------------------------------------
     # Then, we replace the frame ContentPane with a JDesktopPane instance
     # for all of the inner frames, and populate it with our eventLogger
     # inner frame instance.
     #-----------------------------------------------------------------------
     self.desktop = desktop = JDesktopPane()
     self.logger = eventLogger()
     desktop.add(self.logger, 0, 0)
     frame.setContentPane(desktop)
     #-----------------------------------------------------------------------
     # Initialize the number of inner frames created
     #-----------------------------------------------------------------------
     self.iFrameCount = 0
     frame.setVisible(1)
    def run( self ) :

        #-----------------------------------------------------------------------
        # Starting width, height & location of the application frame
        #-----------------------------------------------------------------------
        screenSize = Toolkit.getDefaultToolkit().getScreenSize()
        w = screenSize.width  >> 1          # Use 1/2 screen width
        h = screenSize.height >> 1          # and 1/2 screen height
        x = ( screenSize.width  - w ) >> 1  # Top left corner of frame
        y = ( screenSize.height - h ) >> 1

        #-----------------------------------------------------------------------
        # Center the application frame in the window
        #-----------------------------------------------------------------------
        frame = self.frame = JFrame(
            'WASports_00',
            bounds = ( x, y, w, h ),
            defaultCloseOperation = JFrame.EXIT_ON_CLOSE
        )
        #-----------------------------------------------------------------------
        # Internal frames require us to use a JDesktopPane()
        #-----------------------------------------------------------------------
        desktop = JDesktopPane()

        frame.setContentPane( desktop )
        frame.setVisible( 1 )
Exemple #6
0
    def run(self):

        #-----------------------------------------------------------------------
        # Starting width, height & location of the application frame
        #-----------------------------------------------------------------------
        screenSize = Toolkit.getDefaultToolkit().getScreenSize()
        w = screenSize.width >> 1  # Use 1/2 screen width
        h = screenSize.height >> 1  # and 1/2 screen height
        x = (screenSize.width - w) >> 1  # Top left corner of frame
        y = (screenSize.height - h) >> 1

        #-----------------------------------------------------------------------
        # Center the application frame in the window
        #-----------------------------------------------------------------------
        frame = self.frame = JFrame('WASports_08',
                                    bounds=(x, y, w, h),
                                    defaultCloseOperation=JFrame.EXIT_ON_CLOSE)

        #-----------------------------------------------------------------------
        # Add our menu bar to the frame, keeping a reference to the object
        #-----------------------------------------------------------------------
        frame.setJMenuBar(self.MenuBar())

        #-----------------------------------------------------------------------
        # Internal frames require us to use a JDesktopPane()
        #-----------------------------------------------------------------------
        desktop = JDesktopPane()

        cellName = AdminConfig.showAttribute(AdminConfig.list('Cell'), 'name')
        #-----------------------------------------------------------------------
        # Create our initial internal frame, and add it to the desktop
        #-----------------------------------------------------------------------
        internal = InternalFrame(cellName, Dimension(w >> 1, h >> 1),
                                 Point(5, 5), self.cellData)
        desktop.add(internal)

        frame.setContentPane(desktop)
        frame.setVisible(1)
Exemple #7
0
    def run(self):
        screenSize = Toolkit.getDefaultToolkit().getScreenSize()
        w = screenSize.width >> 1  # 1/2 screen width
        h = screenSize.height >> 1  # 1/2 screen height
        x = (screenSize.width - w) >> 1
        y = (screenSize.height - h) >> 1
        frame = JFrame(
            'iFrameDemo',
            bounds=(x, y, w, h),  # location & size
            defaultCloseOperation=JFrame.EXIT_ON_CLOSE)
        desktop = JDesktopPane()
        for i in range(3):
            inner = JInternalFrame(
                'Inner Frame #%d' % (i + 1),
                1,  # Resizeable
                1,  # Closeable
                1,  # Maximizable
                1,  # Iconifiable
                visible=1,  # setVisible( 1 )
                bounds=(i * 25 + 25, i * 25 + 25, 250, 250))
            desktop.add(inner)
#           desktop.add( inner, i, 0 )      # preferred add() method
        frame.setContentPane(desktop)
        frame.setVisible(1)