Revision 25519 branches/v2_0_0_prep/frameworks/_fwAndami/src/com/iver/andami/ui/mdiManager/WindowInfo.java

View differences:

WindowInfo.java
57 57
 * The <code>set</code> methods (<code>setX</code>, <code>setY</code>,
58 58
 * <code>setHeight</code>, etc) are immediately reflected on the
59 59
 * window.
60
 * 
60
 *
61 61
 * The <code>update</code> methods doesn't update the window, because
62 62
 * they are used to update the WindowInfo object when the associated
63 63
 * window was modified by user interaction.
......
106 106
     * JDesktopPane.PALETTE_LAYER
107 107
     */
108 108
    private boolean palette = false;
109
    
109

  
110 110
    private String additionalInfo = null;
111 111

  
112 112
    /** These properties store the dimension and position of the frame */
......
123 123
    private int normalY = 0;
124 124
    private int normalHeight = -1;
125 125
    private int normalWidth = -1;
126
    
126

  
127 127
    /** The minimum allowed size for this window. */
128 128
    private Dimension minSize = null;
129
    
129

  
130 130
    /* Whether the window is maximized */
131 131
    private boolean isMaximized = false;
132 132
    private boolean visible = true;
......
178 178
     * <li>WindowInfo.ICONIFIABLE</li>
179 179
     * <li>WindowInfo.RESIZABLE</li>
180 180
     * <li>WindowInfo.MAXIMIZABLE</li>
181
     * 
181
     *
182 182
     * <p>Properties can be set together by using the binary OR operator
183 183
     * "<b>|</b>". For example:</p>
184
     * 
