Revision 38608 branches/v2_0_0_prep/libraries/libCorePlugin/src/org/gvsig/coreplugin/mdiManager/NewSkin.java

View differences:

NewSkin.java
147 147
    private Cursor lastCursor = null;
148 148
	private ImageIcon image;
149 149
	private String typeDesktop;
150

  
151
	private int alignCounter = 1;
150 152
	
151 153
	//Anyade barras de scroll
152 154
	private void addScrolledDesktopPanel( JFrame parent, MyDesktopPane desktopPane) {
......
410 412
        int visibleWidth = contentPane.getWidth() - contentPane.getX(); // The last substraction is for if there is any menu,... at left
411 413
        int visibleHeight = contentPane.getHeight() - newStatusBar.getHeight() - contentPane.getY() - Math.abs(jDesktopPane.getY() - contentPane.getY()); // The last substraction is for if there is any menu,... at top
412 414

  
413
//        -------------------------------------------------
414
//        |FIRST_LINE_START   PAGE_START     FIRST_LINE_END|
415
//        |                                                |
416
//        |                                                |
417
//        |LINE_START           CENTER             LINE_END|
418
//        |                                                |
419
//        |                                                |
420
//        |LAST_LINE_START     PAGE_END       LAST_LINE_END|
421
//        -------------------------------------------------
422
        
415
//        ---------------------------------------------------------------
416
//        |FIRST_LINE_START(23)   PAGE_START(19)     FIRST_LINE_END(24) |
417
//        |                                                             |
418
//        |                                                             |
419
//        |LINE_START(21)           CENTER(10)              LINE_END(22)|
420
//        |                                                             |
421
//        |                                                             |
422
//        |LAST_LINE_START(25)     PAGE_END(20)       LAST_LINE_END(26) |
423
//        ---------------------------------------------------------------
424
    	
423 425
        switch (mode) {
424
        case GridBagConstraints.FIRST_LINE_START:
426
        case ALIGN_FIRST_LINE_START:
425 427
            newReferencePoint.x = DefaultXMargin;
426 428
            newReferencePoint.y = DefaultYMargin;
427 429
            break;
428 430
        
429
        case GridBagConstraints.PAGE_START:
431
        case ALIGN_PAGE_START:
430 432
            newReferencePoint.x = visibleWidth / 2;
431 433
            newReferencePoint.y = DefaultYMargin;
432 434
            break;
433 435
        
434
        case GridBagConstraints.FIRST_LINE_END:
436
        case ALIGN_FIRST_LINE_END:
435 437
            newReferencePoint.x = visibleWidth - window.getWidth() - DefaultXMargin;
436 438
            newReferencePoint.y = DefaultYMargin;
437 439
            break;
438 440
        
439
        case GridBagConstraints.LINE_START:
441
        case ALIGN_FIRST_LINE_END_CASCADE:
442
            newReferencePoint.x = visibleWidth - window.getWidth() - (int)(DefaultXMargin + (DefaultXMargin*1.5*this.alignCounter));
443
            newReferencePoint.y = DefaultYMargin + (int)(DefaultYMargin*1.5*this.alignCounter);
444
            if( ++this.alignCounter >5 ) {
445
            	this.alignCounter = 0;
446
            }
447
            break;
448
        
449
        case ALIGN_LINE_START:
440 450
            newReferencePoint.x = DefaultXMargin;
441 451
            newReferencePoint.y = visibleHeight / 2;
442 452
            break;
443 453
        
444
        case GridBagConstraints.LINE_END:
454
        case ALIGN_LINE_END:
445 455
            newReferencePoint.x = visibleWidth - window.getWidth() - DefaultXMargin;
446 456
            newReferencePoint.y = visibleHeight / 2;
447 457
            break;
448 458
        
449
        case GridBagConstraints.LAST_LINE_START:
459
        case ALIGN_LAST_LINE_START:
450 460
            newReferencePoint.x = DefaultXMargin;
451 461
            newReferencePoint.y = visibleHeight - window.getHeight() - DefaultYMargin;
452 462
            break;
453 463
        
454
        case GridBagConstraints.PAGE_END:
464
        case ALIGN_PAGE_END:
455 465
            newReferencePoint.x = visibleWidth / 2;
456 466
            newReferencePoint.y = visibleHeight - window.getHeight() - DefaultYMargin;
457 467
            break;
458 468
        
459
        case GridBagConstraints.LAST_LINE_END:
469
        case ALIGN_LAST_LINE_END:
460 470
            newReferencePoint.x = visibleWidth - window.getWidth() - DefaultXMargin;
461 471
            newReferencePoint.y = visibleHeight - window.getHeight() - DefaultYMargin;
462 472
            break;
463 473
        
464 474
        default:
465
        case GridBagConstraints.CENTER:
475
        case ALIGN_CENTER:
466 476
            newReferencePoint.x = visibleWidth / 2;
467 477
            newReferencePoint.y = visibleHeight / 2;
468 478
            break;

Also available in: Unified diff