|
S-PLUS Connect/Java v1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.insightful.gdevice.SCanvasAWT
An SCanvasAWT object saves and draws S-PLUS graphics commands. It implements only pre-Swing functionality.
Field Summary | |
protected Color |
m_bgColor
|
protected int |
m_bgColorA
|
protected int |
m_bgColorB
|
protected int |
m_bgColorG
|
protected int |
m_bgColorR
|
protected int |
m_clearCount
The number of clears performed on this canvas. |
protected boolean |
m_hasEmbeddedFileData
|
protected String |
m_tag
Tag string for canvas page, or XML with tag and other elements |
protected String |
m_title
Title of canvas page. |
static int |
SPLUS_DISPLAY_HEIGHT
S-PLUS graphsheet height. |
static int |
SPLUS_DISPLAY_WIDTH
S-PLUS graphsheet width. |
Constructor Summary | |
SCanvasAWT()
Constructs an SCanvasAWT object. |
Method Summary | |
void |
add(com.insightful.gdevice.SGraphCommand cmd)
Adds an SGraphCommand to this SCanvas. |
void |
add(Vector vec)
Adds a set of SGraphCommand objects to this SCanvas. |
void |
clear()
Clears this SCanvas. |
void |
clearBackgroundRGBA()
|
void |
clearEmbeddedFileData()
|
static SCanvasAWT |
createErrorCanvas(String errorString)
|
static SCanvasAWT |
createFromXML(XMLElement elt,
IDHash idHash)
|
SCanvas |
createSCanvas()
Create an SCanvas with the same properties as this SCanvasAWT. |
SCanvasAWT |
createSCanvasAWT()
|
Color |
getAltBackgroundColor()
|
ColorScheme |
getAltColorScheme()
|
Color |
getBackgroundColor()
Returns the current background color. |
Dimension |
getBestFitSize(Dimension maxSize)
|
int |
getClearCount()
Gets the number of clears done on this canvas. |
boolean |
getClipIdentify()
|
ColorScheme |
getColorScheme()
Returns the color scheme for this SCanvas. |
boolean |
getDebug()
|
URL |
getDocumentBase()
|
int |
getHeight()
Returns the height of the S-PLUS graphsheet being viewed. |
SCanvasHit |
getHit(int x,
int y)
|
SCanvasHit |
getHit(Point pt)
|
Color |
getImageColor(int index)
Returns the specified image color from the current color scheme. |
IndexColorModel |
getImageIndexColorModel()
|
IndexColorModel |
getImageIndexColorModel(byte[] r,
byte[] g,
byte[] b,
byte[] a)
|
boolean |
getInApplet()
|
String[] |
getIntersectingTags(Rectangle rect)
Returns tags for all active regions the intersect the given rectangle. |
Color |
getLineColor(com.insightful.gdevice.SGraphCommand cmd)
Return color for drawing lines, given color int. |
static Dimension |
getMaxFitSize(Dimension userSize,
Dimension maxSize)
|
int |
getNumberCommands()
Gets the number of graphics commands in the canvas. |
Color |
getPaletteColor(com.insightful.gdevice.SGraphCommand cmd)
Returns the specified palette color from the current color scheme. |
Color |
getPolygonColor(com.insightful.gdevice.SGraphCommand cmd)
Return color for drawing polygons, given color int. |
String |
getPropertyAction()
|
protected ColorScheme |
getRendererColorScheme()
|
String[] |
getSelectedTagArray()
returns an array of the selected region tags. |
com.insightful.gdevice.SGraphCommand |
getSmallestPlotRegionCommand(int x,
int y)
Given mouse coords x,y in the canvas, returns the SGraphCommand with the smallest unique plot region whose plot region contains this point. |
String |
getTag()
Returns the tag string, which uniquely identifies the page. |
Color |
getTextColor(int index)
old version, used to select color for annotations. |
Color |
getTextColor(com.insightful.gdevice.SGraphCommand cmd)
Return color for drawing text, given color int. |
String |
getTitle()
Returns the canvas page title. |
Dimension |
getUserSize()
Returns the user size. |
SCanvasPoint |
getValueFromPoint(int x,
int y)
Given mouse coords x,y in the canvas, returns the x,y values of this point in the coordinate system of the SGraphCommand with the smallest plot region that contains this point. |
SCanvasPoint |
getValueFromPoint(Point pt)
Given mouse coords x,y in the canvas, returns the x,y values of this point in the coordinate system of the SGraphCommand with the smallest plot region that contains this point. |
SCanvasPoint |
getValueFromPoint(com.insightful.gdevice.SGraphCommand cmd,
int x,
int y)
Given an SGraphCommand and mouse coords x,y in the canvas, returns the x,y values of this point in the coordinate system of that cmd. |
SCanvasPoint |
getValueFromPoint(com.insightful.gdevice.SGraphCommand cmd,
Point pt)
Given an SGraphCommand and mouse coords x,y in the canvas, returns the x,y values of this point in the coordinate system of that cmd. |
int |
getWidth()
Returns the width of the S-PLUS graphsheet being viewed. |
void |
graphSizeChanged()
Notifies all graph commands in the canvas that the graph size has changed, and that they might need to recompute cached graphics. |
boolean |
hasEmbeddedFileData()
|
boolean |
isEmpty()
Returns true if this SCanvas contains no graphics. |
void |
loadEmbeddedCanvas(SCanvasAWT canvas)
|
void |
paint(Graphics g)
Paints this SCanvas. |
void |
paint(Graphics g,
int canvasCommandsDrawn)
Paints the commands in this SCanvas, assuming that the first canvasCommandsDrawn graphics commands from the display list have already been drawn. |
void |
paintSelections(Graphics g,
com.insightful.gdevice.TagSet tagset)
Paints highlights for the active regions in this SCanvasAWT that are selected. |
void |
print(Graphics g)
Prints this SCanvas. |
void |
printString(Graphics g,
String txt,
int x,
int y)
print string, using pixelation so it works in applet printing. |
void |
releaseMemory()
|
void |
setAltBackgroundColor(Color col)
|
void |
setAltColorScheme(ColorScheme cs)
|
void |
setBackgroundRGBA(int r,
int g,
int b,
int a)
|
void |
setCanvasTagSet(com.insightful.gdevice.TagSet tagSet)
set TagSet. |
void |
setClipIdentify(boolean val)
set/get flag for whether to clip java.identify regions to plot region. |
void |
setColorScheme(ColorScheme cs)
Sets the color scheme for this SCanvas. |
void |
setDebug(boolean val)
set/get flag for whether to print debugging info. |
void |
setDocumentBase(URL val)
set/get documentBase to be used when resolving URLs in embedded images |
void |
setFromXML(XMLElement elt,
IDHash idHash)
|
void |
setInApplet(boolean val)
set/get flag for whether to print applet info. |
void |
setPropertyAction(String action)
|
void |
setSelectedTagArray(String[] tags)
|
void |
setSize(int width,
int height)
Sets the width and height of the virtual graphsheet. |
void |
setTag(String tag)
Sets the tag string, which uniquely identifies the page. |
void |
setTitle(String title)
Sets the canvas page title. |
void |
setUserSize(Dimension dim)
Sets the user size. |
boolean |
usingPDFColorScheme()
|
void |
writeXML(PrintWriter out,
String colorschemeTag,
Vector uniqueRectCmds)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SPLUS_DISPLAY_WIDTH
public static final int SPLUS_DISPLAY_HEIGHT
protected String m_title
protected String m_tag
protected int m_clearCount
protected transient boolean m_hasEmbeddedFileData
protected int m_bgColorR
protected int m_bgColorG
protected int m_bgColorB
protected int m_bgColorA
protected Color m_bgColor
Constructor Detail |
public SCanvasAWT()
Method Detail |
public String getTitle()
public void setTitle(String title)
public String getTag()
public void setTag(String tag)
public boolean isEmpty()
public void setSize(int width, int height)
public void graphSizeChanged()
public int getWidth()
public int getHeight()
public void add(com.insightful.gdevice.SGraphCommand cmd)
public void add(Vector vec)
vec
- Vector of SGraphCommand objects to add.public int getClearCount()
public int getNumberCommands()
public void clear()
public void paint(Graphics g)
g
- the graphics context.public void paint(Graphics g, int canvasCommandsDrawn)
g
- the graphics context.canvasCommandsDrawn
- the number of commands
from the display list that have already
been painted.public void paintSelections(Graphics g, com.insightful.gdevice.TagSet tagset)
g
- the graphics context.tagset
- list of tags of selected regions.public void print(Graphics g)
public ColorScheme getColorScheme()
public void setColorScheme(ColorScheme cs)
public Color getBackgroundColor()
public Color getPaletteColor(com.insightful.gdevice.SGraphCommand cmd)
ColorScheme.getPaletteColor(int)
public Color getLineColor(com.insightful.gdevice.SGraphCommand cmd)
public Color getTextColor(com.insightful.gdevice.SGraphCommand cmd)
public Color getPolygonColor(com.insightful.gdevice.SGraphCommand cmd)
public Color getTextColor(int index)
public Color getImageColor(int index)
ColorScheme.getImageColor(int)
public IndexColorModel getImageIndexColorModel()
public IndexColorModel getImageIndexColorModel(byte[] r, byte[] g, byte[] b, byte[] a)
public boolean usingPDFColorScheme()
public ColorScheme getAltColorScheme()
public void setAltColorScheme(ColorScheme cs)
protected ColorScheme getRendererColorScheme()
public Color getAltBackgroundColor()
public void setAltBackgroundColor(Color col)
public com.insightful.gdevice.SGraphCommand getSmallestPlotRegionCommand(int x, int y)
public SCanvasPoint getValueFromPoint(Point pt)
public SCanvasPoint getValueFromPoint(int x, int y)
public SCanvasPoint getValueFromPoint(com.insightful.gdevice.SGraphCommand cmd, Point pt)
public SCanvasPoint getValueFromPoint(com.insightful.gdevice.SGraphCommand cmd, int x, int y)
public SCanvasAWT createSCanvasAWT()
public void printString(Graphics g, String txt, int x, int y)
public SCanvasHit getHit(Point pt)
public SCanvasHit getHit(int x, int y)
public String[] getIntersectingTags(Rectangle rect)
public void writeXML(PrintWriter out, String colorschemeTag, Vector uniqueRectCmds)
public static SCanvasAWT createFromXML(XMLElement elt, IDHash idHash)
public void setFromXML(XMLElement elt, IDHash idHash)
public static SCanvasAWT createErrorCanvas(String errorString)
public void setUserSize(Dimension dim)
public Dimension getUserSize()
public Dimension getBestFitSize(Dimension maxSize)
public static Dimension getMaxFitSize(Dimension userSize, Dimension maxSize)
public void setCanvasTagSet(com.insightful.gdevice.TagSet tagSet)
public String[] getSelectedTagArray()
public void setSelectedTagArray(String[] tags)
public SCanvas createSCanvas()
public void setDocumentBase(URL val)
public URL getDocumentBase()
public void setClipIdentify(boolean val)
public boolean getClipIdentify()
public void setDebug(boolean val)
public boolean getDebug()
public void setInApplet(boolean val)
public boolean getInApplet()
public void releaseMemory()
public boolean hasEmbeddedFileData()
public void clearEmbeddedFileData()
public void loadEmbeddedCanvas(SCanvasAWT canvas)
public String getPropertyAction()
public void setPropertyAction(String action)
public void setBackgroundRGBA(int r, int g, int b, int a)
public void clearBackgroundRGBA()
|
S-PLUS Connect/Java v1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |