Class RootView
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class RootView

public class netscape.application.RootView
    extends netscape.application.View
    implements netscape.application.EventProcessor,
               netscape.application.ExtendedTarget
{
    /* Constructors
     */
    public RootView();
    public RootView(Rect);
    public RootView(int, int, int, int);

    /* Methods
     */
    public boolean canBecomeSelectedView();
    public boolean canPerformCommand(String);
    public Color color();
    public ColorChooser colorChooser();
    public int cursor();
    public View defaultSelectedView(); *Beta API*
    public void draw(Graphics, Rect);
    public synchronized void drawDirtyViews();
    public void drawView(Graphics);
    public ExternalWindow externalWindow();
    public View focusedView();
    public FontChooser fontChooser();
    public Image image();
    public int imageDisplayStyle();
    public Vector internalWindows();
    public boolean isTransparent();
    public boolean isVisible();
    public InternalWindow mainWindow();
    public boolean mouseDown(MouseEvent);
    public Point mousePoint();
    public View mouseView();
    public FoundationPanel panel();
    public void performCommand(String, Object);
    public void processEvent(Event);
    public void redraw(Rect);
    public void removeOverrideCursor();
    public synchronized void resetDirtyViews();
    public RootView rootView();
    public void selectView(View, boolean); *Beta API*
    public void selectViewAfter(View); *Beta API*
    public void selectViewBefore(View); *Beta API*
    public void setColor(Color);
    public void setDefaultSelectedView(View); *Beta API*
    public void setFocusedView(View);
    public void setImage(Image);
    public void setImageDisplayStyle(int);
    public void setMouseView(View);
    public void setOverrideCursor(int);
    public void showColorChooser();
    public void showFontChooser();
    public void updateCursor();
    public void updateCursorLater();
    public View viewForMouse(int, int);
}
View subclass that functions as the top level View of the Applet frame or ExternalWindow. It displays a Color and/or an Image (tiled, centered, or scaled). All other Applet Views and InternalWindows are descendants of the RootView.

You will rarely need to work with your Applet's RootView. You will never instantiate a RootView directly.


Constructors

RootView

  public RootView()
Constructs a RootView with origin (0, 0) and zero width and height.

RootView

  public RootView(Rect rect)
Constructs a RootView with bounds rect.

RootView

  public RootView(int x,
                  int y,
                  int width,
                  int height)
Constructs a RootView with bounds (x, y, width, height)

Methods

internalWindows

  public Vector internalWindows()
Returns the Vector containing all InternalWindows currently displayed in the RootView. Do not modify this Vector.

mainWindow

  public InternalWindow mainWindow()
Returns the Application's main InternalWindow. The main InternalWindow represents the InternalWindow the user is currently working with, and displays its title bar differently than all other InternalWindows. The IFC passes key Events to the View in the main InternalWindow that has requested to receive them.
See Also:
InternalWindow

setMouseView

  public void setMouseView(View aView)
If called after a MOUSE_DOWN or MOUSE_DRAGGED Event, forces all subsequent MOUSE_DRAGGED Events and the MOUSE_UP Event to go to aView.

mouseView

  public View mouseView()
Returns the View currently receiving MOUSE_DRAGGED or MOUSE_UP Events.
See Also:
setMouseView

viewForMouse

  public View viewForMouse(int x,
                           int y)
Returns the View under point (x, y).
Overrides:
viewForMouse in class View

isVisible

  public boolean isVisible()
Returns true if the RootView is visible.

cursor

  public int cursor()
Returns the current cursor.
See Also:
cursorForPoint, setOverrideCursor

setOverrideCursor

  public void setOverrideCursor(int cursorIdent)
Forces the RootView's currently displayed cursor to the cursor identified by cursorIdent, regardless of the cursor requested by the View currently under the mouse. To return the cursor to what it should be, call removeOverrideCursor().

You will almost never call this method - instead, your View subclasses will override their cursorForPoint() method to return the correct cursor for that point within the View.

See Also:
cursorForPoint, removeOverrideCursor

removeOverrideCursor

  public void removeOverrideCursor()
Removes the override cursor, returning the cursor to the cursor requested by the View currently under the mouse.
See Also:
setOverrideCursor

updateCursor

  public void updateCursor()
Forces the RootView to immediately compute and set the cursor based on the View under the mouse.

updateCursorLater

  public void updateCursorLater()
Forces the RootView to recompute the current cursor upon reaching the top of the EventLoop.

