717
718 // NOTE: the SWP.windowState field gets updated to the newWindowState
719 // value when the native notification comes to us
720 }
721
722 // ----------------------------------------------------------------------
723 // UTILITY METHODS
724 // ----------------------------------------------------------------------
725
726 /*
727 * Find image to install into Title or into Application icon.
728 * First try icons installed for toplevel. If there is no icon
729 * use default Duke image.
730 * This method shouldn't return null.
731 */
732 private CImage getImageForTarget() {
733 List<Image> icons = target.getIconImages();
734 if (icons == null || icons.size() == 0) {
735 return null;
736 }
737
738 // TODO: need a walk-through to find the best image.
739 // The best mean with higher resolution. Otherwise an icon looks bad.
740 final Image image = icons.get(0);
741 return CImage.getCreator().createFromImage(image);
742 }
743
744 /*
745 * Returns LWWindowPeer associated with this delegate.
746 */
747 @Override
748 public LWWindowPeer getPeer() {
749 return peer;
750 }
751
752 public CPlatformView getContentView() {
753 return contentView;
754 }
755
756 @Override
757 public long getLayerPtr() {
758 return contentView.getWindowLayerPtr();
759 }
760
761 private void validateSurface() {
|
717
718 // NOTE: the SWP.windowState field gets updated to the newWindowState
719 // value when the native notification comes to us
720 }
721
722 // ----------------------------------------------------------------------
723 // UTILITY METHODS
724 // ----------------------------------------------------------------------
725
726 /*
727 * Find image to install into Title or into Application icon.
728 * First try icons installed for toplevel. If there is no icon
729 * use default Duke image.
730 * This method shouldn't return null.
731 */
732 private CImage getImageForTarget() {
733 List<Image> icons = target.getIconImages();
734 if (icons == null || icons.size() == 0) {
735 return null;
736 }
737 return CImage.getCreator().createFromImages(icons);
738 }
739
740 /*
741 * Returns LWWindowPeer associated with this delegate.
742 */
743 @Override
744 public LWWindowPeer getPeer() {
745 return peer;
746 }
747
748 public CPlatformView getContentView() {
749 return contentView;
750 }
751
752 @Override
753 public long getLayerPtr() {
754 return contentView.getWindowLayerPtr();
755 }
756
757 private void validateSurface() {
|