GitHub PullRequestReviewCommentEvent at 2014-03-04 17:55:06
Repository: PymageA
Actor: edson-gonzales
Payload: {"comment":{"url":"https://api.github.com/repos/edson-gonzales/PymageA/pulls/comments/10265809","id":10265809,"diff_hunk":"@@ -0,0 +1,224 @@\n+from javax.swing import JOptionPane\n+from javax.swing import JPanel\n+from javax.swing import JLabel\n+from javax.swing import JComboBox\n+from javax.swing import JButton\n+\n+from javax.swing import JRadioButton\n+from javax.swing import JCheckBox\n+from javax.swing import ButtonGroup\n+from javax.swing import JFrame\n+from java.awt import BorderLayout\n+from java.awt import FlowLayout\n+from java.awt import Dimension\n+from javax.swing import Box\n+from javax.swing import BorderFactory\n+from javax.swing import BoxLayout\n+from javax.swing.border import EtchedBorder\n+from java.awt import GridBagLayout\n+from java.awt import GridBagConstraints\n+from modules.image_modules.imageFile import ImageFile\n+\n+class Panel_modifyImage:\n+    \"\"\"\n+    class  where the options for rotate,resize and convert the images will be executed\n+    \"\"\"\n+    _spacer_components = Dimension(2, 2)\n+    _spacer_panels = Dimension(5, 5)\n+    def __init__(self, image_details, jframe):\n+        \"\"\"\n+        All values that will be used are declared in constructor\n+        \"\"\"\n+        self.jframe = jframe\n+        self.frame_details = JFrame(\"Modify Image: \" + image_details.get_complete_image_with_type())\n+        self.frame_details.setDefaultCloseOperation( self.frame_details.DO_NOTHING_ON_CLOSE )\n+        self.image_details = image_details\n+        self.height_pixels = JComboBox()\n+        self.width_pixels = JComboBox()\n+        self.angle_image = JComboBox()\n+        self.group_radio = ButtonGroup()\n+        self.radio_resize = JRadioButton(\"Resize Image\")\n+        self.radio_resize.setSelected(True)\n+        self.radio_rotate =JRadioButton(\"Rotate Image\")\n+        self.radio_convert =JRadioButton(\"Convert Image\")\n+        main_panel_modify =  self.frame_details.getContentPane()\n+        layout = BorderLayout()\n+        main_panel_modify.setLayout(layout)\n+        self.frame_details.setSize(Dimension(500,350))\n+        self.jframe.setEnabled(False)\n+        self.frame_details.setVisible(True)\n+        self.center_panel_options()\n+        \n+        self.south_panel_options()\n+        \n+\n+    def center_panel_options(self):\n+        \"\"\"\n+        Show the options to modify the image\n+        \"\"\"\n+        center_panel = JPanel()\n+        \n+        center_panel.setLayout(BoxLayout(center_panel, BoxLayout.Y_AXIS))\n+        center_panel.add(Box.createRigidArea(self._spacer_components))    \n+        self.resize_option(center_panel)\n+        self.group_radio.add(self.radio_resize)\n+        self.rotate_option(center_panel)\n+        self.group_radio.add(self.radio_rotate)\n+        self.convert_option(center_panel)\n+        self.group_radio.add(self.radio_convert)\n+        self.frame_details.getContentPane().add(center_panel,BorderLayout.CENTER)\n+\n+    def south_panel_options(self):\n+        \"\"\"\n+        Show the buttons Ok and Cancel\n+        \"\"\"\n+        south_panel = JPanel()\n+        south_panel.setLayout(BoxLayout(south_panel, BoxLayout.X_AXIS))\n+        south_panel.add(Box.createRigidArea(self._spacer_components))\n+        south_panel.add(JButton(\"OK\",actionPerformed =  self.ok_button_clicked))\n+        south_panel.add(JButton(\"Cancel\", actionPerformed =  self.cancel_button_clicked))\n+        self.update_values()\n+        self.frame_details.getContentPane().add(south_panel,BorderLayout.SOUTH)\n+\n+    def resize_option(self, center_panel):\n+        \"\"\"\n+        Display the information required for resize an image in the JPanel\n+        \"\"\"\n+        for number in range (9999):\n+            self.height_pixels.addItem(str(number+1))\n+            self.width_pixels.addItem(str(number+1))\n+        resize_panel = JPanel()       \n+        resize_panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), \"Resize Image\"))\n+        resize_panel.setLayout(GridBagLayout())\n+        cConstraints = GridBagConstraints()","path":"src/pymageA_UI/dialog_pymageA.py","position":93,"original_position":93,"commit_id":"56b3cce5f6a53ed0237238765a24dbd12d89ccb4","original_commit_id":"56b3cce5f6a53ed0237238765a24dbd12d89ccb4","user":{"login":"edson-gonzales","id":4943497,"avatar_url":"https://gravatar.com/avatar/f8adee6343e7cfa25211641ea250f28f?d=https%3A%2F%2Fidenticons.github.com%2F2254b0b9b7d9ff080d13f051a56858a7.png&r=x","gravatar_id":"f8adee6343e7cfa25211641ea250f28f","url":"https://api.github.com/users/edson-gonzales","html_url":"https://github.com/edson-gonzales","followers_url":"https://api.github.com/users/edson-gonzales/followers","following_url":"https://api.github.com/users/edson-gonzales/following{/other_user}","gists_url":"https://api.github.com/users/edson-gonzales/gists{/gist_id}","starred_url":"https://api.github.com/users/edson-gonzales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edson-gonzales/subscriptions","organizations_url":"https://api.github.com/users/edson-gonzales/orgs","repos_url":"https://api.github.com/users/edson-gonzales/repos","events_url":"https://api.github.com/users/edson-gonzales/events{/privacy}","received_events_url":"https://api.github.com/users/edson-gonzales/received_events","type":"User","site_admin":false},"body":"variable name convention, gridbag_constraints should be better","created_at":"2014-03-04T17:55:06Z","updated_at":"2014-03-04T17:55:06Z","html_url":"https://github.com/edson-gonzales/PymageA/pull/15#discussion_r10265809","pull_request_url":"https://api.github.com/repos/edson-gonzales/PymageA/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/edson-gonzales/PymageA/pulls/comments/10265809"},"html":{"href":"https://github.com/edson-gonzales/PymageA/pull/15#discussion_r10265809"},"pull_request":{"href":"https://api.github.com/repos/edson-gonzales/PymageA/pulls/15"}}}}