org.omegahat.Graphics.Primitives
Interface GraphicalComponentInt

All Known Subinterfaces:
AxisInt, GraphicalContainerInt
All Known Implementing Classes:
GraphicalObject

public interface GraphicalComponentInt

General abstraction of a graphical component that can be added to a plot as an element in the hierarchy. All such an object need support is the ability to draw itself and provide accessors to set and get its GraphicsParameters.


Method Summary
 Region draw(RectRegion rr, ScaleInt sx, ScaleInt sy, int origin, double widthCM, double heightCM, int fontSize, OutputDevice od, GraphicalContainerInt parentId)
          Renders itself (and any children it has as a GraphicalContainerInt within the region it occupies on the device computed by computing its RegionDescriptionInt relative to the parents absolute dimensions, font size (in points), horizontal and vertical scales and using the device to delegate calls to primitive drawing facilities.
 GraphicsParameters getParameters()
           
 RegionDescriptionInt getRegion()
           
 boolean isActive()
          Query whether this component can have events generated for it.
 boolean isVisible()
          Allows us to query if the component is to be drawn.
 SimpleGraphicalContainerInt parent()
          Retrieve the parent of this component, if it has one.
 SimpleGraphicalContainerInt parent(SimpleGraphicalContainerInt p)
           
 java.util.List parents()
          If the component is contained in two or more graphical containers, this returns a list of all the parents.
 boolean setActive(boolean val)
          Sets the interactive status of the object, allowing one to inhibit it from having events generated for it.
 void setParameters(GraphicsParameters p)
           
 RegionDescriptionInt setRegion(RegionDescriptionInt r)
           
 boolean setVisible(boolean val)
          Set the visibility status of the component, indicating whether it should be drawn or not.
 

Method Detail

setRegion

public RegionDescriptionInt setRegion(RegionDescriptionInt r)

getRegion

public RegionDescriptionInt getRegion()

draw

public Region draw(RectRegion rr,
                   ScaleInt sx,
                   ScaleInt sy,
                   int origin,
                   double widthCM,
                   double heightCM,
                   int fontSize,
                   OutputDevice od,
                   GraphicalContainerInt parentId)
            throws DrawChildException
Renders itself (and any children it has as a GraphicalContainerInt within the region it occupies on the device computed by computing its RegionDescriptionInt relative to the parents absolute dimensions, font size (in points), horizontal and vertical scales and using the device to delegate calls to primitive drawing facilities.
Parameters:
rr - the parents RectRegion in normalized device coordinates (NDC).
sx - the parent's horizontal scale for transforming between arbitrary units.
sy - the parent's vertical scale for transforming between arbitrary units.
origin - the parent's origin position.

parent

public SimpleGraphicalContainerInt parent()
Retrieve the parent of this component, if it has one. If the component is in two or more containers, this returns the default parent.

parent

public SimpleGraphicalContainerInt parent(SimpleGraphicalContainerInt p)

parents

public java.util.List parents()
If the component is contained in two or more graphical containers, this returns a list of all the parents.

setParameters

public void setParameters(GraphicsParameters p)

getParameters

public GraphicsParameters getParameters()

setVisible

public boolean setVisible(boolean val)
Set the visibility status of the component, indicating whether it should be drawn or not. Returns the previous value, allowing it to be easily restored. The container can loop over the children, drawing only the active values, or alternatively, temporarily moving the non-active objects from the collection of children to a holding area whose contents are not drawn but remembered.

isVisible

public boolean isVisible()
Allows us to query if the component is to be drawn.

setActive

public boolean setActive(boolean val)
Sets the interactive status of the object, allowing one to inhibit it from having events generated for it. Returns the previous setting of this status.

isActive

public boolean isActive()
Query whether this component can have events generated for it.