Ticket #2290: bookDialog.patch

File bookDialog.patch, 3.1 KB (added by pap, 15 years ago)
  • modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/dialogs/BookPropertiesDialog.java

    ### Eclipse Workspace Patch 1.0
    #P sophie
     
    11package org.sophie2.main.app.commons.dialogs; 
    22 
    33import java.awt.Dimension; 
    4 import java.awt.Rectangle; 
    54import java.util.ArrayList; 
    65import java.util.Arrays; 
    76import java.util.Collections; 
     
    98 
    109import javax.swing.BoxLayout; 
    1110import javax.swing.JComponent; 
    12 import javax.swing.JDialog; 
    13 import javax.swing.JFrame; 
    1411import javax.swing.JPanel; 
    1512 
    1613import org.sophie2.base.bound.BoundCheckBox; 
     
    257254                                part.add(TITLE_PROP_ID, "Book Title: "); 
    258255                                part.add(TOOL_TIP_PROP_ID, "Title of the book"); 
    259256                                part.add(VALIDATION_VISIBLE_ID, false); 
    260                                 part.add(SIZE_PROP_ID, new ImmSize(DIALOG_WIDTH, 20)); 
    261                                 part.add(CONTROL_SIZE_PROP_ID, new ImmSize(DIALOG_WIDTH, 20)); 
     257                                part.add(CONTROL_SIZE_PROP_ID, new ImmSize(DIALOG_WIDTH-10, 20)); 
    262258                        } 
    263259 
    264260                        @Override 
     
    296292                                part.add(TITLE_PROP_ID, "Page width: "); 
    297293                                part.add(TOOL_TIP_PROP_ID, "Set the width of the pages of the book"); 
    298294                                part.add(VALIDATION_VISIBLE_ID, false); 
    299                                 part.add(SIZE_PROP_ID, new ImmSize(DIALOG_WIDTH, 20)); 
    300                                 part.add(CONTROL_SIZE_PROP_ID, new ImmSize(DIALOG_WIDTH, 20)); 
     295                                part.add(CONTROL_SIZE_PROP_ID, new ImmSize(DIALOG_WIDTH-10, 20)); 
    301296                        } 
    302297 
    303298                        @Override 
     
    332327                                part.add(TITLE_PROP_ID, "Page height: "); 
    333328                                part.add(TOOL_TIP_PROP_ID, "Set the height of the pages of the book"); 
    334329                                part.add(VALIDATION_VISIBLE_ID, false); 
    335                                 part.add(SIZE_PROP_ID, new ImmSize(DIALOG_WIDTH, 20)); 
    336                                 part.add(CONTROL_SIZE_PROP_ID, new ImmSize(DIALOG_WIDTH, 20)); 
     330                                part.add(CONTROL_SIZE_PROP_ID, new ImmSize(DIALOG_WIDTH-10, 20)); 
    337331                        } 
    338332 
    339333                        @Override 
     
    389383                                        protected JPanel create() { 
    390384                                                JPanel res = new JPanel(); 
    391385                                                res.setLayout(new BoxLayout(res, BoxLayout.Y_AXIS)); 
    392                                                 res.setSize(DIALOG_WIDTH, DIALOG_HEIGHT); 
    393386                                                return res; 
    394387                                        } 
    395388 
     
    645638                         
    646639                } 
    647640 
    648                 //TODO (r4) why is this static?? 
    649                 private static JDialog propertiesDialog = null; 
    650  
    651                 /** 
    652                  * Shows this dialog to the user. Blocks until the user hits ok/cancel. 
    653                  *  
    654                  * @param parentFrame  
    655                  *                      The frame that this dialog corresponds to. 
    656                  */ 
    657                 public void show(JFrame parentFrame) { 
    658                         propertiesDialog = new JDialog(parentFrame, true); 
    659                         propertiesDialog.setTitle(BOOK_PROPERTIES_TITLE); 
    660                         propertiesDialog.setBounds(new Rectangle(0, 0, DIALOG_WIDTH, DIALOG_HEIGHT)); 
    661                         propertiesDialog.setLocationRelativeTo(parentFrame); 
    662                         propertiesDialog.setResizable(false); 
    663                         propertiesDialog.setVisible(true); 
    664                 } 
    665                  
    666641                /** 
    667642                 * Logic for handling submits by controls in {@link BookPropertiesSwingDialog}. 
    668643                 *