This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 20882
Collapse All | Expand All

(-)autoupdate/libsrc/org/netbeans/updater/UpdaterFrame.java (-2 / +6 lines)
Lines 52-60 Link Here
52
    
52
    
53
    static final void center(Window c) {
53
    static final void center(Window c) {
54
        c.pack();
54
        c.pack();
55
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
55
56
        GraphicsConfiguration gconf = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
57
        Rectangle bounds = gconf.getBounds();
56
        Dimension dialogSize = c.getSize();
58
        Dimension dialogSize = c.getSize();
57
        c.setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
59
        
60
        c.setLocation(bounds.x + (bounds.width - dialogSize.width) / 2,
61
                    bounds.y + (bounds.height - dialogSize.height) / 2);
58
    }
62
    }
59
63
60
    static String getMainWindowTitle() {
64
    static String getMainWindowTitle() {
(-)autoupdate/src/org/netbeans/modules/autoupdate/AutoCheckInfo.java (-12 lines)
Lines 383-398 Link Here
383
        }
383
        }
384
        return null;
384
        return null;
385
    }
385
    }
386
387
    
388
    /** Moves specified window to the center of the screen
389
    */
390
    /*
391
    public static void centerWindow (Window w) {
392
      Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
393
      Dimension dialogSize = w.getSize();
394
      w.setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
395
}
396
    */
397
398
}
386
}
(-)core/javahelp/manifest.mf (-1 / +1 lines)
Lines 4-10 Link Here
4
OpenIDE-Module-Specification-Version: 1.0
4
OpenIDE-Module-Specification-Version: 1.0
5
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
6
OpenIDE-Module-Provides: org.netbeans.api.javahelp.Help
6
OpenIDE-Module-Provides: org.netbeans.api.javahelp.Help
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 2.3
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 2.4
8
OpenIDE-Module-Package-Dependencies: javax.help[HelpSet] > 1.0
8
OpenIDE-Module-Package-Dependencies: javax.help[HelpSet] > 1.0
9
OpenIDE-Module-Layer: org/netbeans/modules/javahelp/resources/layer.xml
9
OpenIDE-Module-Layer: org/netbeans/modules/javahelp/resources/layer.xml
10
OpenIDE-Module-Install: org/netbeans/modules/javahelp/Installer.class
10
OpenIDE-Module-Install: org/netbeans/modules/javahelp/Installer.class
(-)core/javahelp/src/org/netbeans/modules/javahelp/JavaHelp.java (-3 / +3 lines)
Lines 186-192 Link Here
186
            frameViewer.setTitle(jh.getModel().getHelpSet().getTitle());
186
            frameViewer.setTitle(jh.getModel().getHelpSet().getTitle());
187
            frameViewer.pack();
187
            frameViewer.pack();
188
        }
188
        }
189
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
189
        Dimension screenSize = Utilities.getCurrentGraphicsConfiguration().getBounds().getSize();
190
        Dimension frameSize = frameViewer.getSize();
190
        Dimension frameSize = frameViewer.getSize();
191
        // #11018: have mercy on little screens
191
        // #11018: have mercy on little screens
192
        if (frameSize.width > screenSize.width) {
192
        if (frameSize.width > screenSize.width) {
Lines 198-205 Link Here
198
            frameViewer.setSize(frameSize);
198
            frameViewer.setSize(frameSize);
199
        }
199
        }
200
        // Now center it.
200
        // Now center it.
201
        frameViewer.setLocation((screenSize.width - frameSize.width) / 2,
201
        frameViewer.setBounds(Utilities.getCenterBounds(frameSize));
202
                                (screenSize.height - frameSize.height) / 2);
202
203
        frameViewer.setState(Frame.NORMAL);
203
        frameViewer.setState(Frame.NORMAL);
204
        if (frameViewer.isVisible()) {
204
        if (frameViewer.isVisible()) {
205
            frameViewer.repaint();
205
            frameViewer.repaint();
(-)core/src/org/netbeans/beaninfo/editors/PropertiesCustomEditor.java (-10 lines)
Lines 66-81 Link Here
66
        return props;
66
        return props;
67
    }
67
    }
68
    
68
    
69
    /** Returns preferredSize as the preferred height and the width of the panel */
70
    public java.awt.Dimension getPreferredSize() {
71
        int screenWidth = org.openide.util.Utilities.getScreenSize().width;
72
        
73
        if (super.getPreferredSize().width >= screenWidth)
74
            return new java.awt.Dimension(screenWidth - 50, super.getPreferredSize().height);
75
        else
76
            return super.getPreferredSize();
77
    }
78
79
    /** This method is called from within the constructor to
69
    /** This method is called from within the constructor to
80
     * initialize the form.
70
     * initialize the form.
81
     * WARNING: Do NOT modify this code. The content of this method is
71
     * WARNING: Do NOT modify this code. The content of this method is
(-)core/src/org/netbeans/core/CoronaDialog.java (-3 / +2 lines)
Lines 22-27 Link Here
22
import org.netbeans.core.awt.ButtonBarButton;
22
import org.netbeans.core.awt.ButtonBarButton;
23
import org.openide.TopManager;
23
import org.openide.TopManager;
24
import org.openide.util.HelpCtx;
24
import org.openide.util.HelpCtx;
25
import org.openide.util.Utilities;
25
26
26
/** The CoronaDialog is a standard dialog that contains a ButtonBar on the South.
27
/** The CoronaDialog is a standard dialog that contains a ButtonBar on the South.
27
* All the "add(Component)" and "setLayout(LayoutManager)" requests should be
28
* All the "add(Component)" and "setLayout(LayoutManager)" requests should be
Lines 156-164 Link Here
156
    public void center() {
157
    public void center() {
157
        // standard way how to place the dialog to the center of the screen
158
        // standard way how to place the dialog to the center of the screen
158
        pack();
159
        pack();
159
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
160
        setBounds(Utilities.getCenterBounds(getSize()));
160
        Dimension dialogSize = getSize();
161
        setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
162
    }
161
    }
163
162
164
    /** Called when user presses a button on the ButtonBar.
163
    /** Called when user presses a button on the ButtonBar.
(-)core/src/org/netbeans/core/NbPresenter.java (-1 / +1 lines)
Lines 145-151 Link Here
145
        initializePresenter();
145
        initializePresenter();
146
146
147
        pack();
147
        pack();
148
        setLocationRelativeTo(null); // center on screen
148
        setBounds(Utilities.getCenterBounds(getSize()));
149
149
150
        // #17794. First time the initial focus component
150
        // #17794. First time the initial focus component
151
        // will be set automatically when called show.
151
        // will be set automatically when called show.
(-)core/src/org/netbeans/core/Splash.java (-3 / +1 lines)
Lines 149-157 Link Here
149
     */
