    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class jclass.bwt.JCContainer

    java.lang.Object
       |
       +----java.awt.Component
               |
               +----java.awt.Container
                       |
                       +----java.awt.Panel
                               |
                               +----jclass.bwt.JCContainer

public class JCContainer
extends Panel

The base class for all BWT containers.

Properties

Name | Method
--- | ---
Background | setBackground
Font | setFont
Foreground | setForeground
Insets | setInsets
PreferredSize | setPreferredSize
UserData | setUserData

##

applet
  The parent applet.
dblbuffer_image
  Current double-buffer image.
version

##

JCContainer()
  This creates an empty container.
JCContainer(Applet, String)
  This creates a container which reads parameters from the applet's HTML file.

##

add(Component)
  Adds the specified component to this container, if it is not already a child.
addNotify()
  Creates the Panel's peer.
disable()
  Disables all the container's children.
enable()
  Enables all the container's children.
enable11Events(long)
  For JDK1.1, calls Component.enableEvents (which is final).
fillBackground(Graphics)
  Fills the component with the background color (called by paint).
getAppletContext()
  Gets the container's applet's context.
getComponent(Component)
  Returns the position of the child, or BWTEnum.NOTFOUND.
getComponent(int)
  Gets the child at the specified position.
getConverter()
  Gets the converter used for converting strings to internal values.
getDoubleBufferGraphics()
  Creates a double-buffer image
getPaintRect()
  Returns the area currently being painted, relative to the component's origin.
getParameters()
  Reads the parameter values from the HTML page using the container's applet.
getParameters(Applet)
  Reads the parameter values from the HTML page using the specified applet.
getParameters(Applet, String)
  Reads the parameter values from the file.
getUserData()
  Gets the UserData value.
insets()
  Returns the previously set insets, or the superclass' insets if none have been set.
minimumSize()
  Returns preferredSize().
paint(Graphics)
  Paints all children.
paintInterior(Graphics)
  Called by paint, to allow subclasses to draw before their children are painted.
preferredHeight()
  Gets the subclass' preferred height (default: 100).
preferredSize()
  Returns the preferred size of this container.
preferredWidth()
  Gets the subclass' preferred width (default: 100).
printAll(Graphics)
  Disables double-buffering, and calls Container.printAll
processMouseEvent(MouseEvent)
  Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.
processMouseMotionEvent(MouseEvent)
  Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener objects.
repaint()
  Overrides Component.repaint(), which sometimes doesn't call paint().
repaint(int, int, int, int)
  Repaints part of the component by calling paint directly.
repaint(Rectangle)
  Repaints part of the component by calling paint directly.
reshape(int, int, int, int)
  Reshapes the Container to the specified bounding box.
setConverter(JCConverter)
  Sets the converter to be used for converting strings to internal values.
setCursor(int)
  Sets the cursor in the parent frame.
setInsets(Insets)
  Sets the container's margins.
setPreferredSize(int, int)
  Sets the container's preferred size.
setUserData(Object)
  Sets an application-defined object that can be attached to the container.
updateParent()
  Forces the parent to relayout this container.
validate()
  Validates this Container and all of the components contained within it.

##

version

      public final static String version

applet

      protected transient Applet applet

  The parent applet.

dblbuffer_image

      protected transient Image dblbuffer_image

  Current double-buffer image.

##

JCContainer

      public JCContainer()

  This creates an empty container. No parameters are read from an HTML file.

JCContainer

      public JCContainer(Applet applet,
                         String name)

  This creates a container which reads parameters from the applet's HTML file.

  Parameters:
    applet - the applet whose PARAM tags are to be read
    name - if this is not null, only parameters preceded by this name are read
  See Also:
    getParameter

##

getParameters

      protected void getParameters()

  Reads the parameter values from the HTML page using the container's applet. The values will override those previously set. Subclasses may override this method to set their own values - in this case, the method should first call super.getParameters().

getParameters

      public void getParameters(Applet applet)

  Reads the parameter values from the HTML page using the specified applet. The values will override those previously set.

  See Also:
    getParameter

getParameters

      public void getParameters(Applet applet,
                                String file)

  Reads the parameter values from the file. The values will override those previously set.

  Parameters:
    applet - if not null and in a browser, its documentBase() is used to construct a complete filename if necessary
    file - if an http protocol is not specified (if a ":" is not present), the current working directory is used

setConverter

      public static void setConverter(JCConverter c)

  Sets the converter to be used for converting strings to internal values.

  See Also:
    JCConverter

getConverter

      public static JCConverter getConverter()

  Gets the converter used for converting strings to internal values.

  See Also:
    JCConverter

getUserData

      public Object getUserData()

  Gets the UserData value.

  See Also:
    setUserData

