home *** CD-ROM | disk | FTP | other *** search
- package netscape.application;
-
- import java.awt.Component;
-
- public class AWTComponentView extends View {
- Component component;
- RootView rootView;
-
- public AWTComponentView() {
- this(0, 0, 0, 0);
- }
-
- public AWTComponentView(Rect var1) {
- this(var1.x, var1.y, var1.width, var1.height);
- }
-
- public AWTComponentView(int var1, int var2, int var3, int var4) {
- super(var1, var2, var3, var4);
- }
-
- void setComponentBounds() {
- Rect var1 = super._superview.convertRectToView((View)null, super.bounds);
- this.component.reshape(var1.x, var1.y, var1.width, var1.height);
- }
-
- void addComponent() {
- if (this.rootView != null) {
- this.rootView.addComponentView(this);
- }
-
- }
-
- void removeComponent() {
- if (this.component != null && this.rootView != null) {
- this.rootView.removeComponentView(this);
- }
-
- }
-
- public void setAWTComponent(Component var1) {
- this.removeComponent();
- this.component = var1;
- this.addComponent();
- }
-
- public Component awtComponent() {
- return this.component;
- }
-
- protected void ancestorWillRemoveFromViewHierarchy(View var1) {
- this.removeComponent();
- this.rootView = null;
- }
-
- protected void ancestorWasAddedToViewHierarchy(View var1) {
- this.rootView = ((View)this).rootView();
- this.addComponent();
- }
- }
-