Revision 9994 trunk/frameworks/_fwAndami/src/com/iver/andami/ui/mdiManager/WindowInfo.java
WindowInfo.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.andami.ui.mdiManager; |
42 | 42 |
|
43 |
import java.awt.Dimension; |
|
43 | 44 |
import java.awt.Rectangle; |
44 | 45 |
import java.beans.PropertyChangeListener; |
45 | 46 |
import java.beans.PropertyChangeSupport; |
... | ... | |
119 | 120 |
private int normalY = 0; |
120 | 121 |
private int normalHeight = -1; |
121 | 122 |
private int normalWidth = -1; |
123 |
|
|
124 |
/** The minimum allowed size for this window. */ |
|
125 |
private Dimension minSize = null; |
|
126 |
|
|
122 | 127 |
/* Whether the window is maximized */ |
123 | 128 |
private boolean isMaximized = false; |
124 | 129 |
private boolean visible = true; |
... | ... | |
221 | 226 |
} |
222 | 227 |
|
223 | 228 |
/** |
224 |
* DOCUMENT ME! |
|
225 |
* |
|
226 |
* @return Returns the y. |
|
229 |
* Gets the value of the y coordinate for the origin of the associated |
|
230 |
* window. |
|
231 |
* |
|
232 |
* @return Returns the y coordinate (in pixels). |
|
227 | 233 |
*/ |
228 | 234 |
public int getY() { |
229 | 235 |
return y; |
230 | 236 |
} |
231 | 237 |
|
232 | 238 |
/** |
233 |
* DOCUMENT ME! |
|
234 |
* |
|
235 |
* @param y The y to set. |
|
239 |
* Sets the value of the y coordinate for the origin of the associated |
|
240 |
* window. |
|
241 |
* |
|
242 |
* @param y The value (in pixels) of the y coordinate |
|
236 | 243 |
*/ |
237 | 244 |
public void setY(int y) { |
238 | 245 |
support.firePropertyChange("y", this.y, y); |
... | ... | |
242 | 249 |
} |
243 | 250 |
|
244 | 251 |
/** |
245 |
* Updates the value of the x coordinate for this WindowInfo
|
|
252 |
* Updates the value of the y coordinate for this WindowInfo
|
|
246 | 253 |
* object. It doesn't get reflected on the window (use |
247 | 254 |
* setY for that). |
248 | 255 |
* |
... | ... | |
291 | 298 |
} |
292 | 299 |
|
293 | 300 |
/** |
294 |
* Obtiene la altura de la vista
|
|
301 |
* Gets the window height.
|
|
295 | 302 |
* |
296 |
* @return |
|
303 |
* @return The window height (in pixels).
|
|
297 | 304 |
*/ |
298 | 305 |
public int getHeight() { |
299 | 306 |
return height; |
300 | 307 |
} |
301 | 308 |
|
302 | 309 |
/** |
303 |
* Obtiene la anchura de la vista
|
|
310 |
* Gets the window width.
|
|
304 | 311 |
* |
305 |
* @return |
|
312 |
* @return The window width (in pixels).
|
|
306 | 313 |
*/ |
307 | 314 |
public int getWidth() { |
308 | 315 |
return width; |
309 | 316 |
} |
310 | 317 |
|
311 | 318 |
/** |
312 |
* establece la propiedad altura
|
|
319 |
* Sets the window height.
|
|
313 | 320 |
* |
314 |
* @param h
|
|
321 |
* @param The window height (in pixels)
|
|
315 | 322 |
*/ |
316 | 323 |
public void setHeight(int height) { |
317 | 324 |
if (height!=-1) |
... | ... | |
459 | 466 |
this.selectedTool = selectedTool; |
460 | 467 |
} |
461 | 468 |
|
462 |
/* Finds out whether a view is open (showing) or closed */ |
|
469 |
/** Finds out whether a view is open (showing) or closed */
|
|
463 | 470 |
public boolean isClosed() { |
464 | 471 |
return isClosed; |
465 | 472 |
} |
466 | 473 |
|
467 |
/* Specifies whether a view is open (showing) or closed */ |
|
474 |
/** Specifies whether a view is open (showing) or closed */
|
|
468 | 475 |
public void setClosed(boolean closed) { |
469 | 476 |
support.firePropertyChange("closed", this.isClosed, closed); |
470 | 477 |
this.isClosed = closed; |
... | ... | |
588 | 595 |
this.normalWidth = normalWidth; |
589 | 596 |
} |
590 | 597 |
} |
598 |
|
|
599 |
/** |
|
600 |
* Sets the minimum allowed size for the associated window. If null is provided, |
|
601 |
* the minimum size is disabled (and thus |
|
602 |
* the window can be resized to any size). |
|
603 |
* |
|
604 |
* @param minSize The minimum allowed size for the associated window. |
|
605 |
*/ |
|
606 |
public void setMinimumSize(Dimension minSize) { |
|
607 |
support.firePropertyChange("minimumSize", this.minSize, minSize); |
|
608 |
this.minSize = minSize; |
|
609 |
} |
|
591 | 610 |
|
592 | 611 |
/** |
612 |
* Updates the minimum allowed size for the associated window. It doesn't |
|
613 |
* get reflected on the window (use <code>setMinimumSize</code> for that). |
|
614 |
* |
|
615 |
* @param minSize The minimum allowed size for the associated window. |
|
616 |
*/ |
|
617 |
public void updateMinimumSize(Dimension minSize) { |
|
618 |
this.minSize = minSize; |
|
619 |
} |
|
620 |
|
|
621 |
/** |
|
622 |
* Gets the minimum allowed size for the associated window. |
|
623 |
* |
|
624 |
* @return minSize The minimum allowed size for the associated window. |
|
625 |
*/ |
|
626 |
public Dimension getMinimumSize() { |
|
627 |
return minSize; |
|
628 |
} |
|
629 |
|
|
630 |
/** |
|
593 | 631 |
* Updates the normalWidth property for this WindowInfo |
594 | 632 |
* object. It doesn't get reflected on the window (use |
595 | 633 |
* <code>setNormalWidth</code> for that). |
... | ... | |
627 | 665 |
this.maximizable = maximizable; |
628 | 666 |
} |
629 | 667 |
|
668 |
/** |
|
669 |
* Sets the bounds of the associated window. |
|
670 |
* |
|
671 |
* @param x |
|
672 |
* @param y |
|
673 |
* @param width |
|
674 |
* @param height |
|
675 |
*/ |
|
630 | 676 |
private void setBounds(int x, int y, int width, int height) { |
631 | 677 |
setX(x); |
632 | 678 |
setY(y); |
... | ... | |
636 | 682 |
|
637 | 683 |
/** |
638 | 684 |
* Updates the bounds for this WindowInfo object. It doesn't get reflected |
639 |
* on the window (use <code>setNormalWidth</code> for that).
|
|
685 |
* on the window (use <code>setBounds</code> for that).
|
|
640 | 686 |
* |
641 | 687 |
* @param x |
642 | 688 |
* @param y |
... | ... | |
656 | 702 |
} |
657 | 703 |
} |
658 | 704 |
|
705 |
/** |
|
706 |
* Sets the normal bounds of the associated window. This sets the bounds |
|
707 |
* that the window would have when it gets restored from the |
|
708 |
* maximized state. |
|
709 |
* |
|
710 |
* @param x |
|
711 |
* @param y |
|
712 |
* @param width |
|
713 |
* @param height |
|
714 |
*/ |
|
659 | 715 |
public void setNormalBounds(int x, int y, int width, int height) { |
660 | 716 |
setNormalX(x); |
661 | 717 |
setNormalY(y); |
... | ... | |
665 | 721 |
|
666 | 722 |
/** |
667 | 723 |
* Updates the normal bounds for this WindowInfo object. It doesn't get |
668 |
* reflected on the window (use <code>setNormalWidth</code> for that).
|
|
724 |
* reflected on the window (use <code>setNormalBounds</code> for that).
|
|
669 | 725 |
* |
670 | 726 |
* @param x |
671 | 727 |
* @param y |
... | ... | |
685 | 741 |
} |
686 | 742 |
} |
687 | 743 |
|
744 |
/** |
|
745 |
* Gets the normal bounds of the associated window. This gets the bounds |
|
746 |
* that the window would have when it gets restored from the |
|
747 |
* maximized state. |
|
748 |
* |
|
749 |
* @return The normal bounds of the associated window. |
|
750 |
*/ |
|
688 | 751 |
public Rectangle getNormalBounds() { |
689 | 752 |
return new Rectangle(getNormalX(), getNormalY(), getNormalWidth(), getNormalHeight()); |
690 | 753 |
} |
691 | 754 |
|
755 |
/** |
|
756 |
* Sets the normal bounds of the associated window. This sets the bounds |
|
757 |
* that the window would have when it gets restored from the |
|
758 |
* maximized state. |
|
759 |
* |
|
760 |
* @param normalBounds |
|
761 |
*/ |
|
692 | 762 |
public void setNormalBounds(Rectangle normalBounds) { |
693 | 763 |
setNormalBounds(normalBounds.x, normalBounds.y, normalBounds.width, normalBounds.height); |
694 | 764 |
} |
695 |
|
|
765 |
|
|
766 |
/** |
|
767 |
* Updates the normal bounds for this WindowInfo object. It doesn't get |
|
768 |
* reflected on the window (use <code>setNormalBounds</code> for that). |
|
769 |
* |
|
770 |
* @param normalBounds |
|
771 |
*/ |
|
696 | 772 |
public void updateNormalBounds(Rectangle normalBounds) { |
697 | 773 |
updateNormalBounds(normalBounds.x, normalBounds.y, normalBounds.width, normalBounds.height); |
698 | 774 |
} |
699 |
|
|
775 |
|
|
776 |
/** |
|
777 |
* Sets the bounds of the associated window. |
|
778 |
* |
|
779 |
* @param bounds |
|
780 |
*/ |
|
700 | 781 |
public void setBounds(Rectangle bounds) { |
701 | 782 |
setBounds(bounds.x, bounds.y, bounds.width, bounds.height); |
702 | 783 |
} |
703 | 784 |
|
785 |
/** |
|
786 |
* Updates the bounds for this WindowInfo object. It doesn't get reflected |
|
787 |
* on the window (use <code>setBounds</code> for that). |
|
788 |
* |
|
789 |
* @param bounds |
|
790 |
*/ |
|
704 | 791 |
public void updateBounds(Rectangle bounds) { |
705 | 792 |
updateBounds(bounds.x, bounds.y, bounds.width, bounds.height); |
706 | 793 |
} |
707 | 794 |
|
795 |
/** |
|
796 |
* Gets the bounds of the associated window. |
|
797 |
* |
|
798 |
* @return The bounds of the associated window. |
|
799 |
*/ |
|
708 | 800 |
public Rectangle getBounds() { |
709 | 801 |
return new Rectangle(x, y, width, height); |
710 | 802 |
} |
Also available in: Unified diff