149
     */
150
    public static final void center(Window c) {
150
    public static final void center(Window c) {
151
        c.pack();
151
        c.pack();
152
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
152
        c.setBounds(Utilities.getCenterBounds(c.getSize()));
153
        Dimension dialogSize = c.getSize();
154
        c.setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
155
    }
153
    }
156
154
157
    /** @return splash image */
155
    /** @return splash image */
(-)core/src/org/netbeans/core/windows/MainWindow.java (-2 / +3 lines)
Lines 37-42 Link Here
37
import org.openide.util.NbBundle;
37
import org.openide.util.NbBundle;
38
import org.openide.util.RequestProcessor;
38
import org.openide.util.RequestProcessor;
39
import org.openide.util.SharedClassObject;
39
import org.openide.util.SharedClassObject;
40
import org.openide.util.Utilities;
40
import org.openide.util.actions.*;
41
import org.openide.util.actions.*;
41
import org.openide.windows.Workspace;
42
import org.openide.windows.Workspace;
42
import org.openide.windows.TopComponent;
43
import org.openide.windows.TopComponent;
Lines 312-321 Link Here
312
    /** Returns preferredSize as the preferred height and the width of the screen */
313
    /** Returns preferredSize as the preferred height and the width of the screen */
313
    public Dimension getPreferredSize() {
314
    public Dimension getPreferredSize() {
314
        if (WindowUtils.isMdi()) {
315
        if (WindowUtils.isMdi()) {
315
            return org.openide.util.Utilities.getScreenSize();
316
            return Utilities.getUsableScreenBounds(Utilities.getCurrentGraphicsConfiguration()).getSize();
316
        } else {
317
        } else {
317
            return new Dimension(
318
            return new Dimension(
318
                org.openide.util.Utilities.getScreenSize().width,
319
                Utilities.getUsableScreenBounds(Utilities.getCurrentGraphicsConfiguration()).getSize().width,
319
                super.getPreferredSize().height
320
                super.getPreferredSize().height
320
            );
321
            );
321
        }
322
        }
(-)core/src/org/netbeans/core/windows/WorkspaceBoundsManager.java (-10 / +10 lines)
Lines 26-31 Link Here
26
26
27
import javax.swing.SwingUtilities;
27
import javax.swing.SwingUtilities;
28
28
29
import org.openide.util.Utilities;
29
import org.openide.windows.Mode;
30
import org.openide.windows.Mode;
30
import org.openide.windows.TopComponent;
31
import org.openide.windows.TopComponent;
31
32
Lines 204-222 Link Here
204
        mainBounds.height = mainWindow.getPreferredSize().height;
205
        mainBounds.height = mainWindow.getPreferredSize().height;
205
206
206
        Rectangle workingSpace = null;
207
        Rectangle workingSpace = null;
207
        int bottomSpace = WindowUtils.getTaskbarHeight();
208
        Rectangle screenBounds = Utilities.getUsableScreenBounds(
208
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
209
            Utilities.getCurrentGraphicsConfiguration());
209
210
210
        if (mainBounds.y < (screenSize.height / 2)) {
211
        if (mainBounds.y < (screenBounds.y + screenBounds.height / 2)) {
211
            workingSpace = new Rectangle(
212
            workingSpace = new Rectangle(
212
                               0, mainBounds.y + mainBounds.height,
213
                               screenBounds.x,
213
                               screenSize.width,
214
                               mainBounds.y + mainBounds.height,
214
                               screenSize.height - bottomSpace - (mainBounds.y + mainBounds.height)
215
                               screenBounds.width,
215
                           );
216
                               screenBounds.height - (mainBounds.y + mainBounds.height)
217
                               );
216
        } else {
218
        } else {
217
            workingSpace = new Rectangle(
219
            workingSpace = new Rectangle(screenBounds);
218
                               0, 0, screenSize.width, mainBounds.y
219
                           );
220
        }
220
        }
221
        return workingSpace;
221
        return workingSpace;
222
    }
222
    }
(-)core/src/org/netbeans/core/windows/frames/DefaultContainerImpl.java (-9 / +12 lines)
Lines 23-30 Link Here
23
import java.awt.Image;
23
import java.awt.Image;
24
import java.awt.Point;
24
import java.awt.Point;
25
import java.awt.Dimension;
25
import java.awt.Dimension;
26
import java.awt.Toolkit;
26
import java.awt.Rectangle;
27
import java.awt.Window;
27
import java.awt.Window;
28
import java.awt.Toolkit;
29
28
import java.awt.event.ComponentListener;
30
import java.awt.event.ComponentListener;
29
import java.awt.event.FocusEvent;
31
import java.awt.event.FocusEvent;
30
import java.awt.event.AWTEventListener;
32
import java.awt.event.AWTEventListener;
Lines 53-58 Link Here
53
import org.openide.util.actions.CallableSystemAction;
55
import org.openide.util.actions.CallableSystemAction;
54
import org.openide.awt.JPopupMenuPlus;
56
import org.openide.awt.JPopupMenuPlus;
55
import org.openide.util.WeakListener;
57
import org.openide.util.WeakListener;
58
import org.openide.util.Utilities;
56
59
57
import org.netbeans.core.windows.*;
60
import org.netbeans.core.windows.*;
58
import org.netbeans.core.windows.util.WindowUtils;
61
import org.netbeans.core.windows.util.WindowUtils;
Lines 709-726 Link Here
709
712
710
    /** Shows given popup on given coordinations and takes care about the
713
    /** Shows given popup on given coordinations and takes care about the
711
     * situation when menu can exceed screen limits */
714
     * situation when menu can exceed screen limits */
