Changeset 103
- Timestamp:
- 23/06/08 14:44:24 (4 months ago)
- Files:
-
- trunk/src/vlcskineditor/Main.java (modified) (10 diffs)
- trunk/src/vlcskineditor/Window.java (modified) (3 diffs)
- trunk/src/vlcskineditor/resources/Bitmap.java (modified) (1 diff)
- trunk/src/vlcskineditor/resources/Font.java (modified) (1 diff)
- trunk/src/vlcskineditor/resources/SubBitmap.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/vlcskineditor/Main.java
r102 r103 125 125 mbar = new JMenuBar(); 126 126 127 //For cross-platform feel (CTRL on Win & Linux, APPLE/COMMAND on Mac OS) 128 int mask = java.awt.Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); 129 127 130 m_file = new JMenu("File"); 128 131 m_file.setMnemonic("F".charAt(0)); … … 130 133 m_file_new.setIcon(new_icon); 131 134 m_file_new.setMnemonic("N".charAt(0)); 132 m_file_new.setAccelerator(KeyStroke.getKeyStroke( "ctrl N"));135 m_file_new.setAccelerator(KeyStroke.getKeyStroke('N',mask)); 133 136 m_file_new.addActionListener(this); 134 137 m_file_open = new JMenuItem("Open"); 135 138 m_file_open.setIcon(open_icon); 136 139 m_file_open.setMnemonic('O'); 137 m_file_open.setAccelerator(KeyStroke.getKeyStroke( "ctrl O"));140 m_file_open.setAccelerator(KeyStroke.getKeyStroke('O',mask)); 138 141 m_file_open.addActionListener(this); 139 142 m_file_save = new JMenuItem("Save"); 140 143 m_file_save.setIcon(save_icon); 141 144 m_file_save.setMnemonic('S'); 142 m_file_save.setAccelerator(KeyStroke.getKeyStroke( "ctrl S"));145 m_file_save.setAccelerator(KeyStroke.getKeyStroke('S',mask)); 143 146 m_file_save.addActionListener(this); 144 147 m_file_test = new JMenuItem("Test skin in VLC..."); 145 148 m_file_test.setMnemonic('T'); 146 m_file_test.setAccelerator(KeyStroke.getKeyStroke( "ctrl shift t"));149 m_file_test.setAccelerator(KeyStroke.getKeyStroke('T',mask+InputEvent.SHIFT_DOWN_MASK)); 147 150 m_file_test.addActionListener(this); 148 151 m_file_vlt = new JMenuItem("Export as VLT..."); 149 152 m_file_vlt.setMnemonic('V'); 150 m_file_vlt.setAccelerator(KeyStroke.getKeyStroke( "ctrl shift v"));153 m_file_vlt.setAccelerator(KeyStroke.getKeyStroke('V',mask+InputEvent.SHIFT_DOWN_MASK)); 151 154 m_file_vlt.addActionListener(this); 152 155 m_file_png = new JMenuItem("Save current preview as image"); … … 154 157 m_file_png.addActionListener(this); 155 158 m_file_png.setEnabled(false); 156 m_file_quit = new JMenuItem("Quit"); 157 m_file_quit.setIcon(exit_icon); 158 m_file_quit.setMnemonic('Q'); 159 m_file_quit.setAccelerator(KeyStroke.getKeyStroke("ctrl Q")); 160 m_file_quit.addActionListener(this); 159 if(System.getProperty("os.name").indexOf("Mac")==-1) { 160 m_file_quit = new JMenuItem("Exit"); 161 m_file_quit.setIcon(exit_icon); 162 m_file_quit.setMnemonic('x'); 163 m_file_quit.setAccelerator(KeyStroke.getKeyStroke("alt F4")); 164 m_file_quit.addActionListener(this); 165 } 161 166 162 167 m_file.add(m_file_new); … … 176 181 m_edit_undo.setIcon(edit_undo_icon); 177 182 m_edit_undo.setMnemonic('U'); 178 m_edit_undo.setAccelerator(KeyStroke.getKeyStroke( "ctrl Z"));183 m_edit_undo.setAccelerator(KeyStroke.getKeyStroke('Z',mask)); 179 184 m_edit_undo.addActionListener(this); 180 185 m_edit_redo = new JMenuItem("Redo"); 181 186 m_edit_redo.setIcon(edit_redo_icon); 182 187 m_edit_redo.setMnemonic('R'); 183 m_edit_redo.setAccelerator(KeyStroke.getKeyStroke( "ctrl Y"));188 m_edit_redo.setAccelerator(KeyStroke.getKeyStroke('Y',mask)); 184 189 m_edit_redo.addActionListener(this); 185 190 m_edit_theme = new JMenuItem("Theme settings"); 186 191 m_edit_theme.setIcon(edit_icon); 187 192 m_edit_theme.setMnemonic('I'); 188 m_edit_theme.setAccelerator(KeyStroke.getKeyStroke( "ctrl I"));193 m_edit_theme.setAccelerator(KeyStroke.getKeyStroke('I',mask)); 189 194 m_edit_theme.addActionListener(this); 190 195 m_edit_global = new JMenuItem("Global variables"); 191 196 m_edit_global.setMnemonic('G'); 192 m_edit_global.setAccelerator(KeyStroke.getKeyStroke( "ctrl G"));197 m_edit_global.setAccelerator(KeyStroke.getKeyStroke('G',mask)); 193 198 m_edit_global.addActionListener(this); 194 199 m_edit_up = new JMenuItem("Move selected item up"); 195 m_edit_up.setAccelerator(KeyStroke.getKeyStroke( "ctrl UP"));200 m_edit_up.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_UP,mask)); 196 201 m_edit_up.addActionListener(this); 197 202 m_edit_down = new JMenuItem("Move selected item down"); 198 m_edit_down.setAccelerator(KeyStroke.getKeyStroke( "ctrl DOWN"));203 m_edit_down.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN,mask)); 199 204 m_edit_down.addActionListener(this); 200 205 m_edit_left = new JMenuItem("Move selected item left"); 201 m_edit_left.setAccelerator(KeyStroke.getKeyStroke( "ctrl LEFT"));206 m_edit_left.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,mask)); 202 207 m_edit_left.addActionListener(this); 203 208 m_edit_right = new JMenuItem("Move selected item right"); 204 m_edit_right.setAccelerator(KeyStroke.getKeyStroke( "ctrl RIGHT"));209 m_edit_right.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,mask)); 205 210 m_edit_right.addActionListener(this); 206 211 … … 564 569 } 565 570 catch (Exception e) { 571 System.err.println("Could not read VLC installation directory from Registry. VLC might not be properly installed."); 566 572 e.printStackTrace(); 567 573 } … … 610 616 opening = true; 611 617 String[] exts = { "xml","vlt" }; 612 base_fc.setFileFilter(new CustomFileFilter(base_fc,exts,"*.xml (VLC XML-Skin Files), *.vlt (Packed XML-Skins)",false,vlc_dir)); 613 int returnVal = base_fc.showOpenDialog(this); 614 if(returnVal == JFileChooser.APPROVE_OPTION) { 615 openFile(base_fc.getSelectedFile()); 616 opening = false; 618 if(System.getProperty("os.name").indexOf("Mac")==-1) { 619 base_fc.setFileFilter(new CustomFileFilter(base_fc,exts,"*.xml (VLC XML-Skin Files), *.vlt (Packed XML-Skins)",false,vlc_dir)); 620 int returnVal = base_fc.showOpenDialog(this); 621 if(returnVal == JFileChooser.APPROVE_OPTION) { 622 openFile(base_fc.getSelectedFile()); 623 opening = false; 624 } 625 else { 626 opening = false; 627 if(!opened) showWelcomeDialog(); 628 } 617 629 } 618 630 else { 619 opening = false; 620 if(!opened) showWelcomeDialog(); 631 FileDialog fd = new FileDialog(this); 632 fd.setMode(FileDialog.LOAD); 633 fd.setFilenameFilter(new FilenameFilter() { 634 public boolean accept(File f, String s) { 635 return f.getName().toUpperCase().matches("*.XML"); 636 } 637 }); 638 fd.setVisible(true); 639 String f = fd.getFile(); 640 if(f!=null) { 641 openFile(new File(fd.getDirectory(),fd.getFile())); 642 opening = false; 643 } 644 else { 645 opening = false; 646 if(!opened) showWelcomeDialog(); 647 } 648 621 649 } 622 650 } … … 1499 1527 pvwin.selectItem(s.getItem(selected_item)); 1500 1528 } 1501 } 1502 public void windowActivated(WindowEvent e) {} 1503 public void windowClosed(WindowEvent e) {} 1529 } 1504 1530 public void windowClosing(WindowEvent e) { 1505 1531 if(!saved) { … … 1530 1556 } 1531 1557 } 1532 public void windowDeactivated(WindowEvent e) {} 1533 public void windowDeiconified(WindowEvent e) {} 1534 public void windowIconified(WindowEvent e) {} 1558 public void windowClosed(WindowEvent e) {} 1559 public void windowActivated(WindowEvent e) { 1560 if(pvwin.fu==null) { 1561 pvwin.fu = new FrameUpdater(pvwin,5); 1562 pvwin.fu.start(); 1563 } 1564 } 1565 public void windowDeactivated(WindowEvent e) { 1566 pvwin.fu = null; 1567 } 1568 public void windowDeiconified(WindowEvent e) { 1569 if(pvwin.fu==null) { 1570 pvwin.fu = new FrameUpdater(pvwin,5); 1571 pvwin.fu.start(); 1572 } 1573 } 1574 public void windowIconified(WindowEvent e) { 1575 pvwin.fu = null; 1576 } 1535 1577 public void windowOpened(WindowEvent e) {} 1536 1578 public void mouseClicked(MouseEvent e) { … … 1598 1640 return null; 1599 1641 } 1600 } 1642 } 1601 1643 /** 1602 1644 * Creates a new instance of Main and thus launches the editor … … 1611 1653 } 1612 1654 JFrame.setDefaultLookAndFeelDecorated(true); 1655 System.setProperty("apple.laf.useScreenMenuBar", "true"); 1656 System.setProperty("com.apple.mrj.application.apple.menu.about.name", "VLC Skin Editor"); 1613 1657 new Main(args); 1614 1658 } trunk/src/vlcskineditor/Window.java
r101 r103 153 153 playondrop_tf.setToolTipText("Indicates whether a dropped file is played directly (true) or only enqueued (false). This attribute has no effect if dragdrop is set to \"false\"."); 154 154 ok_btn = new JButton("OK"); 155 ok_btn.addActionListener(this); 156 ok_btn.setPreferredSize(new Dimension(70,25)); 155 ok_btn.addActionListener(this); 157 156 cancel_btn = new JButton("Cancel"); 158 cancel_btn.addActionListener(this); 159 cancel_btn.setPreferredSize(new Dimension(70,25)); 157 cancel_btn.addActionListener(this); 160 158 help_btn = new JButton("Help"); 161 help_btn.addActionListener(this); 162 help_btn.setPreferredSize(new Dimension(70,25)); 159 help_btn.addActionListener(this); 160 JLabel attr_l = new JLabel("* Attributes marked with a star must be specified."); 161 162 //Distance of textfields to WEST edge of container 163 Component[] labels = { id_l, x_l, y_l, visible_l, dragdrop_l, playondrop_l}; 164 int tf_dx = Helper.maxWidth(labels)+10; 165 //Max. textfield width 166 int tf_wd = 200; 163 167 164 168 JPanel general = new JPanel(null); 165 169 general.add(id_l); 166 170 general.add(id_tf); 167 id_l.setBounds(5,15,75,24); 168 id_tf.setBounds(85,15,150,24); 171 id_tf.setPreferredSize(new Dimension(tf_wd,id_tf.getPreferredSize().height)); 169 172 general.add(x_l); 170 173 general.add(x_tf); 171 x_l.setBounds(5,45,75,24); 172 x_tf.setBounds(85,45,150,24); 174 x_tf.setPreferredSize(new Dimension(tf_wd,x_tf.getPreferredSize().height)); 173 175 general.add(y_l); 174 176 general.add(y_tf); 175 y_l.setBounds(5,75,75,24); 176 y_tf.setBounds(85,75,150,24); 177 y_tf.setPreferredSize(new Dimension(tf_wd,y_tf.getPreferredSize().height)); 177 178 general.add(visible_l); 178 179 general.add(visible_tf); 179 visible_l.setBounds(5,105,75,24); 180 visible_tf.setBounds(85,105,75,24); 180 visible_tf.setPreferredSize(new Dimension(tf_wd,visible_tf.getPreferredSize().height)); 181 181 general.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "General Attributes")); 182 general.setMinimumSize(new Dimension(240,140)); 183 general.setPreferredSize(new Dimension(240,140)); 184 general.setMaximumSize(new Dimension(240,140)); 182 SpringLayout general_layout = new SpringLayout(); 183 general.setLayout(general_layout); 184 general_layout.putConstraint(SpringLayout.NORTH, id_l, 5, SpringLayout.NORTH, general); 185 general_layout.putConstraint(SpringLayout.WEST, id_l, 5, SpringLayout.WEST, general); 186 187 general_layout.putConstraint(SpringLayout.WEST, id_tf, tf_dx, SpringLayout.WEST, general); 188 general_layout.putConstraint(SpringLayout.NORTH, id_tf, 0, SpringLayout.NORTH, id_l); 189 general_layout.putConstraint(SpringLayout.EAST, general, 5, SpringLayout.EAST, id_tf); 190 191 general_layout.putConstraint(SpringLayout.NORTH, x_l, 10, SpringLayout.SOUTH, id_l); 192 general_layout.putConstraint(SpringLayout.WEST, x_l, 5, SpringLayout.WEST, general); 193 194 general_layout.putConstraint(SpringLayout.WEST, x_tf, tf_dx, SpringLayout.WEST, general); 195 general_layout.putConstraint(SpringLayout.NORTH, x_tf, 0, SpringLayout.NORTH, x_l); 196 general_layout.putConstraint(SpringLayout.EAST, x_tf, 0, SpringLayout.EAST, id_tf); 197 198 general_layout.putConstraint(SpringLayout.NORTH, y_l, 10, SpringLayout.SOUTH, x_l); 199 general_layout.putConstraint(SpringLayout.WEST, y_l, 5, SpringLayout.WEST, general); 200 201 general_layout.putConstraint(SpringLayout.WEST, y_tf, tf_dx, SpringLayout.WEST, general); 202 general_layout.putConstraint(SpringLayout.NORTH, y_tf, 0, SpringLayout.NORTH, y_l); 203 general_layout.putConstraint(SpringLayout.EAST, y_tf, 0, SpringLayout.EAST, id_tf); 204 205 general_layout.putConstraint(SpringLayout.NORTH, visible_l, 10, SpringLayout.SOUTH, y_l); 206 general_layout.putConstraint(SpringLayout.WEST, visible_l, 5, SpringLayout.WEST, general); 207 208 general_layout.putConstraint(SpringLayout.WEST, visible_tf, tf_dx, SpringLayout.WEST, general); 209 general_layout.putConstraint(SpringLayout.NORTH, visible_tf, 0, SpringLayout.NORTH, visible_l); 210 general_layout.putConstraint(SpringLayout.EAST, visible_tf, 0, SpringLayout.EAST, id_tf); 211 212 general_layout.putConstraint(SpringLayout.SOUTH, general, 10, SpringLayout.SOUTH, visible_l); 185 213 frame.add(general); 186 214 … … 188 216 options.add(dragdrop_l); 189 217 options.add(dragdrop_tf); 190 dragdrop_l.setBounds(5,15,75,24); 191 dragdrop_tf.setBounds(85,15,150,24); 218 dragdrop_tf.setPreferredSize(new Dimension(tf_wd,dragdrop_tf.getPreferredSize().height)); 192 219 options.add(playondrop_l); 193 220 options.add(playondrop_tf); 194 playondrop_l.setBounds(5,45,75,24); 195 playondrop_tf.setBounds(85,45,150,24); 221 playondrop_tf.setPreferredSize(new Dimension(tf_wd,playondrop_tf.getPreferredSize().height)); 196 222 options.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Drag and drop options")); 197 options.setMinimumSize(new Dimension(240,85)); 198 options.setPreferredSize(new Dimension(240,85)); 199 options.setMaximumSize(new Dimension(240,85)); 223 SpringLayout options_layout = new SpringLayout(); 224 options.setLayout(options_layout); 225 options_layout.putConstraint(SpringLayout.NORTH, dragdrop_l, 5, SpringLayout.NORTH, options); 226 options_layout.putConstraint(SpringLayout.WEST, dragdrop_l, 5, SpringLayout.WEST, options); 227 228 options_layout.putConstraint(SpringLayout.WEST, dragdrop_tf, tf_dx, SpringLayout.WEST, options); 229 options_layout.putConstraint(SpringLayout.NORTH, dragdrop_tf, 0, SpringLayout.NORTH, dragdrop_l); 230 options_layout.putConstraint(SpringLayout.EAST, options, 5, SpringLayout.EAST, dragdrop_tf); 231 232 options_layout.putConstraint(SpringLayout.NORTH, playondrop_l, 10, SpringLayout.SOUTH, dragdrop_l); 233 options_layout.putConstraint(SpringLayout.WEST, playondrop_l, 5, SpringLayout.WEST, options); 234 235 options_layout.putConstraint(SpringLayout.WEST, playondrop_tf, tf_dx, SpringLayout.NORTH, options); 236 options_layout.putConstraint(SpringLayout.NORTH, playondrop_tf, 0, SpringLayout.NORTH, playondrop_l); 237 options_layout.putConstraint(SpringLayout.EAST, playondrop_tf, 0, SpringLayout.EAST, dragdrop_tf); 238 239 options_layout.putConstraint(SpringLayout.SOUTH, options, 10, SpringLayout.SOUTH, playondrop_l); 200 240 frame.add(options); 201 241 … … 203 243 frame.add(cancel_btn); 204 244 frame.add(help_btn); 205 frame.add(new JLabel("* required attribute")); 206 207 frame.setMinimumSize(new Dimension(250,310)); 208 frame.setPreferredSize(new Dimension(250,310)); 209 frame.setMaximumSize(new Dimension(250,310)); 245 frame.add(attr_l); 246 247 SpringLayout layout = new SpringLayout(); 248 frame.setLayout(layout); 249 250 layout.putConstraint(SpringLayout.NORTH, general, 5, SpringLayout.NORTH, frame.getContentPane()); 251 layout.putConstraint(SpringLayout.WEST, general, 5, SpringLayout.WEST, frame.getContentPane()); 252 253 layout.putConstraint(SpringLayout.NORTH, options, 5, SpringLayout.SOUTH, general); 254 layout.putConstraint(SpringLayout.WEST, options, 5, SpringLayout.WEST, frame.getContentPane()); 255 256 layout.putConstraint(SpringLayout.NORTH, attr_l, 5, SpringLayout.SOUTH, options); 257 layout.putConstraint(SpringLayout.WEST, attr_l, 5, SpringLayout.WEST, frame.getContentPane()); 258 layout.putConstraint(SpringLayout.EAST, attr_l, 5, SpringLayout.EAST, frame.getContentPane()); 259 260 261 layout.putConstraint(SpringLayout.NORTH, ok_btn, 5, SpringLayout.SOUTH, attr_l); 262 layout.putConstraint(SpringLayout.NORTH, cancel_btn, 5, SpringLayout.SOUTH, attr_l); 263 layout.putConstraint(SpringLayout.NORTH, help_btn, 5, SpringLayout.SOUTH, attr_l); 264 265 layout.putConstraint(SpringLayout.WEST, ok_btn, 5, SpringLayout.WEST, frame.getContentPane()); 266 layout.putConstraint(SpringLayout.WEST, cancel_btn, 5, SpringLayout.EAST, ok_btn); 267 layout.putConstraint(SpringLayout.WEST, help_btn, 5, SpringLayout.EAST, cancel_btn); 268 269 layout.putConstraint(SpringLayout.SOUTH, frame.getContentPane(), 5, SpringLayout.SOUTH, ok_btn); 270 layout.putConstraint(SpringLayout.EAST, frame.getContentPane(), 5, SpringLayout.EAST, general); 210 271 211 272 frame.pack(); 273 274 frame.getRootPane().setDefaultButton(ok_btn); 212 275 } 213 276 id_tf.setText(id); trunk/src/vlcskineditor/resources/Bitmap.java
r102 r103 353 353 frame.pack(); 354 354 355 frame.getRootPane().setDefaultButton(ok_btn); 355 356 } 356 357 id_tf.setText(id); trunk/src/vlcskineditor/resources/Font.java
r102 r103 255 255 256 256 frame.pack(); 257 258 frame.getRootPane().setDefaultButton(ok_btn); 257 259 } 258 260 id_tf.setText(id); trunk/src/vlcskineditor/resources/SubBitmap.java
r102 r103 221 221 bounds.setLayout(bounds_layout); 222 222 bounds_layout.putConstraint(SpringLayout.NORTH, x_l, 5, SpringLayout.NORTH, bounds); 223 bounds_layout.putConstraint(SpringLayout.WEST, x_l, 5, SpringLayout.WEST, bounds); 223 bounds_layout.putConstraint(SpringLayout.WEST, x_l, 5, SpringLayout.WEST, bounds); 224 224 225 bounds_layout.putConstraint(SpringLayout.WEST, x_tf, tf_dx, SpringLayout.WEST, bounds); 225 226 bounds_layout.putConstraint(SpringLayout.NORTH, x_tf, 0, SpringLayout.NORTH, x_l); 226 bounds_layout.putConstraint(SpringLayout.EAST, bounds, 5, SpringLayout.EAST, x_tf); 227 bounds_layout.putConstraint(SpringLayout.EAST, bounds, 5, SpringLayout.EAST, x_tf); 228 227 229 bounds_layout.putConstraint(SpringLayout.NORTH, y_l, 10, SpringLayout.SOUTH, x_l); 228 bounds_layout.putConstraint(SpringLayout.WEST, y_l, 5, SpringLayout.WEST, bounds); 230 bounds_layout.putConstraint(SpringLayout.WEST, y_l, 5, SpringLayout.WEST, bounds); 231 229 232 bounds_layout.putConstraint(SpringLayout.WEST, y_tf, tf_dx, SpringLayout.WEST, bounds); 230 233 bounds_layout.putConstraint(SpringLayout.NORTH, y_tf, 0, SpringLayout.NORTH, y_l); 231 234 bounds_layout.putConstraint(SpringLayout.EAST, y_tf, 0, SpringLayout.EAST, x_tf); 235 232 236 bounds_layout.putConstraint(SpringLayout.NORTH, width_l, 10, SpringLayout.SOUTH, y_l); 233 bounds_layout.putConstraint(SpringLayout.WEST, width_l, 5, SpringLayout.WEST, bounds); 237 bounds_layout.putConstraint(SpringLayout.WEST, width_l, 5, SpringLayout.WEST, bounds); 238 234 239 bounds_layout.putConstraint(SpringLayout.WEST, width_tf, tf_dx, SpringLayout.WEST, bounds); 235 240 bounds_layout.putConstraint(SpringLayout.NORTH, width_tf, 0, SpringLayout.NORTH, width_l); 236 241 bounds_layout.putConstraint(SpringLayout.EAST, width_tf, 0, SpringLayout.EAST, x_tf); 242 237 243 bounds_layout.putConstraint(SpringLayout.NORTH, height_l, 10, SpringLayout.SOUTH, width_l); 238 bounds_layout.putConstraint(SpringLayout.WEST, height_l, 5, SpringLayout.WEST, bounds); 244 bounds_layout.putConstraint(SpringLayout.WEST, height_l, 5, SpringLayout.WEST, bounds); 245 239 246 bounds_layout.putConstraint(SpringLayout.WEST, height_tf, tf_dx, SpringLayout.WEST, bounds); 240 247 bounds_layout.putConstraint(SpringLayout.NORTH, height_tf, 0, SpringLayout.NORTH, height_l); 241 bounds_layout.putConstraint(SpringLayout.EAST, height_tf, 0, SpringLayout.EAST, x_tf); 248 bounds_layout.putConstraint(SpringLayout.EAST, height_tf, 0, SpringLayout.EAST, x_tf); 249 242 250 bounds_layout.putConstraint(SpringLayout.SOUTH, bounds, 10, SpringLayout.SOUTH, height_l); 243 251 frame.add(bounds); … … 299 307 300 308 frame.pack(); 309 310 frame.getRootPane().setDefaultButton(ok_btn); 301 311 } 302 312 id_tf.setText(id); … … 335 345 return; 336 346 } 337 if(Integer.parseInt(x_tf.getText())+Integer.parseInt( height_tf.getText())>parent.image.getHeight()) {347 if(Integer.parseInt(x_tf.getText())+Integer.parseInt(width_tf.getText())>parent.image.getWidth()) { 338 348 JOptionPane.showMessageDialog(frame,"Specified dimensions are outside the parent bitmap!","Dimension not valid",JOptionPane.INFORMATION_MESSAGE); 339 349 return;