showColorChooser

  public void showColorChooser()
Makes the ColorChooser visible.
See Also:
ColorChooser

colorChooser

  public ColorChooser colorChooser()
Returns a reference to the shared ColorChooser.
See Also:
ColorChooser

showFontChooser

  public void showFontChooser()
Makes the FontChooser visible.
See Also:
FontChooser

fontChooser

  public FontChooser fontChooser()
Returns a reference to the shared FontChooser.
See Also:
FontChooser

externalWindow

  public ExternalWindow externalWindow()
Returns the RootView's ExternalWindow, if any.

processEvent

  public void processEvent(Event event)
Processes the various Events directed at the RootView. You should never call this method.

setFocusedView

  public void setFocusedView(View view)
Directs all key Events to view.
Overrides:
setFocusedView in class View

focusedView

  public View focusedView()
Returns the View set to receive all key Events.
See Also:
setFocusedView

performCommand

  public void performCommand(String command,
                             Object data)
Implements the RootView's commands:

canPerformCommand

  public boolean canPerformCommand(String command)
Returns true for the commands that the RootView can perform.
See Also:
performCommand

setColor

  public void setColor(Color aColor)
Sets the RootView's Color.

color

  public Color color()
Returns the RootView's Color.
See Also:
setColor

setImage

  public void setImage(Image anImage)
Sets the RootView's Image.
See Also:
setImageDisplayStyle

image

  public Image image()
Returns the RootView's Image.
See Also:
setImage

setImageDisplayStyle

  public void setImageDisplayStyle(int aStyle)
Sets the style the RootView uses to display its Image (Image.CENTERED, Image.TILED, or Image.SCALED).

imageDisplayStyle

  public int imageDisplayStyle()
Returns the style the RootView uses to display its Image.
See Also:
setImageDisplayStyle

isTransparent

  public boolean isTransparent()
Returns false - RootViews are not transparent.
Overrides:
isTransparent in class View

drawView

  public void drawView(Graphics g)
Draws the RootView's contents.
Overrides:
drawView in class View

draw

  public void draw(Graphics g,
                   Rect aRect)
Overridden to draw just the aRect portion of the RootView, ignoring any Windows that may intersect the Rect. To draw everything within a given Rect, call redraw().
Overrides:
draw in class View
See Also:
redraw

redraw

  public void redraw(Rect aRect)
Similar to draw(), except that it draws everything intersecting the Rect aRect (RootView and InternalWindows).

resetDirtyViews

  public synchronized void resetDirtyViews()
Marks all of the RootView's dirty subviews as clean, without drawing them.

drawDirtyViews

  public synchronized void drawDirtyViews()
Draws all of the RootView's dirty subviews. This method is called automatically after the EventLoop processes an Event.

mouseDown

  public boolean mouseDown(MouseEvent event)
Overridden to prevent mouse Events from being sent to the RootView. Returns false.
Overrides:
mouseDown in class View

rootView

  public RootView rootView()
Overridden to return this View.
Overrides:
rootView in class View

panel

  public FoundationPanel panel()
Returns the FoundationPanel the RootView is being displayed in.

mousePoint

  public Point mousePoint()
Returns a newly-allocated Point containing the mouse's last known location, in the RootView's coordinate system.

setDefaultSelectedView

  public void setDefaultSelectedView(View aView) *Beta API* 
Set the default selected view

defaultSelectedView

  public View defaultSelectedView() *Beta API* 
Returns the default selected view

selectView

  public void selectView(View newSelectedView,
                         boolean abortCurrentEditing) *Beta API* 
Ask the receiving RootView to make newSelectedView the selected view for keyboard UI. If changeFocus is true, the rootview will abort any editing to select the view. This method does nothing if keyboard UI is not active.

selectViewAfter

  public void selectViewAfter(View aView) *Beta API* 
Ask the receiving RootView to make the view following aView to become selected.

selectViewBefore

  public void selectViewBefore(View aView) *Beta API* 
Ask the receiving RootView to make the view before aView to become selected.

canBecomeSelectedView

  public boolean canBecomeSelectedView()
Return whether this view can become the selected view when the user is moving from view to views with the keyboard The default implementation returns false.
Overrides:
canBecomeSelectedView in class View

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Copyright © 1997 Netscape Communications Corporation. All rights reserved
Please send any comments or corrections to ifcfeedback@netscape.com
HTML generated on 21 Apr 1997