712
    protected static void showPopupMenu (JPopupMenu popup, Point p, Component comp) {
715
    protected void showPopupMenu (JPopupMenu popup, Point p, Component comp) {
713
        SwingUtilities.convertPointToScreen (p, comp);
716
        SwingUtilities.convertPointToScreen (p, comp);
714
        Dimension popupSize = popup.getPreferredSize ();
717
        Dimension popupSize = popup.getPreferredSize ();
715
        Dimension screenSize = Toolkit.getDefaultToolkit ().getScreenSize ();
718
        Rectangle screenBounds = Utilities.getUsableScreenBounds(getGraphicsConfiguration());
716
        int yCorrection = WindowUtils.getTaskbarHeight();
719
        
717
720
        if (p.x + popupSize.width > screenBounds.x + screenBounds.width) {
718
        if (p.x + popupSize.width > screenSize.width) {
721
            p.x = screenBounds.x + screenBounds.width - popupSize.width;
719
            p.x = screenSize.width - popupSize.width;
720
        }
722
        }
721
        if (p.y + popupSize.height > screenSize.height - yCorrection) {
723
        if (p.y + popupSize.height > screenBounds.y + screenBounds.height) {
722
            p.y = screenSize.height - popupSize.height - yCorrection;
724
            p.y = screenBounds.y + screenBounds.height - popupSize.height;
723
        }
725
        }
726
        
724
        SwingUtilities.convertPointFromScreen (p, comp);
727
        SwingUtilities.convertPointFromScreen (p, comp);
725
        popup.show(comp, p.x, p.y);
728
        popup.show(comp, p.x, p.y);
726
    }
729
    }
(-)core/src/org/netbeans/core/windows/util/WindowUtils.java (-38 lines)
Lines 69-95 Link Here
69
    private WindowUtils () {
69
    private WindowUtils () {
70
    }
70
    }
71
71
72
    /** @return the height of the taskbar which should be substracted from the
73
     * screen height when we calculate the default layout
74
     */
75
76
    public static int getTaskbarHeight() {
77
        int taskbarHeight = 0;
78
        
79
        String str = System.getProperty("netbeans.taskbar.height"); // NOI18N
80
        if (str != null) {
81
            try {
82
                taskbarHeight = Integer.parseInt(str);
83
            }
84
            catch (NumberFormatException ex) {
85
            }
86
        }
87
        if (taskbarHeight == 0 && Utilities.isWindows ()) {
88
            taskbarHeight = Utilities.TYPICAL_WINDOWS_TASKBAR_HEIGHT;
89
        }
90
        return taskbarHeight;
91
    }
92
    
93
    /** Simple transformation to scale given rectangle between dimensions */
72
    /** Simple transformation to scale given rectangle between dimensions */
94
    public static void convertRectangle (Rectangle rect, Dimension oldDimension,
73
    public static void convertRectangle (Rectangle rect, Dimension oldDimension,
95
                                         Dimension newDimension) {
74
                                         Dimension newDimension) {
Lines 236-258 Link Here
236
        return rootPane;
215
        return rootPane;
237
    }
216
    }
238
217
239
    public static Dimension getMaximizedSize(java.awt.Container c) {
240
//        Dimension screen = org.openide.util.Utilities.getScreenSize();
241
        Dimension screen = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
242
        Dimension max = null;
243
        if (org.openide.util.Utilities.isWindows()) {
244
            Insets borders = c.getInsets();
245
            max = new Dimension(
246
                screen.width + borders.left + borders.right,
247
                screen.height + 2 * borders.bottom              // top border size includes window caption
248
            );
249
        }
250
        else
251
            max = screen;
252
        
253
        return max;
254
    }
255
    
256
    /** @return true if gf contains field with given fieldName */
218
    /** @return true if gf contains field with given fieldName */
257
    //Bugfix #10993, in JDK 1.2.2 method ObjectStreamClass.getField() returns always null
219
    //Bugfix #10993, in JDK 1.2.2 method ObjectStreamClass.getField() returns always null
258
    //whereas getFields() returns correct array so we must use getFields() instead of
220
    //whereas getFields() returns correct array so we must use getFields() instead of
(-)form/manifest.mf (-1 / +1 lines)
Lines 3-9 Link Here
3
OpenIDE-Module-Specification-Version: 1.8
3
OpenIDE-Module-Specification-Version: 1.8
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-Install: org/netbeans/modules/form/FormEditorModule.class
5
OpenIDE-Module-Install: org/netbeans/modules/form/FormEditorModule.class
6
OpenIDE-Module-IDE-Dependencies: IDE/1 > 1.24
6
OpenIDE-Module-IDE-Dependencies: IDE/1 > 2.4
7
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.java/1, org.netbeans.core/1 > 1.0
7
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.java/1, org.netbeans.core/1 > 1.0
8
OpenIDE-Module-Layer: org/netbeans/modules/form/resources/layer.xml
8
OpenIDE-Module-Layer: org/netbeans/modules/form/resources/layer.xml
9
Class-Path: ext/AbsoluteLayout.jar
9
Class-Path: ext/AbsoluteLayout.jar
(-)form/src/org/netbeans/modules/form/actions/TestAction.java (-8 / +1 lines)
Lines 126-139 Link Here
126
            }
126
            }
127
            else frame.pack();
127
            else frame.pack();
128
128
129
            // set location
129
            frame.setBounds(org.openide.util.Utilities.getCenterBounds(frame.getSize()));
130
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
131
            Dimension frameSize = frame.getSize();
132
            frame.setLocation(screenSize.width+20 > frameSize.width ?
133
                              (screenSize.width - frameSize.width) / 2 : 0,
134
                              screenSize.height+20 > frameSize.height ?
135
                              (screenSize.height - frameSize.height) / 2 : 0);
136
            // show it
137
            frame.show();
130
            frame.show();
138
        }
131
        }
