8. Methods
This chapter describes the Perspective methods in the TDG.Perspective class. Each method is defined in the following format: |
This section describes the operation of the method. |
This section identifies the method coding syntax. |
This section defines the input parameters to the method. Most methods are overloaded and may be called with several different combinations of input parameters. |
This section defines the method's return values (if any). |
This section shows example code that can be used to call this method. Most code samples show Java code created by a Java Development Environment. Some samples show HTML code. |
Where possible, this section shows a graphical representation of the chart before and/or after the code sample was executed. |
This section provides additional information about using the method. |
This section identifies other methods and properties that interact with the method. |
An object ID identifies a sub-element in a chart that you can color, display, and, in general, individually apply attributes to. The object IDs are particularly useful for HTML development. Many of the methods described in this chapter require an object ID as an input parameter. The following methods can be used to obtain the object ID of different objects in a chart. |
Method Name |
Chart Object |
||
IdentObj |
getAreaRiser() |
Area Riser |
|
IdentObj |
getAreaRiserBottom() |
Base of area riser |
|
IdentObj |
getAreaRiserTop() |
Top of area riser |
|
IdentObj |
getBackgrnd() |
Background |
|
IdentObj |
getBarRiser() |
Bar riser |
|
IdentObj |
getBarRiserBottom() |
Base of bar riser |
|
IdentObj |
getBarRiserSide() |
Side of bar riser |
|
IdentObj |
getCubeFloor() |
3D cube floor |
|
IdentObj |
getCubeFloorGridX() |
3D cube flow X-axis grid lines |
|
IdentObj |
getCubeFloorGridZ() |
3D cube flow Z-axis grid lines |
|
IdentObj |
getCubeLeftWall() |
3D cube left wall |
|
IdentObj |
getCubeLeftWallGridY() |
3D cube left wall Y-axis grid lines |
|
IdentObj |
getCubeLeftWallGridZ() |
3D cube left wall z-axis grid lines |
|
IdentObj |
getCubeRightWall() |
3D cube right wall |
|
IdentObj |
getCubeRightWallGridX() |
3D cube right wall x-axis grid lines |
|
IdentObj |
getCubeRightWallGridY() |
3D cube right wall y-axis grid lines |
|
IdentObj |
getCubeRiserFace() |
3D cube riser face |
|
IdentObj |
getCubeRiserGridX() |
3D cube riser x-axis grid lines |
|
IdentObj |
getCubeRiserGridY() |
3D cube riser y-axis grid lines |
|
IdentObj |
getCubeRiserGridZ() |
3D cube riser z-axis grid lines |
|
IdentObj |
getDataText() |
Data text |
|
IdentObj |
getFootnote() |
Chart footnote |
|
IdentObj |
getFrame() |
Chart frame |
|
IdentObj |
getFrameBottom() |
Base of chart frame |
|
IdentObj |
getFrameSeparator() |
Chart fram separator |
|
IdentObj |
getFrameSide() |
Side of chart frame |
|
IdentObj |
getGroup( int nGroup ) |
Group "nGroup" |
|
IdentObj |
getHistogramRiser() |
Riser in a historgram chart |
|
IdentObj |
getLegendArea() |
Legend area |
|
IdentObj |
getLegendMarker() |
Legend marker |
|
IdentObj |
getLegendText() |
Legend text |
|
IdentObj |
getLineMarker() |
Line marker |
|
IdentObj |
getLineRiser() |
Riser in a line chart |
|
IdentObj |
getLineRiserSide() |
Side of riser in a line chart |
|
IdentObj |
getLineRiserTop() |
Top of riser in a line chart |
|
IdentObj |
getO1Axis() |
O1 Axis |
|
IdentObj |
getO1AxisLine() |
O1 Axis line |
|
IdentObj |
getO1Label() |
O1 Axis label |
|
IdentObj |
getO1MajorGrid() |
O1 Major Grid line |
|
IdentObj |
getO1MinorGrid() |
O1 Minor Grid lines |
|
IdentObj |
getO1Title() |
O1 Axis title |
|
IdentObj |
getO2Label() |
O2 Axis label |
|
IdentObj |
getO2Title() |
O2 Axis title |
|
IdentObj |
getPieFeelerLine() |
Feeler line in a pie chart |
|
IdentObj |
getPieFrame() |
Chart frame in a pie chart |
|
IdentObj |
getPieLabel() |
Label in a pie chart |
|
IdentObj |
getPieRingLabel() |
Label in a pie ring chart |
|
IdentObj |
getPieSliceLabel() |
Slice label in a pie chart |
|
IdentObj |
getSeries( int nSeries ) |
Series "nSeries" |
|
IdentObj |
getSeriesGroup( int nSeries, int nGroup ) |
Series "nSeries", Group "nGroup" |
|
IdentObj |
getSlice() |
Slice in a pie chart |
|
IdentObj |
getSliceCrust() |
Slice crust in a pie chart |
|
IdentObj |
getSlideRing() |
Ring in a pie ring chart |
|
IdentObj |
getStock52WeekHighLine() |
52-week high line in a stock chart |
|
IdentObj |
getStock52WeekLowLine() |
52-week low line in a stock chart |
|
IdentObj |
getStockCloseTick() |
Close tick in a stock chart |
|
IbentObj |
getStockFallingRiser() |
Falling riser in a candle stock chart |
|
IdentObj |
getStockHighLine() |
High line in a candle stock chart |
|
IdentObj |
getStockLowerRiser() |
Lower riser in a stock chart |
|
IdentObj |
getStockLowLine() |
Low line in a candle stock chart |
|
IdentObj |
getStockMALine() |
Median line in a stock chart |
|
IdentObj |
getStockOpenTick() |
Open tick in a stock chart |
|
IdentObj |
getStockRiser() |
Riser in a stock chart |
|
IdentObj |
getStockRisingRiser |
Rising riser in a candle stock chart |
|
IdentObj |
getStockVolumeRiser() |
Volume riser in a stock chart |
|
IdentObj |
getSubtitle() |
Chart subtitle |
|
IdentObj |
getTitle() |
Chart title |
|
IdentObj |
getX1Axis() |
X1 Axis |
|
IdentObj |
getX1AxisLine() |
X1 Axis line |
|
IdentObj |
getX1Label() |
X1 Axis label |
|
IdentObj |
getX1MajorGrid() |
X1 Axis major grid lines |
|
IdentObj |
getX1MinorGrid() |
X1 Axis minor grid lines |
|
IdentObj |
getX1Title() |
X1 Axis title |
|
IdentObj |
getX1ZeroLine() |
X1 Axis zero line |
|
IdentObj |
getY1Axis() |
Y1 Axis |
|
IdentObj |
getY1AxisLine() |
Y1 Axis line |
|
IdentObj |
getY1Label() |
Y1 Axis label |
|
IdentObj |
getY1MajorGrid() |
Y1 Axis major grid lines |
|
IdentObj |
getY1MinorGrid() |
Y1 Axis minor grid lines |
|
IdentObj |
getY1Title() |
Y1 Axis title |
|
IdentObj |
getY1ZeroLine() |
Y1 Axis zero line |
|
IdentObj |
getY2Axis() |
Y2 Axis |
|
IdentObj |
getY2AxisLine() |
Y2 Axis line |
|
IdentObj |
getY2Label() |
Y2 Axis label |
|
IdentObj |
getY2MajorGrid() |
Y2 Axis major grid lines |
|
IdentObj |
getY2MinorGrid() |
Y2 Axis minor grid lines |
|
IdentObj |
getY2Title() |
Y2 Axis title |
|
IdentObj |
getY2ZeroLine() |
Y2 Axis zero line |
/* |
This method is the TDG.Perspective class constructor. It creates an instance of Perspective. |
public class Perspective ( ); public class Perspective ( Applet a ); public class PerspectiveBase ( ); |
a : Applet (optional) |
class |
/* |
Add/RemovePerspectiveListener()
These methods add and remove a Perspective Listener. In the Java environment, a listener is an object that has defined the listener interface for a specific event (in this case, a Perspective event such as the user interface to the chart). |
public static final synchronized void addPerspectiveListener ( public removePerspectiveListener ( TDGListener ); |
listener : |
None |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.Perspective; public class Applet1 extends Applet { public void init() { setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(17); perspective1.setData(0,0,10); perspective1.setData(0,1,11); perspective1.setData(0,2,12); perspective1.setData(0,3,13); perspective1.setBounds(0,0,300,200); add(perspective1); SymMouse aSymMouse = new SymMouse(); perspective1.addMouseListener(aSymMouse); SymTDG lSymTDG = new SymTDG(); perspective1.addPerspectiveListener(lSymTDG); } TDG.Perspective perspective1; class SymMouse extends java.awt.event.MouseAdapter { public void mouseClicked(java.awt.event.MouseEvent event) { Object object = event.getSource(); if (object == perspective1) perspective1_mouseClicked(event); } |
This method directs the product licensing information to SysOut. |
public static void announceLicense (); |
None |
None |
This method clears all data and labels from a chart. |
public void clearDataStorage (); |
None |
None |
/* |
This method sets the focus factor of a cube in a 3D graph. |
public void focusCube ( |
focusFactor = 15000...75000 |
None |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.Perspective; public class Applet1 extends Applet { public void init() { setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setGraphType(2); perspective1.setViewing3DAnglePreset(-1); perspective1.focusCube(7000); perspective1.setRotationMatrix(100,200,300); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
The CubeFocusFactor property in Chapter 7. |
This method returns the current applet or null if being used with an application. If you need to get a context for a getDocumentBase in a Java environment, this method returns the location for this instance of Perspective. |
public Applet getApplet ( ); |
None |
Applet = the current applet |
get/setAutofit()
These methods can be used to get and set the text autofitting attribute in a chart. If a specific object is not identified by id or objectID, this method sets or returns the autofit attribute for the first item in the selection list. You may also use one of the object-specific properties/methods to get/set the autofitting attribute of an object (e.g., FootnoteAutofit(), LegendTextAutofit(), O1LabelAutofit(), etc.). See Chapter 7 for details. |
public boolean getAutofit ( ); public boolean getAutofit (IdentObj id); public boolean getAutofit (int objectID); public void setAutofit ( boolean newValue); public void setAutofit ( IdentObj, boolean newValue ); public void setAutofit ( int objectID, boolean newValue); |
id = Object IDobjectID = Object Number newValue = TRUE = enable autofitting/FALSE = disable autofitting |
getAutofit(): TRUE = Autofit enabled/FALSE = Autofit disabled setAutofit(): None |
import java.awt.*; import java.applet.*; import TDG.Perspective; public class Applet1 extends Applet { public void init() { setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setAutofit(false); perspective1.setFontSize(24); perspective1.setGraphType(17); perspective1.setData(0,0,1); perspective1.setData(0,1,2); perspective1.setData(0,2,3); perspective1.setData(0,3,4); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setAutofit() and the following properties in Chapter 7: FootnoteAutofit, LegendTextAutofit, O1LabelAutofit, O1TitleAutofit, O2LabelAutofit, O2TitleAutofit, SubtitleAutofit, TitleAutofit, X1LabelAutofit, X1TitleAutofit, Y1LabelAutofit, Y1TitleAutofit, Y2LabelAutofit, Y2TitleAutofit |
get/setAxisAssignment()
These methods can be used to get/set the axis assignment attribute in a chart. If a specific object is not identified by id or SeriesID, this method gets/sets the axis assignment attribute for the first item in the selection list. |
public int getAxisAssignment ( ); public int getAxisAssignment ( IdentObj id ); public int getAxisAssignment ( int SeriesID ); public void setAxisAssignment ( int newValue ); public void setAxisAssignment ( int newValue, IdentObj id ); public void setAxisAssignment ( int newValue, int seriesID ); |
None id = Object ID seriesID = Series Number newValue = 0 = Y1/1=Y2 |
getAxisAssignment(): 0 = Y1/1 = Y2 |
<HTML> <HEAD> <TITLE>TDGChartEditorApplet </TITLE> </HEAD> <BODY> <APPLET CODE="TDGChartEditorApplet.class" WIDTH=640 HEIGHT=480> <PARAM name=TDGSCRIPT value=' setGraphType(21); /* set graph type */ setTitleString("Wilde Java Jon!"); /* set title string */ setSeriesLabelArray("Retail Cost", "Dealer Cost", "Seats"); setDataSeries(45319.00, 5610.00, 51065.00, 6478.00, 64732.00); setDataSeries(37853.00, 4631.00, 41235.00, 5512.00, 54563.00); setDataSeries(15.00, 5.00, 10.00, 8.00, 34.00); setGroupLabelArray("England", "France", "Italy", "Japan", "W Germany"); setX1TitleString("Country"); /* set X1 Axis title string */ setFootnoteString("A Very Good Footnote"); /* set Footnote string */ setURL(0,0, "http://www.threedgraphics.com"); setURL(0,1, "http://www.threedgraphics.com"); setURL(0,2, "http://www.threedgraphics.com"); setURL(1,0, "http://www.threedgraphics.com"); setAxisAssignment(0, 0); /* put series 0 on Y1 */ setAxisAssignment(1, 0); /* put series 1 on Y1 */ setAxisAssignment(2, 1); /* put series 2 on Y2 */ '> </APPLET> </BODY> </HTML> |
get/setAxisDescending (),get/setAxisSide() and the following properties in Chapter 7: Y1AxisSide and Y2AxisSide |
get/setAxisDescending()
These methods are used to get/set the axis descending attribute for an axis in a chart. If a specific numeric axis object is not identified by id or objectID, the method gets/sets the axis-descending attribute for the first item in the selection list. You may also use one of the axis-specific properties/methods (e.g., X1AxisDescending(), Y1AxisDescending(), etc.) to get/set the descending attribute of an axis. |
public boolean getAxisDescending ( ) public boolean getAxisDescending ( IdentObj id ); public boolean getAxisDescending ( int objectID ); public void setAxisDescending ( boolean newValue ); public void setAxisDescending ( IdentObj id, boolean newValue ); public void setAxisDescending ( int objectID, boolean newValue ); |
None id = Object ID objectID = Object Number newValue = TRUE for descending/FALSE for ascending |
getAxisDescending(): TRUE = Descending/FALSE = Ascending |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); id = perspective1.getY1Axis(); perspective1.setAxisDescending (id, true ); perspective1.setBounds(0,0,300,200); add(perspective1); //}} } TDG.Perspective perspective1; } |
get/setAxisAssignment(),get/setAxisSide() and the following properties in Chapter 7: X1AxisDescending, Y1AxisDescending, and Y2AxisDescending |
get/setAxisSide()
These methods are used to get/set the side of a chart where an axis is imaged. If a specific object is not identified by id or objectID, the method gets/sets the axis side attribute for the first item in the selection list. You may also use one of the axis-specific properties/methods (e.g., X1AxisSide(), Y1AxisSide (), etc.) to determine the side attribute of an axis. |
public int getAxisSide ( ); public int getAxisSide (IdentObj id); public int getAxisSide (int objectID); public void setAxisSide ( int newValue ); public void setAxisSide ( IdentObj id, int newValue ); public void setAxisSide ( int objectID, int newValue ); |
None id = Object ID objectID = Object Number newValue: 0 = Left (or bottom for Horizontal charts), 1=right (or top for Horizontal charts), 2=Both sides of chart |
getAxisSide(): 0 = Left (or bottom for Horizontal charts), 1=right (or top for Horizontal charts), 2=Both sides of chart setAxisSide(): None |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); id = perspective1.getY1Axis(); perspective1.setAxisDescending (id, false ); perspective1.setAxisSide (id, 2); perspective1.setBounds(0,0,300,200); add(perspective1); //}} } TDG.Perspective perspective1; } |
get/setAxisAssignment(), get/setAxisDescending() and the following properties in Chapter 7: O1AxisSide, X1AxisSide, Y1AxisSide, and Y2AxisSide |
get/setBorderColor()
These methods can be used get/set the border color attribute of an object in a chart. |
public color getBorderColor ( IdentObj id ); public void setBorderColor ( Color newValue ); public void setBorderColor ( IdentObj id, Color newValue ); |
id : Object IDColor: value of color to be assigned to border |
getBorderColor(): color: A color value setBorderColor(): None |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); id = perspective1.getO1Title(); perspective1.setBorderColor (id, new Color(255,255,255)); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setFillColor(), get/setSelectionBorderColor, get/setTransparentBorderColor(),selectionHasTransparentBorderColor(), setSeriesBorderColor(), and the ColorMode property in Chapter 7. |
This method can be used to determine whether or not chart data is valid. |
public boolean getChartDataValid( ); |
None |
TRUE = Chart data is valid/FALSE = Chart data is not valid |
if ( getChartDataValid() == true ) { |
This method can be used to get a chart from an FTP server. |
public boolean getChartFromFTP ( |
strHost : Host NamestrUser: User Name strPass: Password strDir: Directory location strDestFile: File Name |
TRUE = Successful/FALSE = Unsuccessful |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.Perspective; public class Applet1 extends Applet { public void init() { setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.getChartFromFTP("myHost", "myUserName", "myPassword", "myDirectory","myChartFile"); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
sendChartToFTP(), sendGIFToFTP () |
get/setCubeRotationMatrix()
This method get/set the rotation matrix of a 3D chart. |
public Matrix3d getCubeRotationMatrix ( ); public void setCubeRotationMatrix ( double rx, double ry, double rq ); public void setCubeRotationMatrix (Matrix3d m); |
rx; rotation in x directionry: rotation in y direction rz: rotation in z direction m: Matrix 3D in the format shown below |
setRotationMatrix(): None getRotationMatrix(): Matrix3d = |
public class Matrix3d implements java.io.Serializable |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.Perspective; public class Applet1 extends Applet { public void init() { setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setGraphType(2); perspective1.setViewing3DAnglePreset(-1); perspective1.focusCube(7000); perspective1.setCubeRotationMatrix(100,200,300); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
The default setting is: setCubeRotationMatrix (0.7071067811865474, |
rotateCubeX(), rotateCubeY(), rotateCubeZ() |
The method gets the current matrix of a 3D chart. Returns null if there is no chart or the chart is not a 3D-type graph. |
public Matrix4d getCurrentMatrix ( ); |
None |
Matrix4d = the current matrix |
public class Matrix4d |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.Model3D.Matrix4d; import TDG.Model3D.Point3d; import TDG.Perspective; public class Applet1 extends Applet { public void init() { Matrix4d myMatrix; Point3d myPoint; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setGraphType(2); myMatrix = perspective1.getCurrentMatrix(); myPoint = perspective1.getCurrentViewer(); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
This method returns the X-, Y-, and Z- coordinates of the current viewer. |
public Point3d getCurrentViewer (); |
None. |
Point3d = the current viewer |
|
public class Point3d |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.Model3D.Matrix4d; import TDG.Model3D.Point3d; import TDG.Perspective; public class Applet1 extends Applet { public void init() { Matrix4d myMatrix; Point3d myPoint; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setGraphType(2); myMatrix = perspective1.getCurrentMatrix(); myPoint = perspective1.getCurrentViewer(); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
This method gets the numeric value for any series/group intersection. The "item" parameter specifies the position within the node defined by series/group (s,g) and indicates whether or not it is required. |
public double getDataAsDouble ( ); |
s: Series from which to retrieve datag: Group from which to retrieve data item: Data item |
double = the data at the specified row and column |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.Perspective; public class Applet1 extends Applet { public void init() { double d; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(17); perspective1.setData(0,0,10); perspective1.setData(0,1,11); perspective1.setData(0,2,12); perspective1.setData(0,3,13); d=perspective1.getDataAsDouble(0,0); perspective1.setData(1,0,d*d); d=perspective1.getDataAsDouble(0,1); perspective1.setData(1,1,d*d); d=perspective1.getDataAsDouble(0,2); perspective1.setData(1,2,d*d); d=perspective1.getDataAsDouble(0,3); perspective1.setData(1,3,d*d); perspective1.setBounds(0,0,300,200); add(perspective1); } } |
This method gets a value for any series/group intersection and converts it to a string. |
public string getDataAsString ( ); |
row: Chart row from which to get valuecol: Chart column from which to get value |
string = Character string at row,col |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.Perspective; public class Applet1 extends Applet { public void init() { double d; String label=""; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(17); perspective1.setData(0,0,10); perspective1.setData(0,1,11); perspective1.setData(0,2,12); perspective1.setData(0,3,13); label=perspective1.getDataAsString(0,0); perspective1.setGroupLabel(0,label); label=perspective1.getDataAsString(0,1); perspective1.setGroupLabel(1,label); label=perspective1.getDataAsString(0,2); perspective1.setGroupLabel(2,label); label=perspective1.getDataAsString(0,3); perspective1.setGroupLabel(3,label); perspective1.setBounds(0,0,300,200); add(perspective1); } } |
This method gets the coordinates of an object in a chart. |
public int getDataCoord ( ); |
id: Identification number of an object in a chart |
int = x,y coordinates of an object in a chart |
This method gets a data value for an object at a specified coordinates in a chart. |
public double getDataFromCoord ( ); |
id: Identification number of an object in a chartnCoordVC: Virtual coordnance of object |
double = the data at the specified coordinates |
get/setDataLabel()
These methods get/set a label string at a specified series (s) and group (g). |
public String getDataLabel ( int s, int g ); public void setDataLabel ( int s, int g, String newValue ); |
s: Series numberg: Group number newValue: Data label string |
getDataLabel(): String = the data label at series (s)/group (g) setDataLabel(): None |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.Perspective; public class Applet1 extends Applet { public void init() { String label = ""; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); label = perspective1.getDataLabel(0,0); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setGroupLabel(), get/setSeriesLabel(). For HTML ONLY, see setSeriesLabelArray() and setGroupLabelArray() in Chapter 4. |
get/setDataTextAngle ()
These methods get/set the angle from center point that all or selected data text is drawn from in the chart. If a specific object in the chart is not identified by the input parameter id or objectID, the method will set or return the value of this attribute for the first item in the selection list. |
public int getDataTextAngle ( ); |
id : Object IDseriesID: Series number groupID: Group number newValue: Data text angle (0...360) |
getDataTextAngle(): int = the data text angle (0...360) |
import java.awt.*; import java.applet.*; import TDG.Perspective; public class Applet1 extends Applet { public void init() { setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(17); perspective1.setData(0,0,1); perspective1.setData(0,1,2); perspective1.setData(0,2,3); perspective1.setData(0,3,4); perspective1.setDataTextDisplay(true); perspective1.setDataTextPosition(0); perspective1.setDataTextAngle(360); perspective1.setDataTextRadius(99); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
The DataTextPosition property must be set to zero. The DataTextDisplay property must be set to true in order for data text to be drawn in the chart. |
get/setDataTextRadius and the following properties in Chapter 7: DataTextAngleDefault, DataTextDisplay, DataTextPosition |
get/setDataTextRadius ()
These methods get/set the radius for the data text position of a specified data point (series and group or series only). If a specific object in the chart is not identified by the input parameter id or objectID, the method will set or return the value of this attribute for the first item in the selection list. |
public int getDataTextRadius ( ); |
id : Object IDseriesID: Series number groupID: Group number newValue: Data text radius (0...100) |
getDataTextRadius(): int = the data text radius (0...100) |
import TDG.Perspective; public class Applet1 extends Applet { public void init() { setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(17); perspective1.setData(0,0,1); perspective1.setData(0,1,2); perspective1.setData(0,2,3); perspective1.setData(0,3,4); perspective1.setDataTextDisplay(true); perspective1.setDataTextPosition(0); perspective1.setDataTextAngle(360); perspective1.setDataTextRadius(99); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
The DataTextPosition property must be set to zero. The DataTextDisplay property must be set to true in order for data text to be drawn in the chart. |
get/setDataTextAngle and the following properties in Chapter 7: DataTextRadiusDefault, DataTextDisplay, DataTextPosition |
get/setDataValue()
These methods get/set a data value for a specific data object (riser) in a chart. |
public double getDataValue ( IdentObj id ); public void setDataValue ( IdentObj id, double newValue ); |
id: Object IDnewValue: data value to be assigned to the object |
getDataValue(): double = data value at id setDataValue(): None |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { double d; IdentObj id; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); id = perspective1.getBarRiser(); d = perspective1.getDataValue(id); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setDisplay ()
These methods can be used to get/set the display attribute of an object in a chart. If a specific object is not identified by the input parameter id or objectID, the method will set or return the value of this attribute for the first item in the selection list. See "Getting an Object ID" at the beginning of this chapter for a list of methods that can be used to obtain the ID of an object that is to be displayed by setDisplay (objectID, true); or to determine if an object is visible using boolean=getDisplay (objectID);. |
public boolean getDisplay ( ); |
id or objectID: Object IDnewValue: True = Object is displayed/False = Object is not imaged |
getDisplay(): True = Object is displayed/False = Object is not imaged |
import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; perspective1 = new TDG.Perspective(); id = perspective1.getY1Title(); perspective1.setDisplay (id, false); add(perspective1); } TDG.Perspective perspective1; } |
These properties can be used to enable/disable the display of specific objects in a chart: DataTextDisplay, Display3DFloor/RightWall/LeftWall, DualAxisLineDisplay, FootnoteDisplay, FrameDisplay, Grid3DFloorDisplayX/Z, Grid3DLeftWallDisplayY/Z, Grid3DRightWallDisplayX/Y, Grid3DRiserDisplayX/Y/Z, LegendDisplay, MarkerDisplay, O1AxisLineDisplay, O1/O2LabelDisplay, O1MajorGridDisplay, PieFeelerTextDisplay, PieLabelDisplay, PieRingTotalDisplay, Stock52WeekHighDisplay, Stock52WeekLowDisplay, StockCloseSplitDisplay, StockCloseTicksDisplay, StockMovingAverageDisplay, StockOpenTicksDisplay, SubtitleDisplay, TitleDisplay, X1/Y1AxisLineDisplay, X1/Y1/Y2LabelDisplay, X1/Y1/Y2MajorGridDisplay, X1/Y1MinorGridDisplay, X1/Y1/Y2TitleDisplay |
get/setDisplayOffScale()
These methods can be used to determine or set whether or not off scale data points are imaged in a chart. If a specific object is not identified by the input parameters id or objectID, the display-off-scale attribute will be set or returned for the first item in the selection list. You may also use one of the object-specific properties/methods to set or determine the display-off-scale attribute of a specific object (e.g., X1OffScaleDisplay(), Y1OffScaleDisplay(), etc.). |
public boolean getDisplayOffScale ( ); public boolean getDisplayOffScale ( IdentObj id ); public boolean getDisplayOffScale ( int objectID ); public void setDisplayOffscale ( boolean newValue ); public void setDisplayOffscale ( IdentObj id, boolean newValue ); public void setDisplayOffscale ( int objectID, boolean newValue ); |
id or objectID: Identification number of an object in a chartnewValue: TRUE = off scale values are imaged /FALSE = offscale values are not imaged |
getDisplayOffScale(): boolean: TRUE = off scale values are imaged / FALSE = offscale values are not imaged setDisplayOffScale: None |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(299,200); perspective1 = new TDG.Perspective(); id = perspective1.getY1Axis(); perspective1.setDisplayOffScale (id, true); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
This method gets the document URL. |
public URL getDocumentBase ( ); |
None |
URL = document URL |
try { paths[0] = "tiles"; paths[1] = "Hard_Rock_Green.GIF"; aFile = FileUtilities.fromHere(paths); imgTexturePreview.setImageURL(new java.net.URL(m_Perspective.getDocumentBase(), aFile.getPath())); } catch (java.net.MalformedURLException error) { |
get/setExcludeMaxLabel ()
These methods can be used to set or determine whether or not maximum labels are excluded from an axis in a chart. If a specific object in the chart is not identified by the input parameter id or objectID, the method will set or return will return the value of this attribute for the first item in the selection list. You may also use one of the axis-specific properties/methods to set or determine whether or not maximum labels are excluded on an axis (e.g., O1ExcludeMaxLabel(), O2ExcludeMaxLabel(), X1ExcludeMaxLabel(), etc.). |
public boolean getExcludeMaxLabel ( ); public boolean getExcludeMaxLabel ( IdentObj id ); public boolean getExcludeMaxLabel ( int objectID ); public void setExcludeMaxLabel ( boolean newValue); public void setExcludeMaxLabel ( IdentObj id, boolean newValue); public void setExcludeMaxLabel ( int objectID, boolean newValue); |
id or objectID: Identifies an axis in the chart where you want to determine whether or not the max label is excludednewValue: TRUE = exclude max label at axis identified by id or objectID / FALSE = do not exclude max label at the specified axis. |
getExcludeMaxLabel(): TRUE = Max labels are excluded/FALSE = Max labels are included setExcludeMaxLabel(): None |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(299,200); perspective1 = new TDG.Perspective(); id = perspective1.getY1Axis(); perspective1.setExcludeMaxLabel (id, false); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setExcludeMinLabel, O1ExcludeMaxLabel, O2ExcludeMaxLabel, X1ExcludeMaxLabel, Y1ExcludeMaxLabel, Y2ExcludeMaxLabel. |
get/setExcludeMinLabel ()
These methods can be used to set or determine whether or not minimum labels are excluded from an axis in a chart. If a specific object in the chart is not identified by the input parameter id or objectID, the method will set or return the value of this attribute for the first item in the selection list. You may also use one of the axis-specific properties/methods to set or determine whether or not minimum labels are excluded on an axis (e.g., O1ExcludeMinLabel(), O2ExcludeMinLabel(), X1ExcludeMinLabel(), etc.). |
public boolean getExcludeMinLabel ( ); public boolean getExcludeMinLabel ( IdentObj id ); public boolean getExlcudeMinLabel ( int objectID); public setExcludeMinLabel ( boolean newValue); public setExcludeMinLabel ( IdentObj id, boolean newValue); public setExcludeMinLabel ( int objectID, boolean newValue); |
id or objectID: The object ID of an axis in the chart where you want to determine whether or not minimum labels are excluded.newValue: TRUE = Exclude minimum label on the axis identified by id or objectID / FALSE = do not excluded the minimum label |
getExcludeMinLabel(): TRUE = Min labels are excluded / FALSE = Min labels are included setExcludeMinLabel(): None |
/* |
get/setExcludeMaxLabel, O1ExcludeMinLabel, O2ExcludeMinLabel, X1ExcludeMinLabel, Y1ExcludeMinLabel, Y2ExcludeMinLabel. |
get/setFillColor()
These method set/get the value of a fill color for a particular object in a chart. |
public Color getFillColor ( IdentObj id ); public void setFillColor ( Color newValue ); public void setFillColor ( IdentObj id, Color newValue ); |
id: Identification number of an object in a chartnewValue: the value of the fill color |
getFillColor(): Color = the value of the fill color for the object identified by id, null = no fill color applied setFillColor(): None |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(299,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(2); perspective1.setViewing3DAnglePreset(-1); perspective1.setData(0,1,1); perspective1.setData(0,2,2); perspective1.setData(0,3,3); perspective1.setData(0,4,4); perspective1.setData(1,1,11); perspective1.setData(1,2,12); perspective1.setData(1,3,13); perspective1.setData(1,4,14); id = perspective1.getCubeLeftWall(); perspective1.setFillColor (id, new Color (0,0,0)); id = perspective1.getCubeRightWall(); perspective1.setFillColor (id, new Color (255,255,255)); perspective1.setBounds(0,0,299,200); add(perspective1); } TDG.Perspective perspective1; } |
The fill type must be set to color with setFillType(1); |
get/setBorderColor, get/setFillType, getSelectionFillColor, get/setTransparentFillColor, selectionHasTransparentFillColor, setSeriesFillColor |
get/setFillType()
These methods get/set the fill type for a particular object in a chart. |
public int getFillType ( IdentObj id ); public void setFillType ( int newValue ); public void setFillType ( IdentObj id, int newValue ); |
id: Identification number of an object in a chartnewValue: fill type (1=Color, 2=Gradient, 3=Texture) |
getFillType(): int = the fill type of the object identified by id (1=Color, 2=Gradient, 3=Texture) setFillType(): None |
import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(299,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(2); perspective1.setViewing3DAnglePreset(-1); perspective1.setData(0,1,1); perspective1.setData(0,2,2); perspective1.setData(0,3,3); perspective1.setData(0,4,4); perspective1.setData(1,1,11); perspective1.setData(1,2,12); perspective1.setData(1,3,13); perspective1.setData(1,4,14); id = perspective1.getCubeLeftWall(); perspective1.setFillColor (id, new Color (0,0,0)); id = perspective1.getCubeRightWall(); perspective1.setFillColor (id, new Color (255,255,255)); perspective1.setFillType (id, 2); perspective1.setBounds(0,0,299,200); add(perspective1); } TDG.Perspective perspective1; } |
If you select fill type 2 (gradient), see the get/setGradientDirection(), set/setGradientNumPins(), get/setGradientPinLeftColor(), get/setGradientPinPosition(), get/setGradientPinRightColor() methods. If you select fill type 3 (textures), use the get/setTexture() and get/setTextureDisplayMode() methods to define the texture. |
get/setTexture, get/setTextureDisplayMode, get/setGradientNumPins, get/setGradientPinLeftColor, get/setGradientPinRightColor, get/setGradientPinPosition |
get/setFontName()
These methods can be used to get/set the name of the font used for a text object in a chart. If an object ID (id or objectID) is not specified, the method sets or returns the font name used for the first item in the selection list. |
public String getFontName ( ); public String getFontName ( IdentObj id ); public String getFontName ( int objectID); public void setFontName ( String newValue); public void setFontName ( IdentObj id, String newValue); public void setFontName ( int objectID, String newValue); |
id or objectID: Identifies an object in the chart to get a font name from.newValue: Font name string |
getFontName(): String = font name, null = no font name applied at id or objectID setFontName(): None |
setFontName(getDataText(),"Helvetica"); setFontName(getFootnote(),"Helvetica"); setFontName(getLegendText(),"Helvetica"); setFontName(getO1Label(),"Helvetica"); setFontName(getO1Title(),"Helvetica"); setFontName(getO2Label(),"Helvetica"); setFontName(getO2Title(),"Helvetica"); setFontName(getSubtitle(),"Helvetica"); setFontName(getTitle(),"Helvetica"); setFontName(getX1Label(),"Helvetica"); |
get/setFontSizeVC()
These methods can be used to get/set the size of a font in virtual coordinates. If a specified object is not identified with the input parameter id or objectID, this method will set/return the font size for the first item in the selection list. |
public int getFontSizeVC ( ); public int getFontSizeVC ( IdentObj id ); public int getFontSizeVC ( int objectID ); public void setFontSizeVC ( int newValue ); public void setFontSizeVC ( IdentObj id, int newValue ); public void setFontSizeVC ( int objectID, int newValue ); |
id or objectID: identifies a specific object in a chart.newValue: Font size in virtual coordinates |
getFontSizeVC(): int = the font size in virtual coordinates. setFontSizeVC(): None |
setFontSizeVC(getDataText(),1000); setFontSizeVC(getFootnote(),1000); setFontSizeVC(getLegendText(),1000); setFontSizeVC(getO1Label(),2000); setFontSizeVC(getO1Title(),1000); setFontSizeVC(getO2Label(),2000); setFontSizeVC(getO2Title(),1000); setFontSizeVC(getSubtitle(),1000); setFontSizeVC(getTitle(),1000); setFontSizeVC(getX1Label(),500); setFontSizeVC(getY1Label(),4000); setFontSizeVC(getY1Title(),1000); setFontSizeVC(getY2Label(),500); setFontSizeVC(getY2Title(),1000); |
See the description of Virtual Coordinates in Chapter 3 if you need additional information about the values that can be set by this method. If autofitting is enabled for the text object, the font size setting will be ignored. |
get/setAutofit, get/setFontName, get/setFontStyle, setFontSize, get/setAutofit() and the following properties in Chapter 7: FootnoteAutofit, LegendTextAutofit, , , O2LabelAutofit, O2TitleAutofit, X1LabelAutofit, X1TitleAutofit, Y1LabelAutofit, Y1TitleAutofit, Y2LabelAutofit, Y2TitleAutofit |
get/setFontStyle ()
These methods can be used to get/set the style of a font that is used for a particular object in a chart. If an specific object is not identified by the input parameter id or objectID, the method will set/return the font style used for the first item in the selection list. |
public int getFontStyle ( ); public int getFontStyle ( IdentObj id ); public int getFontStyle ( int objectID ); public void setFontStyle ( int newValue ); public void setFontStyle ( IdentObj id, int newValue ); public void setFontStyle ( int objectID, int newValue ); |
id or objectID: identifies a specific object in a chart.newValue: Font style (0=Plain, 1=Italic, 2=Bold, 3=Italic/Bold, 4=Underline, 5=Italic/Underline) |
getFontStyle(): int = font style (0=Plain, 1=Italic, 2=Bold, 3=Italic/Bold, 4=Underline, 5=Italic/Underline) setFontStyle(): None |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); id = perspective1.getO1Title(); perspective1.setFontStyle(id,1); perspective1.setTextString(id, "New Title"); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
This method gets the depth offset of a chart frame where a DepthAngle has been applied to form a 3D affect (2.5D) on a 2D chart. |
public Point getFrameDepthOffset ( ); |
None |
Point = frame depth in 2.5D |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import java.awt.Point; import TDG.Perspective; public class Applet1 extends Applet { public void init() { Point myPoint=null; IdentObj id; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); myPoint = perspective1.getFrameDepthOffset(); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
DepthAngle and DepthRadius in Chapter 7 |
This method is useful for objects like axes, that want to draw lines up to but not overlapping the frame rectangle. Different graphs use different frame objects (Bar, Line, Area, pies and circular) the best way to really get the correct frame rectangle is to get it directly from the frame object. This gets the frame rectangle and translates it to destination coordinates. Then it makes the rectangle smaller by 1 pixel in each dimension and translates it back to virtual coordinates. |
public Rectangle getFrameRect ( ); |
bInner: true = inner edge of frame / false = outer edge of frame |
Rectangle = size of the frame in virtual coordinates |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import java.awt.Point; import java.awt.Rectangle; import TDG.Perspective; public class Applet1 extends Applet { public void init() { Point myPoint=null; Rectangle myRect=null; IdentObj id; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); myPoint = perspective1.getFrameDepthOffset(); myRect = perspective1.getFrameRect(true); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setGradientDirection()
These methods get/set the direction of the gradient applied to an object in a chart. |
public int getGradientDirection ( IdentObj id ); |
id: Identification number of an object in a chartnewValue: Gradient direction (1=Right, 2=Left, 3=Down, 4=Up, 5=Down/Left, 6=Up/Left, 7=Down/Right, 8=Up/Right, 9=Radial, 10=Radial/Top/Left, 11=Radial/Top/Right, 12= Radial/Bottom/Left, 13=Radial/Bottom/Right) |
getGradientDirection(): int = gradient direction(1=Right, 2=Left, 3=Down, 4=Up, 5=Down/Left, 6=Up/Left, 7=Down/Right, 8=Up/Right, 9=Radial, 10=Radial/Top/Left, 11=Radial/Top/Right, 12= Radial/Bottom/Left, 13=Radial/Bottom/Right) setGradientDirection(): None |
import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(299,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(2); perspective1.setViewing3DAnglePreset(-1); perspective1.setData(0,1,1); perspective1.setData(0,2,2); perspective1.setData(0,3,3); perspective1.setData(0,4,4); perspective1.setData(1,1,11); perspective1.setData(1,2,12); perspective1.setData(1,3,13); perspective1.setData(1,4,14); id = perspective1.getCubeRightWall(); perspective1.setFillColor (id, new Color (255,255,255)); perspective1.setFillType (id, 2); perspective1.setGradientDirection(id,2); perspective1.setBounds(0,0,299,200); add(perspective1); } TDG.Perspective perspective1; } |
The fill type for the selected object must be set to two with the method setFillType(2). |
get/setFillType, get/setGradientNumPins, get/setGradientPinLeftColor, get/setGradientPinRightColor, get/setGradientPinPosition |
get/setGradientNumPins()
These methods get/set the number of pins in a gradient applied to a particular object in a chart. |
public int getGradientNumPins ( IdentObj id ); public void setGradientNumPins ( int newValue ); public void setGradientNumPins ( IdentObj id, int newValue ); |
id: Identification number of an object in a chartnewValue: Number of pins in gradient |
getGradientNumPins(): int = Number of pins in gradient setGradientNumPins(): None |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(299,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(2); perspective1.setViewing3DAnglePreset(-1); perspective1.setData(0,1,1); perspective1.setData(0,2,2); perspective1.setData(0,3,3); perspective1.setData(0,4,4); perspective1.setData(1,1,11); perspective1.setData(1,2,12); perspective1.setData(1,3,13); perspective1.setData(1,4,14); id = perspective1.getCubeLeftWall(); perspective1.setFillColor (id, new Color (0,0,0)); id = perspective1.getCubeRightWall(); perspective1.setFillColor (id, new Color (255,255,255)); perspective1.setFillType (id, 2); perspective1.setGradientDirection(id,2); perspective1.setGradientNumPins(id,16); perspective1.setBounds(0,0,299,200); add(perspective1); } TDG.Perspective perspective1; } |
The fill type for the selected object must be set to two with the method setFillType(2). |
get/setFillType, get/setGradientDirection, get/setGradientPinLeftColor, get/setGradientPinRightColor, get/setGradientPinPosition |
get/setGradientPinLeftColor()
These methods get/set the color value of the left pin of a gradient for an object in a chart. |
public Color getGradientPinLeftColor ( IdentObj id, int nIndex ); public void setGradientPinLeftColor ( Color newValue, int nIndex ); public void setGradientPinLeftColor ( IdentObj id, Color newValue, |
id: Identification number of an object in a chartnIndex: newValue: the color value of the left pin in a gradient |
getGradientPinLeftColor(): the color value of the left pin in a gradient |
import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(299,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(2); perspective1.setViewing3DAnglePreset(-1); perspective1.setData(0,1,1); perspective1.setData(0,2,2); perspective1.setData(0,3,3); perspective1.setData(0,4,4); perspective1.setData(1,1,11); perspective1.setData(1,2,12); perspective1.setData(1,3,13); perspective1.setData(1,4,14); id = perspective1.getCubeRightWall(); perspective1.setFillColor (id, new Color (255,255,255)); perspective1.setFillType (id, 2); perspective1.setGradientDirection(id,2); perspective1.setGradientNumPins(id,2); perspective1.setGradientPinLeftColor(id,new Color(0,0,0), 1); perspective1.setGradientPinRightColor(id, new Color (192,192,192),2); perspective1.setBounds(0,0,299,200); add(perspective1); } TDG.Perspective perspective1; } |
The fill type for the selected object must be set to two with the method setFillType(2). |
get/setFillType, get/setGradientDirection, get/setGradientNumPins, get/setGradientPinRightColor, get/setGradientPinPosition |
get/setGradientPinPosition()
These methods get/set the pin position of a gradient for an object in a chart. |
public double getGradientPinPosition ( IdentObj id, int nIndex ); public void setGradientPinPosition ( double newValue, int nIndex ); public void setGradientPinPosition ( IdentObj id, double NewValue, |
id: Identification number of an object in a chartnIndex: newValue: position in the gradient (0.0 to 1.0) |
getGradientPinPosition(): double = position in the gradient (0.0 to 1.0) |
import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(299,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(2); perspective1.setViewing3DAnglePreset(-1); perspective1.setData(0,1,1); perspective1.setData(0,2,2); perspective1.setData(0,3,3); perspective1.setData(0,4,4); perspective1.setData(1,1,11); perspective1.setData(1,2,12); perspective1.setData(1,3,13); perspective1.setData(1,4,14); id = perspective1.getCubeRightWall(); perspective1.setFillColor (id, new Color (255,255,255)); perspective1.setFillType (id, 2); perspective1.setGradientDirection(id,2); perspective1.setGradientNumPins(id,2); perspective1.setGradientPinLeftColor(id,new Color(0,0,0),1); perspective1.setGradientPinPosition (id, 0.5, 1); perspective1.setGradientPinRightColor(id, new Color (192,192,192),2); perspective1.setGradientPinPosition (id,0.25,2); perspective1.setBounds(0,0,299,200); add(perspective1); } TDG.Perspective perspective1; } |
The fill type for the selected object must be set to two with the method setFillType(2). |
get/setFillType, get/setGradientDirection, get/setGradientNumPins, get/setGradientPinRightColor, get/setGradientPinLeftColor |
get/setGradientPinRightColor()
These methods get/set the color value of the right pin of a gradient for an object in a chart. |
public Color getGradientPinRightColor ( IdentObj id, int nIndex ); public void setGradientPinRightColor ( Color newValue, int nIndex ); public void setGradientPinRightColor ( IdentObj id, Color newValue, |
id: Identification number of an object in a chartnIndex: newValue: the color value of the right pin in a gradient |
getGradientPinRightColor(): the color value of the right pin in a gradient setGradientPinRightColor (): None |
import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(299,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(2); perspective1.setViewing3DAnglePreset(-1); perspective1.setData(0,1,1); perspective1.setData(0,2,2); perspective1.setData(0,3,3); perspective1.setData(0,4,4); perspective1.setData(1,1,11); perspective1.setData(1,2,12); perspective1.setData(1,3,13); perspective1.setData(1,4,14); id = perspective1.getCubeRightWall(); perspective1.setFillColor (id, new Color (255,255,255)); perspective1.setFillType (id, 2); perspective1.setGradientDirection(id,2); perspective1.setGradientNumPins(id,2); perspective1.setGradientPinLeftColor(id,new Color(0,0,0),1); perspective1.setGradientPinRightColor(id, new Color (192,192,192),2); perspective1.setBounds(0,0,299,200); add(perspective1); } TDG.Perspective perspective1; } |
The fill type for the selected object must be set to two with the method setFillType(2). |
get/setFillType, get/setGradientDirection, get/setGradientNumPins, get/setGradientPinPosition, get/setGradientPinLeftColor |
get/setGridCount()
This method can be used to get/set the number of grid lines on an ordinal (O1) axis. You may also use one of the axis-specific properties (O1MinorGridCount) to specify the count of grid lines. See "Getting an Object ID" at the beginning of this chapter for methods that can be used to get the object ID of the ordinal axis. |
public int getGridCount ( ); public int getGridCount ( IdentObj id ); public int getGridCount ( int objectID ); public int setGridCount ( int newValue ); public int setGridCount ( IdentObj id, int newValue ); public int setGridCount ( int objectID, int newValue ); |
id or objectID : Object ID |
int = the number of grid lines for the object specified by id or objectID |
get/setGridStep ()
These methods can be used to get/set the number of grid steps used on a particular numeric axis in a chart. If the input parameters id or objectID do not identify an axis in the chart, the method sets/returns the number of grid steps for the first item in the selection list. You may also use one of the axis-specific properties/methods to set or determine the number of grid steps assigned on an axis (e.g., X1MajorGridStep(), X1MinorGridStep(), Y1MajorGridStep(), etc.). The value assigned by this method will be ignored if setGridStepAuto() enables (TRUE) automatic calculation of grid steps on a particular axis. |
public double getGridStep ( ); |
id or objectID: identifies an object in the chartnewValue: the number of grid steps on an axis |
getGridStep(): double = the number of grid steps on an axis |
import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(17); perspective1.setData(0,0,1); perspective1.setData(0,1,2); perspective1.setData(0,2,3); perspective1.setData(0,3,4); id = perspective1.getY1Axis(); perspective1.setGridStepAuto(id,false); perspective1.setGridStep(id,2); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setGridStepAuto, X1MajorGridStep, X1MajorGridStepAuto, X1MinorGridStep, X1MinorGridStepAuto, Y1MajorGridStep, Y1MajorGridStepAuto, Y1MinorGridStep, Y1MinorGridStepAuto |
get/setGridStepAuto()
These methods get/set a boolean value that indicates whether or not grid steps are automatically calculated for a specified numeric axis in a chart. You may also use one of the axis-specific properties/methods to get/set whether or not grid steps are automatically calculated on an axis (e.g., X1MajorGridStepAuto(), X1MinorGridStepAuto(), Y1MajorGridStepAuto(), etc.). If the method sets or returns a value of TRUE, a value assigned by setGridStep() will be ignored. |
public boolean getGridStepAuto ( ); public boolean getGridStepAuto ( IdentObj id ); public boolean getGridStepAuto ( int objectID ); public void setGridStepAuto ( boolean newValue ); public void setGridStepAuto ( IdentObj id, boolean newValue ); public void setGridStepAuto ( int objectID, boolean newValue ); |
id or objectID: identifies a specific object in a chartnewValue: TRUE = grid steps are automatically calculated / FALSE = grid steps are not automatically calculated |
getGridStepAuto(): TRUE = grid steps are automatically calculated / FALSE = grid steps are not automatically calculated setGridStepAuto (): None |
import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(17); perspective1.setData(0,0,1); perspective1.setData(0,1,2); perspective1.setData(0,2,3); perspective1.setData(0,3,4); id = perspective1.getY1Axis(); perspective1.setGridStepAuto(id,false); perspective1.setGridStep(id,2); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setGridStep, X1MajorGridStepAuto, X1MinorGridStepAuto, Y1MajorGridStepAuto, Y1MinorGridStepAuto |
get/setGridStyle()
These methods can be used to get/set the style of grids on a particular axis in a chart. |
public int getGridStyle ( ); public int getGridStyle ( IdentObj id ); public int getGridStyle ( int objectID ); public void setGridStyle ( IdentObj id, int newValue ); public void setGridStyle ( int newValue ); public void setGridStyle ( int objectID, int newValue); |
id or objectID: Object IDnewValue: 0...5 (0=No Grid, 1=Normal Grid, 2=Grid and Ticks, 3=Inner Ticks, 4=Outer Ticks, 5=Spanned Ticks) |
getGridStyle(): grid style value 0...5 setGridStyle(): None |
import java.awt.*; |
O1MajorGridStyle, O1MinorGridStyle, X1MajorGridStyle, X1MinorGridStyle, Y1MajorGridStyle, Y1MinorGridStyle, Y2MajorGridStyle, Y2MinorGridStyle |
get/setGroupLabel()
These methods can be used to get and set a group label in a chart. |
public String getGroupLabel ( ); |
id = an object IDgroupID = a group number |
getGroupLabel(): String = group label |
import TDG.Perspective; public class Applet1 extends Applet { public void init() { setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setFrameDisplay(false); perspective1.setBounds(0,0,300,181); perspective1.setGroupLabel (0,"Group0"); perspective1.setGroupLabel (1,"Group1"); perspective1.setGroupLabel (2,"Group2"); perspective1.setGroupLabel (3,"Group3"); perspective1.setGroupLabel (4,"Group4"); perspective1.setGroupLabel (5,"Group5"); add(perspective1); } TDG.Perspective perspective1; } |
|
get/setLabelStagger()
These methods can be used to set/determine whether or not labels are staggered on a particular axis in a chart. You may also use one of the axis-specific properties/methods to set/determine whether or not labels are staggered on a particular axis (e.g., X1LabelStagger (), Y1LabelStagger (), Y2LabelStagger(), etc.). |
public boolean getLabelStagger ( ); public boolean getLabelStagger ( IdentObj id ); public boolean getLabelStagger ( int objectID ); public void setLabelStagger ( boolean newValue ); public void setLabelStagger ( IdentObj id, boolean newValue ); public void setLabelStagger ( int objectID, boolean newValue ); |
id or objectID: Object IDnewValue: TRUE = labels are staggered / FALSE = labels are not staggered |
getLabelStagger(): TRUE = labels are staggered / FALSE = labels are not staggered setLabelStagger (): None |
import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setDepthAngle(0); perspective1.setDepthRadius(0); perspective1.setGraphType(17); perspective1.setData(0,0,1); perspective1.setData(0,1,2); perspective1.setData(0,2,3); perspective1.setData(0,3,4); perspective1.setGroupLabel(0,"This is the Group 0 Label"); perspective1.setGroupLabel(1,"This is the Group 1 Label"); perspective1.setGroupLabel(2,"This is the Group 2 Label"); perspective1.setGroupLabel(3,"This is the Group 3 Label"); id = perspective1.getO1Label(); perspective1.setLabelStagger (id, true); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setLegendRect()
These methods are used to get and set the size and location of the legend rectangle. This rectangle is the area in the chart where legend markers and labels are displayed. |
public Rectangle getLegendRect ( ); public void setLegendRect ( Rectangle newValue ); public void setLegendRect ( Rectangle newValue, boolean bSetRecalc ); |
Rectangle: location/size of legend areabSetRecalc: true = recalculate entire chart based on new legend rectangle / false = do not recalculate |
getLegendRect: Rectangle = location/size of legend rectangle |
/* This example sets the size and location of the legend rectangle directly over the chart rectangle */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import java.awt.Point; import java.awt.Rectangle; import TDG.Perspective; public class Applet1 extends Applet { public void init() { Point myPoint=null; Rectangle myRect=null; IdentObj id; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); myPoint = perspective1.getFrameDepthOffset(); myRect = perspective1.getFrameRect(true); perspective1.setLegendRect(myRect,true); perspective1.setBounds(0,0,300,200); add(perspective1); //}} } TDG.Perspective perspective1; } |
LegendAutomatic, LegendDisplay, LegendMarkerPosition, LegendReverse, LegendTextAutofit |
get/setLineWidth
This method defines the thickness (in pixels) the series line is drawn in a line chart. See "Getting an Object ID" at the beginning of this chapter for a list of methods that can be used to get the ID of a line object. |
public int getLineWidth (IdentObj id) public void setLineWidth( IdentObj id, int newValue ) |
id: the object ID of a series linenewValue: line width in pixels |
getLineWidth: int = the wdith of the data line in pixels |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setGraphType(53); id = perspective1.getLineRiser(); perspective1.setLineWidth(id,1); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setLogScale()
These methods can be used to set/determine use of the logarithmic scale on an axis. You may also use one of the axis-specific properties/methods to set/determine whether or not the logarithmic scale is used on a particular axis (e.g., X1LogScale(), Y1LogScale(), Y2LogScale(), etc.). |
public boolean getLogScale ( ); public boolean getLogScale ( IdentObj id ); public boolean getLogScale ( int objectID ); public void setLogScale ( boolean newValue ); public void setLogScale ( IdentObj id, boolean newValue ); public void setLogScale ( int objectID, boolean newValue ); |
id or objectID: Object IDnewValue: TRUE = logarithmic scale is used / FALSE = logarithmic scale is not used |
getLogScale(): TRUE = logarithmic scale is used / FALSE = logarithmic scale is not used setLogScale(): None |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { IdentObj id; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setAutofit(false); perspective1.setFontSize(24); perspective1.setDepthAngle(0); perspective1.setDepthRadius(0); perspective1.setGraphType(17); perspective1.setData(0,0,1); perspective1.setData(0,1,2); perspective1.setData(0,2,3); perspective1.setData(0,3,4); id = perspective1.getY1Axis(); perspective1.setLogScale(id,true); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setMarkerShape()
These methods can be used to set/determine the shape of a marker object in a chart. If no object ID (id) or series ID (seriesID) is specified, the method sets/returns the marker shape (if any) for the first item in the selection list. |
public int getMarkerShape ( ); public int getMarkerShape ( IdentObj id ); public int getMarkerShape ( int seriesID ); public void setMarkerShape ( int newValue ); public void setMarkerShape ( IdentObj id, int newValue ); public void setMarkerShape ( int seriesID, int newVaue ); |
id : Object IDseriesID: a series number newValue: a value 0...6 (0 = Null, 1 = Square, 2 = Circle, 3 = Diamond, 4 = Plus, 5 = Triangle/Down, 6 = Triangle/Up) |
getMarkerShape(): int = a value 0...6 (0 = Null, 1 = Square, 2 = Circle, 3 = Diamond, 4 = Plus, 5 = Triangle/Down, 6 = Triangle/Up) setMarkerShape(): None |
import TDG.Perspective; public class Applet1 extends Applet { public void init() { setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(41); perspective1.setData(0,0,1); perspective1.setData(0,1,2); perspective1.setData(0,2,3); perspective1.setData(0,3,4); perspective1.setData(1,0,11); perspective1.setData(1,1,12); perspective1.setData(1,2,13); perspective1.setData(1,3,14); perspective1.setSeriesLabel (0,"Series 0"); perspective1.setSeriesLabel (1,"Series 1"); perspective1.setMarkerShape(0,2); perspective1.setMarkerShape(1,3); perspective1.setMarkerSize(4000); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setMarkerSize()
These methods can be used to get/set the size of a marker in a chart. If no object ID (id) or series ID (seriesID) is specified, the method sets/returns the size of the marker (if any) for the first item in the selection list. |
public int getMarkerSize ( ); public int getMarkerSize ( IdentObj id ); public int getMarkerSize ( int seriesID ); public int getMarkerSize ( int seriesID, int groupID ); public void setMarkerSize ( int newValue ); public void setMarkerSize ( int seriesID, int newValue ); public void setMarkerSize ( int seriesID, int groupID, int newValue ); |
id or objectID: Object IDseriesID: series number groupID: group number newValue: a value (0...100) that represents the size of a marker |
getMarkerSize(): int = a value (0...100) that represents the size of a marker setMarkerSize (): None |
import TDG.Perspective; public class Applet1 extends Applet { public void init() { setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(41); perspective1.setData(0,0,1); perspective1.setData(0,1,2); perspective1.setData(0,2,3); perspective1.setData(0,3,4); perspective1.setData(1,0,11); perspective1.setData(1,1,12); perspective1.setData(1,2,13); perspective1.setData(1,3,14); perspective1.setSeriesLabel (0,"Series 0"); perspective1.setSeriesLabel (1,"Series 1"); perspective1.setMarkerShape(0,2); perspective1.setMarkerShape(1,3); perspective1.setMarkerSize(4000); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setMarkerShape, get/setMarkerTemplate, get/setMarkerTemplateIndex, and the MarkerDisplay and MarkerSizeDefault properties in Chapter 7. |
get/setMarkerTemplate()
public MarkerTemplate getMarkerTemplate ( IdentObj id ); public void setMarkerTemplate ( IdentObj id, MarkerTemplate newValue ); |
id: Identification number of an object in a chartnewValue: 0...6 (0 = Null, 1 = Square, 2 = Circle, 3 = Diamond, 4 = Plus, 5 = Triangle/Down, 6 = Triangle/Up) |
getMarkerTemplete(): MarkerTemplate 0...6 (0 = Null, 1 = Square, 2 = Circle, 3 = Diamond, 4 = Plus, 5 = Triangle/Down, 6 = Triangle/Up) setMarkerTemplate(): None |
get/setMarkerShape, get/setMarkerSize, get/setMarkerTemplateIndex, and the MarkerDisplay and MarkerSizeDefault properties in Chapter 7. |