185
     * <p><code>WindowInfo wi = new WindowInfo(WindowInfo.MODELESSDIALOG 
184
     *
185
     * <p><code>WindowInfo wi = new WindowInfo(WindowInfo.MODELESSDIALOG
186 186
     *   |WindowInfo.ICONIFIABLE|WindowInfo.RESIZABLE).</code></p>
187
     *   
187
     *
188 188
     * <p>The WindowInfo.MODELESSDIALOG and WindowInfo.MODALDIALOG properties
189
     * cannot be set at the same time</p> 
189
     * cannot be set at the same time</p>
190 190
     *
191 191
     * @param code Bit-or of the window properties.
192 192
     *
......
226 226
    public WindowInfo(){
227 227

  
228 228
    }
229
    
229

  
230 230
    /**
231 231
     * Returns the current x coordinate of the window's origin
232 232
     * (left-upper corner of the window).
......
250 250
    	if (!isMaximized)
251 251
    		this.normalX = x;
252 252
    }
253
    
253

  
254 254
    /**
255 255
     * Updates the value of the x coordinate for this WindowInfo
256 256
     * object. It doesn't get reflected on the window (use
257 257
     * setX for that).
258
     * 
258
     *
259 259
     * @param x The value (in pixels) of the x coordinate
260 260
     */
261 261
    public void updateX(int x) {
......
268 268
     * Gets the value of the y coordinate for the origin
269 269
     * (left-upper corner of the window) of the associated
270 270
     * window.
271
     * 
271
     *
272 272
     * @return Returns the y coordinate (in pixels).
273 273
     */
274 274
    public int getY() {
......
279 279
     * Sets the value of the y coordinate for the origin
280 280
     * (left-upper corner of the window) of the associated
281 281
     * window.
282
     * 
282
     *
283 283
     * @param y The value (in pixels) of the y coordinate
284 284
     */
285 285
    public void setY(int y) {
......
288 288
        if (!isMaximized)
289 289
        	this.normalY = y;
290 290
    }
291
    
291

  
292 292
    /**
293 293
     * Updates the value of the y coordinate for this WindowInfo
294 294
     * object. It doesn't get reflected on the window (use
295 295
     * setY for that).
296
     * 
296
     *
297 297
     * @param y The value (in pixels) of the y coordinate
298 298
     */
299 299
    public void updateY(int y) {
......
368 368
        if (!isMaximized)
369 369
        	this.normalHeight = height;
370 370
    }
371
    
371

  
372 372
    /**
373 373
     * Updates the height property for this WindowInfo
374 374
     * object. It doesn't get reflected on the window (use
375 375
     * <code>setHeight</code> for that).
376
     * 
376
     *
377 377
     * @param height The height value for this WindowInfo object
378 378
     */
379 379
    public void updateHeight(int height) {
......
394 394
        if (!isMaximized)
395 395
        	this.normalWidth = w;
396 396
    }
397
    
397

  
398 398
    /**
399 399
     * Updates the width property for for this WindowInfo
400 400
     * object. It doesn't get reflected on the window (use
401 401
     * <code>setWidth</code> for that).
402
     * 
402
     *
403 403
     * @param height The height value for this WindowInfo object
404 404
     */
405 405
    public void updateWidth(int width) {
......
426 426
    	support.firePropertyChange("title", this.title, title);
427 427
        this.title = title;
428 428
    }
429
    
429

  
430 430
    /**
431 431
     * Updates the title property for for this WindowInfo
432 432
     * object. It doesn't get reflected on the window (use
433 433
     * <code>setTitle</code> for that).
434
     * 
434
     *
435 435
     * @param title The title value for this WindowInfo object
436 436
     */
437 437
    public void updateTitle(String title) {
......
472 472

  
473 473
    /**
474 474
     * Sets the window's ID.
475
     * 
475
     *
476 476
     * @param id An integer to identify the window. Different
477 477
     * windows must have different IDs.
478 478
     */
......
482 482

  
483 483
    /**
484 484
     * Gets the window ID.
485
     * 
485
     *
486 486
     * @return id An integer to identify the window. Different
487 487
     * windows must have different IDs.
488 488
     */
......
495 495
     * they match the properties of the provided
496 496
     * <code>wi</code> object. The changes are not reflected on the
497 497
     * window, just the WindowInfo object is updated.
498
     * 
498
     *
499 499
     * @param vi A WindowInfo object containing the new
500 500
     * properties of the window.
501 501
     */
......
525 525
    	this.isClosed = vi.isClosed;
526 526
    	this.persistWindow = vi.persistWindow;
527 527
    }
528
    
528

  
529 529
    /**
530
     * Sets whether the window is in palette mode or is in docked mode. 
530
     * Sets whether the window is in palette mode or is in docked mode.
531 531
     * This method <b>does not</b> update the window status, it just
532 532
     * updates the WindowInfo object. Use the IWindowTransform interface
533 533
     * to actually change the window status.
534
     * 
534
     *
535 535
     * @param b
536 536
     */
537 537
    public void toPalette(boolean b){
......
540 540

  
541 541
    /**
542 542
     * Gets the list of selected tools for this window.
543
     * 
543
     *
544 544
     * @return A HashMap containing pairs (group, actionCommand), which
545
     * are the selected tools for this window. 
545
     * are the selected tools for this window.
546 546
     */
547 547
    public HashMap getSelectedTools() {
548 548
        return selectedTools;
549 549
    }
550 550

  
551 551
    /**
552
     * Use {@link setSelectedTools(HashMap selectedTool)} 
553
     * 
552
     * Use {@link setSelectedTools(HashMap selectedTool)}
553
     *
554 554
     * @param selectedTool
555 555
     * @deprecated
556 556
     */
......
558 558
        if (selectedTool != null)
559 559
            selectedTools.put(defaultGroup ,selectedTool);
560 560
    }
561
    
561

  
562 562
    /**
563 563
     * Sets the list of selected tools for this window.
564 564

  
565 565
     * @param selectedTools  A HashMap containing pairs
566 566
     * (group, actionCommand), which will be set as the selected tools
567
     * for this window. 
567
     * for this window.
568 568
     */
569 569
    public void setSelectedTools(HashMap selectedTools) {
570 570
        if (selectedTools != null)
......
586 586
     * Updates the closed property for this WindowInfo
587 587
     * object. It doesn't get reflected on the window (use
588 588
     * <code>setClosed</code> for that).
589
     * 
589
     *
590 590
     * @param closed The new closed property for this WindowInfo object
591 591
     */
592 592
    public void updateClosed(boolean closed) {
593 593
    	this.isClosed = closed;
594 594
    }
595
    
595

  
596 596
    /**
597 597
     * Sets the normalX property for this WindowInfo object. This sets the X
598 598
     * position that the window would have when it gets restored from the
599 599
     * maximized state.
600
     * 
600
     *
601 601
     * @param normalX The new normalX property for this WindowInfo object
602 602
     */
603 603
    public void setNormalX(int normalX) {
......
609 609
    		this.normalX = normalX;
610 610
    	}
611 611
    }
612
    
612

  
613 613
    /**
614 614
     * Updates the normalX property for this WindowInfo
615 615
     * object. It doesn't get reflected on the window (use
616 616
     * <code>setNormalX</code> for that).
617
     * 
617
     *
618 618
     * @param normalX The new normalX property for this WindowInfo object
619 619
     */
620 620
    public void updateNormalX(int normalX) {
......
627 627
     * Sets the normalY property for this WindowInfo object. This sets the Y
628 628
     * position that the window would have when it gets restored from the
629 629
     * maximized state.
630
     * 
630
     *
631 631
     * @param normalY The new normalY property for this WindowInfo object
632 632
     */
633 633
    public void setNormalY(int normalY) {
......
639 639
    		this.normalY = normalY;
640 640
    	}
641 641
    }
642
    
642

  
643 643
    /**
644 644
     * Updates the normalY property for this WindowInfo
645 645
     * object. It doesn't get reflected on the window (use
646 646
     * <code>setNormalY</code> for that).
647
     * 
647
     *
648 648
     * @param normalY The new normalY property for this WindowInfo object
649 649
     */
650 650
    public void updateNormalY(int normalY) {
......
657 657
     * Sets the normalHeight property for this WindowInfo object. This sets the height
658 658
     * position that the window would have when it gets restored from the
659 659
     * maximized state.
660
     * 
660
     *
661 661
     * @param normalY The new normalHeight property for this WindowInfo object
662 662
     */
663 663
    public void setNormalHeight(int normalHeight) {
......
669 669
    		this.normalHeight = normalHeight;
670 670
    	}
671 671
    }
672
    
672

  
673 673
    /**
674 674
     * Updates the normalHeight property for this WindowInfo
675 675
     * object. It doesn't get reflected on the window (use
676 676
     * <code>setNormalHeight</code> for that).
677
     * 
677
     *
678 678
     * @param normalHeight The new normalHeight property for this WindowInfo object
679 679
     */
680 680
    public void updateNormalHeight(int normalHeight) {
......
688 688
     * Sets the normalWidth property for this WindowInfo object. This sets the width
689 689
     * position that the window would have when it gets restored from the
690 690
     * maximized state.
691
     * 
691
     *
692 692
     * @param normalY The new normalWidth property for this WindowInfo object
693 693
     */
694 694
    public void setNormalWidth(int normalWidth) {
......
700 700
    		this.normalWidth = normalWidth;
701 701
    	}
702 702
    }
703
    
703

  
704 704
    /**
705 705
     * Sets the minimum allowed size for the associated window. If null is provided,
706 706
     * the minimum size is disabled (and thus
707 707
     * the window can be resized to any size).
708
     * 
708
     *
709 709
     * @param minSize The minimum allowed size for the associated window.
710 710
     */
711 711
    public void setMinimumSize(Dimension minSize) {
......
716 716
    /**
717 717
     * Updates the minimum allowed size for the associated window. It doesn't
718 718
     * get reflected on the window (use <code>setMinimumSize</code> for that).
719
     * 
719
     *
720 720
     * @param minSize The minimum allowed size for the associated window.
721 721
     */
722 722
    public void updateMinimumSize(Dimension minSize) {
723 723
    	this.minSize = minSize;
724 724
    }
725
    
725

  
726 726
    /**
727 727
     * Gets the minimum allowed size for the associated window.
728
     * 
728
     *
729 729
     * @return minSize The minimum allowed size for the associated window.
730 730
     */
731 731
    public Dimension getMinimumSize() {
732 732
    	return minSize;
733 733
    }
734
    
734

  
735 735
    /**
736 736
     * Updates the normalWidth property for this WindowInfo
737 737
     * object. It doesn't get reflected on the window (use
738 738
     * <code>setNormalWidth</code> for that).
739
     * 
739
     *
740 740
     * @param normalWidth The new normalHeight property for this WindowInfo object
741 741
     */
742 742
    public void updateNormalWidth(int normalWidth) {
......
747 747

  
748 748
    /**
749 749
     * Maximize the associated window
750
     * 
750
     *
751 751
     * @param maximized
752 752
     */
753 753
    public void setMaximized(boolean maximized) {
754 754
    	support.firePropertyChange("maximized", this.isMaximized, maximized);
755 755
    	this.isMaximized = maximized;
756 756
    }
757
    
757

  
758 758
    /**
759 759
     * Updates the maximized property for this WindowInfo
760 760
     * object. It doesn't get reflected on the window (use
761 761
     * <code>setMaximized</code> for that).
762
     * 
762
     *
763 763
     * @param maximized The new maximized property for this WindowInfo object
764 764
     */
765 765
    public void updateMaximized(boolean maximized) {
......
772 772

  
773 773
    /**
774 774
     * Sets the bounds of the associated window.
775
     * 
775
     *
776 776
     * @param x
777 777
     * @param y
778 778
     * @param width
......
784 784
    	setWidth(width);
785 785
    	setHeight(height);
786 786
    }
787
    
787

  
788 788
    /**
789 789
     * Updates the bounds for this WindowInfo object. It doesn't get reflected
790 790
     * on the window (use <code>setBounds</code> for that).
791
     * 
791
     *
792 792
     * @param x
793 793
     * @param y
794 794
     * @param width
......
811 811
     * Sets the normal bounds of the associated window. This sets the bounds
812 812
     * that the window would have when it gets restored from the
813 813
     * maximized state.
814
     * 
814
     *
815 815
     * @param x
816 816
     * @param y
817 817
     * @param width
......
823 823
    	setNormalWidth(width);
824 824
    	setNormalHeight(height);
825 825
    }
826
    
826

  
827 827
    /**
828 828
     * Updates the normal bounds for this WindowInfo object. It doesn't get
829 829
     * reflected on the window (use <code>setNormalBounds</code> for that).
830
     * 
830
     *
831 831
     * @param x
832 832
     * @param y
833 833
     * @param width
......
850 850
     * Gets the normal bounds of the associated window. This gets the bounds
851 851
     * that the window would have when it gets restored from the
852 852
     * maximized state.
853
     * 
853
     *
854 854
     * @return The normal bounds of the associated window.
855 855
     */
856 856
    public Rectangle getNormalBounds() {
......
861 861
     * Sets the normal bounds of the associated window. This sets the bounds
862 862
     * that the window would have when it gets restored from the
863 863
     * maximized state.
864
     * 
864
     *
865 865
     * @param normalBounds
866 866
     */
867 867
    public void setNormalBounds(Rectangle normalBounds) {
868 868
    	setNormalBounds(normalBounds.x, normalBounds.y, normalBounds.width, normalBounds.height);
869 869
    }
870
 
870

  
871 871
    /**
872 872
     * Updates the normal bounds for this WindowInfo object. It doesn't get
873 873
     * reflected on the window (use <code>setNormalBounds</code> for that).
874
     * 
874
     *
875 875
     * @param normalBounds
876 876
     */
877 877
    public void updateNormalBounds(Rectangle normalBounds) {
878 878
    	updateNormalBounds(normalBounds.x, normalBounds.y, normalBounds.width, normalBounds.height);
879 879
    }
880
    
880

  
881 881
    /**
882 882
     * Sets the bounds of the associated window.
883
     * 
883
     *
884 884
     * @param bounds
885 885
     */
886 886
    public void setBounds(Rectangle bounds) {
887 887
    	setBounds(bounds.x, bounds.y, bounds.width, bounds.height);
888 888
    }
889
    
889

  
890 890
    /**
891 891
     * Updates the bounds for this WindowInfo object. It doesn't get reflected
892 892
     * on the window (use <code>setBounds</code> for that).
893
     * 
893
     *
894 894
     * @param bounds
895 895
     */
896 896
    public void updateBounds(Rectangle bounds) {
......
899 899

  
900 900
    /**
901 901
     * Gets the bounds of the associated window.
902
     * 
902
     *
903 903
     * @return The bounds of the associated window.
904 904
     */
905 905
    public Rectangle getBounds() {
......
917 917
     * Gets the x coordinate of the window's origin when the window is not
918 918
     * maximized. When the window is maximized, gets the y coordinate that
919 919
     * it will have when it gets restored
920
     * 
920
     *
921 921
     * @return the normal y coordinate of the window's origin
922 922
     */
923 923
    public int getNormalY() {
......
931 931
     * Gets the height of the window's origin when the window is not
932 932
     * maximized. When the window is maximized, gets the height that
933 933
     * it will have when it gets restored
934
     * 
934
     *
935 935
     * @return the normal height of the window
936 936
     */
937 937
    public int getNormalHeight() {
......
945 945
     * Gets the width of the window's origin when the window is not
946 946
     * maximized. When the window is maximized, gets the width that
947 947
     * it will have when it gets restored
948
     * 
948
     *
949 949
     * @return the normal width of the window
950 950
     */
951 951
    public int getNormalWidth() {
......
957 957

  
958 958
    /**
959 959
     * Determines whether the window is maximized or not
960
     * 
960
     *
961 961
     * @return true if the window is maximized, false otherwise
962 962
     */
963 963
    public boolean isMaximized() {
......
1011 1011
		xml.putProperty("isModal", this.isModal(), false);
1012 1012
		xml.putProperty("isModeless", this.isModeless(), false);
1013 1013
		xml.putProperty("isClosed", this.isClosed(), false);
1014
		xml.putProperty("ParentName", this.getAdditionalInfo(), false);
1014
		xml.putProperty("AdditionalInfo", this.getAdditionalInfo(), false);
1015 1015
		if (this.isMaximized()==true) {
1016 1016
			xml.putProperty("isMaximized", this.isMaximized(), false);
1017 1017
			xml.putProperty("normalX", this.getNormalX(), false);
......
1025 1025
	/**
1026 1026
	 * Creates a WindowInfo object from an XMLEntity containing the
1027 1027
	 * window properties.
1028
	 *  
1028
	 *
1029 1029
	 * @param xml An XMLEntity object containing the window properties
1030
	 * 
1030
	 *
1031 1031
	 * @return A new WindowInfo object, containing the properties
1032
	 * specified in the XMLEntity parameters 
1032
	 * specified in the XMLEntity parameters
1033 1033
	 */
1034 1034
	public static WindowInfo createFromXMLEntity(XMLEntity xml)
1035 1035
	{
......
1062 1062
	/**
1063 1063
	 * Updates this WindowInfo object according to the properties
1064 1064
	 * provided by the XMLEntity parameter.
1065
	 *  
1065
	 *
1066 1066
	 * @param xml An XMLEntity object containing the window properties
1067 1067
	 */
1068 1068
	public void getPropertiesFromXMLEntity(XMLEntity xml)

Also available in: Unified diff