139
        catch (Exception ex) {
132
        catch (Exception ex) {
(-)jarpackager/manifest.mf (-1 / +1 lines)
Lines 1-7 Link Here
1
OpenIDE-Module: org.netbeans.modules.jarpackager/2
1
OpenIDE-Module: org.netbeans.modules.jarpackager/2
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jarpackager/Bundle.properties
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jarpackager/Bundle.properties
3
OpenIDE-Module-Display-Category: Tools
3
OpenIDE-Module-Display-Category: Tools
4
OpenIDE-Module-IDE-Dependencies: IDE/1 > 1.31
4
OpenIDE-Module-IDE-Dependencies: IDE/1 > 2.4
5
OpenIDE-Module-Package-Dependencies: org.apache.regexp[RE]
5
OpenIDE-Module-Package-Dependencies: org.apache.regexp[RE]
6
OpenIDE-Module-Specification-Version: 1.10
6
OpenIDE-Module-Specification-Version: 1.10
7
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
7
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
(-)jarpackager/src/org/netbeans/modules/jarpackager/util/ProgressDialog.java (-3 / +1 lines)
Lines 88-96 Link Here
88
    /** Places dialog into the center of the screen
88
    /** Places dialog into the center of the screen
89
    */
89
    */
90
    public void center() {
90
    public void center() {
91
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
91
        setBounds(org.openide.util.Utilities.getCenterBounds(getSize()));
92
        Dimension dialogSize = getSize();
93
        setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
94
    }
92
    }
95
93
96
    /** Increments value by 1 */
94
    /** Increments value by 1 */
(-)javacvs/manifest.mf (-1 / +1 lines)
Lines 4-10 Link Here
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-Layer: org/netbeans/modules/cvsclient/layer.xml
5
OpenIDE-Module-Layer: org/netbeans/modules/cvsclient/layer.xml
6
OpenIDE-Module-Install: org/netbeans/modules/cvsclient/JavaCvsModuleInstall.class
6
OpenIDE-Module-Install: org/netbeans/modules/cvsclient/JavaCvsModuleInstall.class
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 1.24
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 2.4
8
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.vcscore/1
8
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.vcscore/1
9
Class-Path: ext/cvslib.jar
9
Class-Path: ext/cvslib.jar
10
10
(-)javacvs/src/org/netbeans/modules/cvsclient/customizer/NbJavaCvsCustomizer.java (-3 / +1 lines)
Lines 407-414 Link Here
407
    } 
407
    } 
408
    
408
    
409
    public static void centerWindow (Window w) {
409
    public static void centerWindow (Window w) {
410
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
410
        w.setBounds(org.openide.util.Utilities.getCenterBounds(w.getSize()));
411
        Dimension dialogSize = w.getSize();
412
        w.setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
413
    }    
411
    }    
414
}
412
}
(-)javacvs/src/org/netbeans/modules/javacvs/customizers/CommitParamInput.java (-3 / +1 lines)
Lines 480-487 Link Here
480
    
480
    
481
    
481
    
482
    public static void centerWindow(Window w) {
482
    public static void centerWindow(Window w) {
483
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
483
        w.setBounds(org.openide.util.Utilities.getCenterBounds(w.getSize()));
484
        Dimension dialogSize = w.getSize();
485
        w.setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
486
    }
484
    }
487
}
485
}
(-)javadoc/manifest.mf (-1 / +1 lines)
Lines 5-11 Link Here
5
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.java/1 > 1.7
5
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.java/1 > 1.7
6
OpenIDE-Module-Specification-Version: 1.8
6
OpenIDE-Module-Specification-Version: 1.8
7
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
7
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
8
OpenIDE-Module-IDE-Dependencies: IDE/1 > 1.24
8
OpenIDE-Module-IDE-Dependencies: IDE/1 > 2.4
9
9
10
Name: org/netbeans/modules/javadoc/GenerateDocAction.class
10
Name: org/netbeans/modules/javadoc/GenerateDocAction.class
11
OpenIDE-Module-Class: Action
11
OpenIDE-Module-Class: Action
(-)javadoc/src/org/netbeans/modules/javadoc/comments/NewTagDialog.java (-8 / +2 lines)
Lines 23-34 Link Here
23
import org.openide.src.ClassElement;
23
import org.openide.src.ClassElement;
24
import org.openide.src.JavaDocTag;
24
import org.openide.src.JavaDocTag;
25
import org.openide.src.JavaDocSupport;
25
import org.openide.src.JavaDocSupport;
26
import org.openide.util.Utilities;
26
27
27
/**
28
 *
29
 * @author
30
 * @version
31
 */
32
public class NewTagDialog extends javax.swing.JDialog implements JavaTagNames {
28
public class NewTagDialog extends javax.swing.JDialog implements JavaTagNames {
33
29
34
    private ButtonGroup bgroup;
30
    private ButtonGroup bgroup;
Lines 102-110 Link Here
102
        customRadioButton.getModel().setActionCommand( TAG_CUSTOM );
98
        customRadioButton.getModel().setActionCommand( TAG_CUSTOM );
103
        customRadioButton.setMnemonic(org.openide.util.NbBundle.getBundle(NewTagDialog.class).getString("NewTagDialog.customRadioButton_Mnemonic").charAt(0));  // NOI18N
99
        customRadioButton.setMnemonic(org.openide.util.NbBundle.getBundle(NewTagDialog.class).getString("NewTagDialog.customRadioButton_Mnemonic").charAt(0));  // NOI18N
104
100
105
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
101
        setBounds(Utilities.getCenterBounds(getSize()));
106
        Dimension dialogSize = this.getSize();
107
        this.setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
108
102
109
        if ( element instanceof ConstructorElement ) {
103
        if ( element instanceof ConstructorElement ) {
110
            paramRadioButton.setVisible( true );
104
            paramRadioButton.setVisible( true );
(-)objectbrowser/src/org/netbeans/modules/objectbrowser/ObjectBrowser.java (-2 / +1 lines)
Lines 200-207 Link Here
200
200
201
        add (jSplitPane1, "Center"); // NOI18N
201
        add (jSplitPane1, "Center"); // NOI18N
202
202
203
        java.awt.Dimension d = java.awt.Toolkit.getDefaultToolkit ().getScreenSize ();
203
        setPreferredSize (new java.awt.Dimension (600, 400));
204
        setPreferredSize (new java.awt.Dimension (d.width / 2, (d.height * 2) / 5));
205
    }
204
    }
206
205
207
    public static void main(java.lang.String[] args) {
206
    public static void main(java.lang.String[] args) {
(-)openide/api/doc/changes/apichanges.xml (+25 lines)
Lines 110-115 Link Here
110
  <changes>
110
  <changes>
111
111
112
  <change>
112
  <change>
113
114
    <change>
115
      <api name="util"/>
116
      <summary>Added helper methods to aid module developers to write code which works correctly with multiple monitors</summary>
117
      <version major="2" minor="5"/>
118
      <date day="26" month="2" year="2002"/>
119
      <author login="ttran"/>
120
      <compatibility addition="yes" deprecation="yes"/>
121
      <description>
122
        The added methods are
123
        <pre>
124
        public static GraphicsConfiguration getCurrentGraphicsConfiguration();
125
        public static Rectangle getUsableScreenBounds(GraphicsConfiguration gconf);
126
        public static Rectangle getCenterBounds(Dimension componentSize);
127
        public static Rectangle getCenterBounds(GraphicsConfiguration gconf, Dimension componentSize);
128
        </pre>
129
130
        One should use these methods instead of calling
131
        <code>Toolkit.getScreenSize()</code>.  For the same reason
132
        <code>Utilities.getScreenSize()</code> is now deprecated.
133
      </description>
134
      <class package="org.openide.util" name="Utilities"/>
135
      <issue number="20882"/>
136
    </change>
137
      
113
      <api name="explorer"/>
138
      <api name="explorer"/>
114
      <summary>Constructor DefaultPropertyModel (bean, propertyDescriptor) added</summary>
139
      <summary>Constructor DefaultPropertyModel (bean, propertyDescriptor) added</summary>
115
      <version major="2" minor="4"/>
140
      <version major="2" minor="4"/>
(-)openide/src/org/openide/awt/HtmlBrowser.java (-6 / +3 lines)
Lines 74-86 Link Here
74
    static final long                 serialVersionUID = 2912844785502987960L;
74
    static final long                 serialVersionUID = 2912844785502987960L;
75
75
76
    /** Preferred width of the browser */
76
    /** Preferred width of the browser */
77
    public static final int           DEFAULT_WIDTH = java.awt.Toolkit.
77
    public static final int           DEFAULT_WIDTH = org.openide.util.Utilities.getCurrentGraphicsConfiguration().getBounds().width / 2;
78
            getDefaultToolkit ().getScreenSize ().
79
            width / 2;
80
    /** Preferred height of the browser */
78
    /** Preferred height of the browser */
81
    public static final int           DEFAULT_HEIGHT = java.awt.Toolkit.
79
    public static final int           DEFAULT_HEIGHT = org.openide.util.Utilities.getCurrentGraphicsConfiguration().getBounds().height / 2;
82
            getDefaultToolkit ().getScreenSize ().
80
83
            height / 2;
84
    /** current implementation of html browser */
81
    /** current implementation of html browser */
85
    private static Factory            browserFactory;
82
    private static Factory            browserFactory;
86
    /** home page URL */
83
    /** home page URL */
(-)openide/src/org/openide/awt/JInlineMenu.java (-8 lines)
Lines 280-291 Link Here
280
            JPopupMenuUtils.dynamicChange(p, usedToBeContained);
280
            JPopupMenuUtils.dynamicChange(p, usedToBeContained);
281
        }        
281
        }        
282
    }
282
    }
