### Eclipse Workspace Patch 1.0
#P sophie
|
|
|
1 | 1 | package org.sophie2.main.app.commons.dialogs; |
2 | 2 | |
3 | 3 | import java.awt.Dimension; |
4 | | import java.awt.Rectangle; |
5 | 4 | import java.util.ArrayList; |
6 | 5 | import java.util.Arrays; |
7 | 6 | import java.util.Collections; |
… |
… |
|
9 | 8 | |
10 | 9 | import javax.swing.BoxLayout; |
11 | 10 | import javax.swing.JComponent; |
12 | | import javax.swing.JDialog; |
13 | | import javax.swing.JFrame; |
14 | 11 | import javax.swing.JPanel; |
15 | 12 | |
16 | 13 | import org.sophie2.base.bound.BoundCheckBox; |
… |
… |
|
257 | 254 | part.add(TITLE_PROP_ID, "Book Title: "); |
258 | 255 | part.add(TOOL_TIP_PROP_ID, "Title of the book"); |
259 | 256 | 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)); |
262 | 258 | } |
263 | 259 | |
264 | 260 | @Override |
… |
… |
|
296 | 292 | part.add(TITLE_PROP_ID, "Page width: "); |
297 | 293 | part.add(TOOL_TIP_PROP_ID, "Set the width of the pages of the book"); |
298 | 294 | 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)); |
301 | 296 | } |
302 | 297 | |
303 | 298 | @Override |
… |
… |
|
332 | 327 | part.add(TITLE_PROP_ID, "Page height: "); |
333 | 328 | part.add(TOOL_TIP_PROP_ID, "Set the height of the pages of the book"); |
334 | 329 | 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)); |
337 | 331 | } |
338 | 332 | |
339 | 333 | @Override |
… |
… |
|
389 | 383 | protected JPanel create() { |
390 | 384 | JPanel res = new JPanel(); |
391 | 385 | res.setLayout(new BoxLayout(res, BoxLayout.Y_AXIS)); |
392 | | res.setSize(DIALOG_WIDTH, DIALOG_HEIGHT); |
393 | 386 | return res; |
394 | 387 | } |
395 | 388 | |
… |
… |
|
645 | 638 | |
646 | 639 | } |
647 | 640 | |
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 | | |
666 | 641 | /** |
667 | 642 | * Logic for handling submits by controls in {@link BookPropertiesSwingDialog}. |
668 | 643 | * |