setUserData

      public void setUserData(Object v)

  Sets an application-defined object that can be attached to the container.

add

      public Component add(Component comp)

  Adds the specified component to this container, if it is not already a child.

  Overrides:
    add in class Container

enable

      public synchronized void enable()

  Enables all the container's children.

  Overrides:
    enable in class Component

disable

      public synchronized void disable()

  Disables all the container's children.

  Overrides:
    disable in class Component

repaint

      public synchronized void repaint()

  Overrides Component.repaint(), which sometimes doesn't call paint().

  Overrides:
    repaint in class Component

repaint

      public synchronized void repaint(Rectangle r)

  Repaints part of the component by calling paint directly.

repaint

      public synchronized void repaint(int x,
                                       int y,
                                       int width,
                                       int height)

  Repaints part of the component by calling paint directly.

  Overrides:
    repaint in class Component

updateParent

      public void updateParent()

  Forces the parent to relayout this container.

validate

      public void validate()

  Validates this Container and all of the components contained within it.

  Overrides:
    validate in class Container

enable11Events

      protected void enable11Events(long mask)

  For JDK1.1, calls Component.enableEvents (which is final).

addNotify

      public void addNotify()

  Creates the Panel's peer.

  Overrides:
    addNotify in class Panel

getAppletContext

      public AppletContext getAppletContext()

  Gets the container's applet's context. The applet context lets an applet control the applet's environment which is usually the browser or the applet viewer.

  Returns:
    null if the container is not in an applet or the applet is not in a browser
  See Also:
    getAppletContext

minimumSize

      public Dimension minimumSize()

  Returns preferredSize().

  Overrides:
    minimumSize in class Container

setInsets

      public void setInsets(Insets insets)

  Sets the container's margins. This value may be set from an HTML file using a PARAM tag with a "Insets" name and an Insets value.

  See Also:
    insets, Insets, toInsets

insets

      public Insets insets()

  Returns the previously set insets, or the superclass' insets if none have been set.

  Overrides:
    insets in class Container
  See Also:
    setInsets

preferredWidth

      protected int preferredWidth()

  Gets the subclass' preferred width (default: 100). The subclass should not include the inset sizes in its calculation; these will be added by JCContainer.

preferredHeight

      protected int preferredHeight()

  Gets the subclass' preferred height (default: 100). The subclass should not include the inset sizes in its calculation; these will be added by JCContainer.

setPreferredSize

      public void setPreferredSize(int w,
                                   int h)

  Sets the container's preferred size. If either dimension is set to BWTEnum.NOVALUE, it is calculated by the subclass. This value may be set from an HTML file using a PARAM tag with a "preferredWidth" name and an int value, and/or a "preferredHeight" name and an int value.

  See Also:
    preferredSize, toInt

preferredSize

      public Dimension preferredSize()

  Returns the preferred size of this container. If the app has set the preferred size, it is returned. Otherwise the subclass' preferredWidth and/or preferredHeight method is called.

  Overrides:
    preferredSize in class Container
  See Also:
    setPreferredSize, preferredWidth, preferredHeight

reshape

      public synchronized void reshape(int x,
                                       int y,
                                       int width,
                                       int height)

  Reshapes the Container to the specified bounding box.

  Overrides:
    reshape in class Component

setCursor

      public void setCursor(int cursor)

  Sets the cursor in the parent frame.

getComponent

      public Component getComponent(int pos)

  Gets the child at the specified position.

  Overrides:
    getComponent in class Container

getComponent

      public int getComponent(Component comp)

  Returns the position of the child, or BWTEnum.NOTFOUND.

getDoubleBufferGraphics

      protected synchronized Graphics getDoubleBufferGraphics()

  Creates a double-buffer image

  Returns:
    the Graphics instance for the image

paintInterior

      public synchronized void paintInterior(Graphics gc)

  Called by paint, to allow subclasses to draw before their children are painted.

fillBackground

      protected void fillBackground(Graphics gc)

  Fills the component with the background color (called by paint).

getPaintRect

      public Rectangle getPaintRect()

  Returns the area currently being painted, relative to the component's origin.

  Returns:
    null if no area is being drawn
  See Also:
    paint

paint

      public void paint(Graphics gc)

  Paints all children.

  Overrides:
    paint in class Container

printAll

      public void printAll(Graphics gc)

  Disables double-buffering, and calls Container.printAll

  Overrides:
    printAll in class Component

processMouseEvent

      protected void processMouseEvent(MouseEvent mouse_ev)

  Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.

  Overrides:
    processMouseEvent in class Component

processMouseMotionEvent

      protected void processMouseMotionEvent(MouseEvent mouse_ev)

  Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener objects.

  Overrides:
    processMouseMotionEvent in class Component

    All Packages  Class Hierarchy  This Package  Previous  Next  Index