283
284
    public java.awt.Dimension getPreferredSize () {
285
        if (isVisible ()) {
286
            return new java.awt.Dimension (0,0);
287
        } else {
288
            return Toolkit.getDefaultToolkit ().getScreenSize ();
289
        }
290
    }
291
}
283
}
(-)openide/src/org/openide/awt/JPopupMenuUtils.java (-10 / +4 lines)
Lines 15-27 Link Here
15
15
16
import java.util.StringTokenizer;
16
import java.util.StringTokenizer;
17
17
18
import java.awt.Component;
18
import java.awt.*;
19
import java.awt.Dimension;
19
20
import java.awt.Frame;
21
import java.awt.Point;
22
import java.awt.Rectangle;
23
import java.awt.Toolkit;
24
import java.awt.Window;
25
import javax.swing.JFrame;
20
import javax.swing.JFrame;
26
import javax.swing.JMenu;
21
import javax.swing.JMenu;
27
import javax.swing.JPopupMenu;
22
import javax.swing.JPopupMenu;
Lines 316-324 Link Here
316
        if (screenRect != null) {
311
        if (screenRect != null) {
317
            return screenRect;
312
            return screenRect;
318
        }
313
        }
319
        Dimension screenSize = Utilities.getScreenSize();
314
        Dimension screen = Utilities.getScreenSize();
320
        screenRect = new Rectangle(0, 0, screenSize.width, screenSize.height);
315
        return new Rectangle(0, 0, screen.width, screen.height);
321
        return screenRect;
322
    }
316
    }
