S-PLUS Connect/Java v1.0

com.insightful.gdevice
Class SCanvas

java.lang.Object
  extended bycom.insightful.gdevice.SCanvasAWT
      extended bycom.insightful.gdevice.SCanvas
All Implemented Interfaces:
Serializable

public class SCanvas
extends SCanvasAWT

An SCanvas is an object that can save and draw Splus graphic commands.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.insightful.gdevice.SCanvasAWT
m_bgColor, m_bgColorA, m_bgColorB, m_bgColorG, m_bgColorR, m_clearCount, m_hasEmbeddedFileData, m_tag, m_title, SPLUS_DISPLAY_HEIGHT, SPLUS_DISPLAY_WIDTH
 
Constructor Summary
SCanvas()
           
 
Method Summary
 void add(com.insightful.gdevice.SGraphCommand cmd)
          Adds an SGraphCommand to this SCanvas.
 void add(Vector vec)
          Add a vector of graph commands to this SCanvas.
 void addCanvasListener(SCanvasListener listen)
           
static SCanvas createSCanvas(SCanvasAWT awtCanvas)
          Create an SCanvas with the same properties as an SCanvasAWT.
 SCanvasAWT getAWT()
           
 int getDeviceNumber()
          Return Splus device number for this canvas.
 SGraphicsDevice getGraphicsDevice()
          Return SGraphicsDevice currently sending graphics commands to this SCanvas, or NULL, if there is no such device.
 void printString(Graphics g, String txt, int x, int y)
          print string using normal drawString.
 float[][] readPen(int maxPoints, com.insightful.gdevice.SGraphCommand cmd)
          Let the user interactively read up to maxPoints points, returning the positions in a float[][] { xvals, yvals } in the coordinate system of the given SGraphCommand.
 void removeCanvasListener(SCanvasListener listen)
           
 void setColorScheme(ColorScheme cs)
          this only sets the color scheme for the SCanvas itself.
 void setGraphicsDevice(SGraphicsDevice graphicsDevice)
          Set SGraphicsDevice currently sending graphics commands to this SCanvas, or NULL, if there is no such device.
 void setNewActiveCanvas(SCanvas newCanvas)
          Set a new canvas to be the active canvas for this canvas' graphics device.
 void setSelectedTagArray(String[] tags)
           
 void setTitle(String title)
          Sets the canvas page title.
 void unlinkGraphicsDevice()
          Unlink any links between this canvas and its graphics device.
 void wrap()
          Send wrap command to everyone interested in this canvas.
 
Methods inherited from class com.insightful.gdevice.SCanvasAWT
clear, clearBackgroundRGBA, clearEmbeddedFileData, createErrorCanvas, createFromXML, createSCanvas, createSCanvasAWT, getAltBackgroundColor, getAltColorScheme, getBackgroundColor, getBestFitSize, getClearCount, getClipIdentify, getColorScheme, getDebug, getDocumentBase, getHeight, getHit, getHit, getImageColor, getImageIndexColorModel, getImageIndexColorModel, getInApplet, getIntersectingTags, getLineColor, getMaxFitSize, getNumberCommands, getPaletteColor, getPolygonColor, getPropertyAction, getRendererColorScheme, getSelectedTagArray, getSmallestPlotRegionCommand, getTag, getTextColor, getTextColor, getTitle, getUserSize, getValueFromPoint, getValueFromPoint, getValueFromPoint, getValueFromPoint, getWidth, graphSizeChanged, hasEmbeddedFileData, isEmpty, loadEmbeddedCanvas, paint, paint, paintSelections, print, releaseMemory, setAltBackgroundColor, setAltColorScheme, setBackgroundRGBA, setCanvasTagSet, setClipIdentify, setDebug, setDocumentBase, setFromXML, setInApplet, setPropertyAction, setSize, setTag, setUserSize, usingPDFColorScheme, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCanvas

public SCanvas()
Method Detail

addCanvasListener

public void addCanvasListener(SCanvasListener listen)

removeCanvasListener

public void removeCanvasListener(SCanvasListener listen)

readPen

public float[][] readPen(int maxPoints,
                         com.insightful.gdevice.SGraphCommand cmd)
Let the user interactively read up to maxPoints points, returning the positions in a float[][] { xvals, yvals } in the coordinate system of the given SGraphCommand.


wrap

public void wrap()
Send wrap command to everyone interested in this canvas.


setTitle

public void setTitle(String title)
Description copied from class: SCanvasAWT
Sets the canvas page title.

Overrides:
setTitle in class SCanvasAWT

add

public void add(com.insightful.gdevice.SGraphCommand cmd)
Adds an SGraphCommand to this SCanvas. If it is an SGraphClear object, clear the SCanvas.

Overrides:
add in class SCanvasAWT

add

public void add(Vector vec)
Add a vector of graph commands to this SCanvas. This vector should not include any SGraphClear commands.

Overrides:
add in class SCanvasAWT
Parameters:
vec - Vector of SGraphCommand objects to add.

setColorScheme

public void setColorScheme(ColorScheme cs)
this only sets the color scheme for the SCanvas itself. you need to explicitly set the colorscheme for the graphics device to have to apply to all canvas for the device.

Overrides:
setColorScheme in class SCanvasAWT

getGraphicsDevice

public SGraphicsDevice getGraphicsDevice()
Return SGraphicsDevice currently sending graphics commands to this SCanvas, or NULL, if there is no such device.


setGraphicsDevice

public void setGraphicsDevice(SGraphicsDevice graphicsDevice)
Set SGraphicsDevice currently sending graphics commands to this SCanvas, or NULL, if there is no such device.


setNewActiveCanvas

public void setNewActiveCanvas(SCanvas newCanvas)
Set a new canvas to be the active canvas for this canvas' graphics device.


unlinkGraphicsDevice

public void unlinkGraphicsDevice()
Unlink any links between this canvas and its graphics device.


getDeviceNumber

public int getDeviceNumber()
Return Splus device number for this canvas. Return 0 if there is none.


getAWT

public SCanvasAWT getAWT()

printString

public void printString(Graphics g,
                        String txt,
                        int x,
                        int y)
print string using normal drawString.

Overrides:
printString in class SCanvasAWT

createSCanvas

public static SCanvas createSCanvas(SCanvasAWT awtCanvas)
Create an SCanvas with the same properties as an SCanvasAWT.


setSelectedTagArray

public void setSelectedTagArray(String[] tags)
Overrides:
setSelectedTagArray in class SCanvasAWT

S-PLUS Connect/Java v1.0

Copyright © 2000, 2002 Insightful Corporation
Warning: Classes not documented in the S-PLUS Programmer's Guide may change in future releases.