323
317
324
    /*
318
    /*
(-)openide/src/org/openide/explorer/view/ListView.java (-3 / +6 lines)
Lines 601-611 Link Here
601
            java.awt.Point p = getViewport().getViewPosition();
601
            java.awt.Point p = getViewport().getViewPosition();
602
            p.x = xpos - p.x;
602
            p.x = xpos - p.x;
603
            p.y = ypos - p.y;
603
            p.y = ypos - p.y;
604
604
            SwingUtilities.convertPointToScreen(p, ListView.this);
605
            SwingUtilities.convertPointToScreen(p, ListView.this);
605
            Dimension popupSize = popup.getPreferredSize ();
606
            Dimension popupSize = popup.getPreferredSize ();
606
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
607
            Rectangle screenBounds = Utilities.getUsableScreenBounds(getGraphicsConfiguration());
607
            if (p.x + popupSize.width > screenSize.width) p.x = screenSize.width - popupSize.width;
608
            if (p.x + popupSize.width > screenBounds.x + screenBounds.width)
608
            if (p.y + popupSize.height > screenSize.height) p.y = screenSize.height - popupSize.height;
609
                p.x = screenBounds.x + screenBounds.width - popupSize.width;
610
            if (p.y + popupSize.height > screenBounds.y + screenBounds.height)
611
                p.y = screenBounds.y + screenBounds.height - popupSize.height;
609
            SwingUtilities.convertPointFromScreen(p, ListView.this);
612
            SwingUtilities.convertPointFromScreen(p, ListView.this);
610
            popup.show(this, p.x, p.y);
613
            popup.show(this, p.x, p.y);
611
        }
614
        }
(-)openide/src/org/openide/explorer/view/MenuView.java (-3 / +6 lines)
Lines 30-35 Link Here
30
import org.openide.util.Mutex;
30
import org.openide.util.Mutex;
31
import org.openide.util.NbBundle;
31
import org.openide.util.NbBundle;
32
import org.openide.util.HelpCtx;
32
import org.openide.util.HelpCtx;
33
import org.openide.util.Utilities;
33
import org.openide.util.actions.SystemAction;
34
import org.openide.util.actions.SystemAction;
34
import org.openide.awt.JPopupMenuUtils;
35
import org.openide.awt.JPopupMenuUtils;
35
36
Lines 139-147 Link Here
139
                p.y = e.getY() - p.y;
140
                p.y = e.getY() - p.y;
140
                SwingUtilities.convertPointToScreen (p, e.getComponent ());
141
                SwingUtilities.convertPointToScreen (p, e.getComponent ());
141
                Dimension popupSize = popupMenu.getPreferredSize ();
142
                Dimension popupSize = popupMenu.getPreferredSize ();
142
                Dimension screenSize = Toolkit.getDefaultToolkit ().getScreenSize ();
143
                Rectangle screenBounds = Utilities.getUsableScreenBounds(getGraphicsConfiguration());
143
                if (p.x + popupSize.width > screenSize.width) p.x = screenSize.width - popupSize.width;
144
                if (p.x + popupSize.width > screenBounds.x + screenBounds.width)
144
                if (p.y + popupSize.height > screenSize.height) p.y = screenSize.height - popupSize.height;
145
                    p.x = screenBounds.x + screenBounds.width - popupSize.width;
146
                if (p.y + popupSize.height > screenBounds.y + screenBounds.height)
147
                    p.y = screenBounds.y + screenBounds.height - popupSize.height;
145
                SwingUtilities.convertPointFromScreen (p, e.getComponent ());
148
                SwingUtilities.convertPointFromScreen (p, e.getComponent ());
146
                popupMenu.show(e.getComponent (), p.x, p.y);
149
                popupMenu.show(e.getComponent (), p.x, p.y);
147
            }
150
            }
(-)openide/src/org/openide/explorer/view/TreeView.java (-3 / +6 lines)
Lines 38-43 Link Here
38
import org.openide.util.Lookup;
38
import org.openide.util.Lookup;
39
import org.openide.util.RequestProcessor;
39
import org.openide.util.RequestProcessor;
40
import org.openide.util.WeakListener;
40
import org.openide.util.WeakListener;
41
import org.openide.util.Utilities;
41
import org.openide.util.actions.CallbackSystemAction;
42
import org.openide.util.actions.CallbackSystemAction;
42
import org.openide.util.actions.SystemAction;
43
import org.openide.util.actions.SystemAction;
43
import org.openide.util.actions.ActionPerformer;
44
import org.openide.util.actions.ActionPerformer;
Lines 837-845 Link Here
837
            
838
            
838
            SwingUtilities.convertPointToScreen (p, TreeView.this);
839
            SwingUtilities.convertPointToScreen (p, TreeView.this);
839
            Dimension popupSize = popup.getPreferredSize ();
840
            Dimension popupSize = popup.getPreferredSize ();
840
            Dimension screenSize = Toolkit.getDefaultToolkit ().getScreenSize ();
841
            Rectangle screenBounds = Utilities.getUsableScreenBounds(getGraphicsConfiguration());
841
            if (p.x + popupSize.width > screenSize.width) p.x = screenSize.width - popupSize.width;
842
            if (p.x + popupSize.width > screenBounds.x + screenBounds.width)
842
            if (p.y + popupSize.height > screenSize.height) p.y = screenSize.height - popupSize.height;
843
                p.x = screenBounds.x + screenBounds.width - popupSize.width;
844
            if (p.y + popupSize.height > screenBounds.y + screenBounds.height)
845
                p.y = screenBounds.y + screenBounds.height - popupSize.height;
843
            SwingUtilities.convertPointFromScreen (p, TreeView.this);
846
            SwingUtilities.convertPointFromScreen (p, TreeView.this);
844
            popup.show(TreeView.this, p.x, p.y);
847
            popup.show(TreeView.this, p.x, p.y);
845
        }
848
        }
(-)openide/src/org/openide/nodes/IndexedCustomizer.java (-3 / +2 lines)
Lines 240-248 Link Here
240
        //dropSupport = new IndexedDropTarget(this, dragSupport);
240
        //dropSupport = new IndexedDropTarget(this, dragSupport);
241
        if (closeButton) {
241
        if (closeButton) {
242
        pack();
242
        pack();
243
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
243
        setBounds(org.openide.util.Utilities.getCenterBounds(getSize()));
244
        Dimension dialogSize = getSize();
244
                  
245
        setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
246
        buttonClose.requestFocus (); // to get shortcuts to work
245
        buttonClose.requestFocus (); // to get shortcuts to work
247
        
246
        
248
        buttonClose.getAccessibleContext().setAccessibleDescription(Node.getString("ACSD_Button_close"));
247
        buttonClose.getAccessibleContext().setAccessibleDescription(Node.getString("ACSD_Button_close"));
(-)openide/src/org/openide/util/Utilities.java (-2 / +147 lines)
Lines 41-46 Link Here
41
import java.util.HashSet;
41
import java.util.HashSet;
42
import org.openide.util.enum.SingletonEnumeration;
42
import org.openide.util.enum.SingletonEnumeration;
43
43
44
import org.openide.modules.Dependency;
45
import org.openide.modules.SpecificationVersion;
46
44
/** Otherwise uncategorized useful static methods.
47
/** Otherwise uncategorized useful static methods.
45
*
48
*
46
* @author Jan Palka, Ian Formanek, Jaroslav Tulach
49
* @author Jan Palka, Ian Formanek, Jaroslav Tulach
Lines 1332-1342 Link Here
1332
        return m;
1335
        return m;
1333
    }
1336
    }
1334
1337
1338
    /**
1339
     * Finds out the monitor where the user currently has the input focus.
1340
     * This method is usually used to help the client code to figure out on
1341
     * which monitor it should place newly created windows/frames/dialogs.
1342
     * 
1343
     * @return the GraphicsConfiguration of the monitor which currently has the
1344
     * input focus
1345
     *
1346
     * @since 2.5
1347
     */
1348
    public static GraphicsConfiguration getCurrentGraphicsConfiguration() {
1349
        Frame[] frames = Frame.getFrames();
1350
1351
        for (int i = 0; i < frames.length; i++) {
1352
            if (javax.swing.SwingUtilities.findFocusOwner(frames[i]) != null) {
1353
                return frames[i].getGraphicsConfiguration();
1354
            }
1355
        }
1356
        return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
1357
    }
1358
    
1359
    /**
1360
     * Returns the usable area of the screen where applications can place its
1361
     * windows.  The method subtracts from the screen the area of taskbars,
1362
     * system menus and the like.
1363
     * 
1364
     * @param gconf the GraphicsConfiguration of the monitor
1365
     * @return the rectangle of the screen where one can place windows
1366
     * 
1367
     * @since 2.5
1368
     */
1369
    public static Rectangle getUsableScreenBounds(GraphicsConfiguration gconf) {
1370
        if (gconf == null)
1371
            gconf = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
1372
1373
        Rectangle bounds = new Rectangle(gconf.getBounds());
1374
        
1375
        String str;
1376
1377
        str = System.getProperty("netbeans.screen.insets"); // NOI18N
1378
        if (str != null) {
1379
            StringTokenizer st = new StringTokenizer(str, ", "); // NOI18N
1380
            if (st.countTokens() == 4) {
1381
                try {
1382
                    bounds.y = Integer.parseInt(st.nextToken());
1383
                    bounds.x = Integer.parseInt(st.nextToken());
1384
                    bounds.height -= bounds.y + Integer.parseInt(st.nextToken());
1385
                    bounds.width -= bounds.x + Integer.parseInt(st.nextToken());
1386
                }
1387
                catch (NumberFormatException ex) {
1388
                    ErrorManager.getDefault().notify(ErrorManager.WARNING, ex);
1389
                }
1390
            }
1391
            return bounds;
1392
        }
1393
        
1394
        str = System.getProperty("netbeans.taskbar.height"); // NOI18N
1395
        if (str != null) {
1396
            bounds.height -= Integer.getInteger(str, 0).intValue();
1397
            return bounds;
1398
        }
1399
1400
        // if JDK 1.4 or later
1401
1402
        if (Dependency.JAVA_SPEC.compareTo(new SpecificationVersion("1.4")) >= 0) { // NOI18N
1403
            try {
1404
                Toolkit toolkit = Toolkit.getDefaultToolkit();
1405
                Method m = Toolkit.class.getMethod("getScreenInsets", // NOI18N
1406
                                                   new Class[] { GraphicsConfiguration.class });
1407
                if (m == null)
1408
                    return bounds;
1409
                
1410
                Insets insets = (Insets) m.invoke(toolkit, new Object[] { gconf });
1411
                bounds.y += insets.top;
1412
                bounds.x += insets.left;
1413
                bounds.height -= insets.top + insets.bottom;
1414
                bounds.width -= insets.left + insets.right;
1415
            }
1416
            catch (Exception ex) {
1417
                ErrorManager.getDefault().notify(ErrorManager.WARNING, ex);
1418
            }
1419
            return bounds;
1420
        }
1421
        
1422
        if (Utilities.isWindows ()) {
1423
            bounds.height -= Utilities.TYPICAL_WINDOWS_TASKBAR_HEIGHT;
1424
            return bounds;
1425
        }
1426
1427
        if ((getOperatingSystem() & OS_MAC) != 0) {
1428
            bounds.height -= TYPICAL_MACOSX_MENU_HEIGHT;
1429
            return bounds;
1430
        }
1431
1432
        return bounds;
1433
    }
1434
1435
    /**
1436
     * Helps client code place components on the center of the screen.  It
1437
     * handles multiple monitor configuration correctly
1438
     *
1439
     * @param componentSize the size of the component
1440
     * @return bounds of the centered component
1441
     *
1442
     * @since 2.5
1443
     */
1444
    public static Rectangle getCenterBounds(Dimension componentSize) {
1445
        return getCenterBounds(getCurrentGraphicsConfiguration(),
1446
                               componentSize);
1447
    }
1448
1449
    /**
1450
     * Helps client code place components on the center of the screen.  It
1451
     * handles multiple monitor configuration correctly
1452
     *
1453
     * @param gconf the GraphicsConfiguration of the monitor
1454
     * @param componentSize the size of the component
1455
     * @return bounds of the centered component
1456
     *
1457
     * @since 2.5
1458
     */
1459
    public static Rectangle getCenterBounds(GraphicsConfiguration gconf,
1460
                                            Dimension componentSize) {
1461
        if (gconf == null)
1462
            gconf = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
1463
1464
        Rectangle bounds = gconf.getBounds();
1465
        return new Rectangle(bounds.x + (bounds.width - componentSize.width) / 2,
1466
                             bounds.y + (bounds.height - componentSize.height) / 2,
1467
                             componentSize.width,
1468
                             componentSize.height);
1469
    }
1470
    
1335
    /** @return size of the screen. The size is modified for Windows OS
1471
    /** @return size of the screen. The size is modified for Windows OS
1336
     * - some pointes are subtracted to reflect a presence of the taskbar
1472
     * - some pointes are subtracted to reflect a presence of the taskbar
1473
     *
1474
     * @deprecated this method is almost useless in multiple monitor configuration
1475
     * 
1476
     * @see #getCurrentGraphicsConfiguration
1477
     * @see #getUsableScreenBounds(GraphicsConfiguration)
1478
     * @see #getCenterBounds(Dimension)
1479
     * @see #getCenterBounds(GraphicsConfiguration, Dimension)
1337
     */
1480
     */
1338
    public static final Dimension getScreenSize() {
1481
    public static final Dimension getScreenSize() {
1339
        Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
1482
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
1483
        
1340
        if (isWindows() && !Boolean.getBoolean ("netbeans.no.taskbar")) {
1484
        if (isWindows() && !Boolean.getBoolean ("netbeans.no.taskbar")) {
1341
            screenSize.height -= TYPICAL_WINDOWS_TASKBAR_HEIGHT;
1485
            screenSize.height -= TYPICAL_WINDOWS_TASKBAR_HEIGHT;
1342
        } else if ((getOperatingSystem() & OS_MAC) != 0)
1486
        } else if ((getOperatingSystem() & OS_MAC) != 0)
Lines 1382-1388 Link Here
1382
        contentPane.add(chooser, BorderLayout.CENTER);
1526
        contentPane.add(chooser, BorderLayout.CENTER);
1383
 
1527
 
1384
        dialog.pack();
1528
        dialog.pack();
1385
        dialog.setLocationRelativeTo(parent);
1529
        dialog.setBounds(getCenterBounds(parent.getGraphicsConfiguration(),
1530
                                         dialog.getSize()));
1386
1531
1387
	chooser.rescanCurrentDirectory();
1532
	chooser.rescanCurrentDirectory();
1388
        final int[] retValue = new int[] { javax.swing.JFileChooser.CANCEL_OPTION };
1533
        final int[] retValue = new int[] { javax.swing.JFileChooser.CANCEL_OPTION };
(-)properties/manifest.mf (-1 / +1 lines)
Lines 3-9 Link Here
3
OpenIDE-Module-Specification-Version: 1.8
3
OpenIDE-Module-Specification-Version: 1.8
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-Layer: org/netbeans/modules/properties/Layer.xml
5
OpenIDE-Module-Layer: org/netbeans/modules/properties/Layer.xml
6
OpenIDE-Module-IDE-Dependencies: IDE/1 > 1.24
6
OpenIDE-Module-IDE-Dependencies: IDE/1 > 2.4
7
7
8
Name: org/netbeans/modules/properties/PropertiesDataLoader.class
8
Name: org/netbeans/modules/properties/PropertiesDataLoader.class
9
OpenIDE-Module-Class: Loader
9
OpenIDE-Module-Class: Loader
(-)properties/src/org/netbeans/modules/properties/BundleEditPanel.java (-1 / +3 lines)
Lines 657-663 Link Here
657
         * minimal width of column is 1/10 of screen width. */
657
         * minimal width of column is 1/10 of screen width. */
658
        private void adjustColumnWidths() {
658
        private void adjustColumnWidths() {
659
            // The least initial width of column (1/10 of screen witdh).
659
            // The least initial width of column (1/10 of screen witdh).
660
            int columnWidth = Toolkit.getDefaultToolkit().getScreenSize().width/10;
660
            Rectangle screenBounds = org.openide.util.Utilities.getUsableScreenBounds(
661
                org.openide.util.Utilities.getCurrentGraphicsConfiguration());
662
            int columnWidth = screenBounds.width / 10;
661
            
663
            
662
            // Try to set widths according parent (viewport) width.
664
            // Try to set widths according parent (viewport) width.
663
            int totalWidth = 0;
665
            int totalWidth = 0;
(-)vcscore/manifest.mf (-1 / +1 lines)
Lines 4-10 Link Here
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
4
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-Layer: org/netbeans/modules/vcscore/resources/mf-layer.xml
5
OpenIDE-Module-Layer: org/netbeans/modules/vcscore/resources/mf-layer.xml
6
OpenIDE-Module-Install: org/netbeans/modules/vcscore/VcsCoreModuleInstall.class
6
OpenIDE-Module-Install: org/netbeans/modules/vcscore/VcsCoreModuleInstall.class
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 1.28
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 2.4
8
OpenIDE-Module-Module-Dependencies: org.openidex.util/2, org.netbeans.modules.editor/1 > 1.7
8
OpenIDE-Module-Module-Dependencies: org.openidex.util/2, org.netbeans.modules.editor/1 > 1.7
9
OpenIDE-Module-Package-Dependencies: org.apache.regexp[RE]
9
OpenIDE-Module-Package-Dependencies: org.apache.regexp[RE]
10
10
(-)vcscore/src/org/netbeans/modules/vcscore/util/VcsUtilities.java (-3 / +1 lines)
Lines 462-470 Link Here
462
462
463
    //-------------------------------------------
463
    //-------------------------------------------
464
    public static void centerWindow (Window w) {
464
    public static void centerWindow (Window w) {
465
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
465
        w.setBounds(org.openide.util.Utilities.getCenterBounds(w.getSize()));
466
        Dimension dialogSize = w.getSize();
467
        w.setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
468
    }
466
    }
469
467
470
    public static boolean deleteRecursive (File dir) {
468
    public static boolean deleteRecursive (File dir) {
(-)vcsgeneric/manifest.mf (-1 / +1 lines)
Lines 3-9 Link Here
3
OpenIDE-Module-Install: org/netbeans/modules/vcs/advanced/CommandLineVcsModule.class
3
OpenIDE-Module-Install: org/netbeans/modules/vcs/advanced/CommandLineVcsModule.class
4
OpenIDE-Module-Specification-Version: 1.6
4
OpenIDE-Module-Specification-Version: 1.6
5
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
5
OpenIDE-Module-Implementation-Version: @BUILD_NUMBER_SUBST@
6
OpenIDE-Module-IDE-Dependencies: IDE/1 > 1.24
6
OpenIDE-Module-IDE-Dependencies: IDE/1 > 2.4
7
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.vcscore/1
7
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.vcscore/1
8
OpenIDE-Module-Layer: org/netbeans/modules/vcs/advanced/config/mf-layer.xml
8
OpenIDE-Module-Layer: org/netbeans/modules/vcs/advanced/config/mf-layer.xml
9
OpenIDE-Module-Package-Dependencies: org.apache.regexp[RE]
9
OpenIDE-Module-Package-Dependencies: org.apache.regexp[RE]
(-)vcsgeneric/src/org/netbeans/modules/vcs/advanced/VcsCustomizer.java (-1 / +4 lines)
Lines 1627-1633 Link Here
1627
        gridBagConstraints1.gridy = 1;
1627
        gridBagConstraints1.gridy = 1;
1628
        panel.add (advancedPanel, gridBagConstraints1);
1628
        panel.add (advancedPanel, gridBagConstraints1);
1629
1629
1630
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
1630
        Rectangle screenBounds = org.openide.util.Utilities.getUsableScreenBounds(
1631
            org.openide.util.Utilities.getCurrentGraphicsConfiguration());
1632
        Dimension screenSize = screenBounds.getSize();
1633
        
1631
        screenSize.setSize((int) (screenSize.width*ADVANCED_DLG_WIDTH_RELATIVE),
1634
        screenSize.setSize((int) (screenSize.width*ADVANCED_DLG_WIDTH_RELATIVE),
1632
                           variablePanel.getPreferredSize().height+advancedPanel.getPreferredSize().height+16);
1635
                           variablePanel.getPreferredSize().height+advancedPanel.getPreferredSize().height+16);
1633
        panel.setPreferredSize(screenSize);
1636
        panel.setPreferredSize(screenSize);
(-)web/advanced/src/org/netbeans/modules/web/dd/DDChangesPanel.java (-4 / +1 lines)
Lines 87-96 Link Here
87
    }
87
    }
88
    
88
    
89
    public java.awt.Dimension getPreferredSize () {
89
    public java.awt.Dimension getPreferredSize () {
90
        java.awt.Dimension size = super.getPreferredSize ();
90
        return new java.awt.Dimension(600, 400);
91
        size.width = Math.max (600, Math.min (size.width, java.awt.Toolkit.getDefaultToolkit ().getScreenSize ().width - 200));
92
        size.height = Math.max (300, Math.min (size.height, java.awt.Toolkit.getDefaultToolkit ().getScreenSize ().width - 200));
93
        return size;
94
    }
91
    }
95
    
92
    
96
    synchronized void setChanges (List changes) {
93
    synchronized void setChanges (List changes) {

Return to bug 20882