8. Methods


This chapter describes the Perspective methods in the TDG.Perspective class. Each method is defined in the following format:

Description:

This section describes the operation of the method.

Syntax:

This section identifies the method coding syntax.

Input Parameters:

This section defines the input parameters to the method. Most methods are overloaded and may be called with several different combinations of input parameters.

Return Values:

This section defines the method's return values (if any).

Code Sample:

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.

Example Results:

Where possible, this section shows a graphical representation of the chart before and/or after the code sample was executed.

Notes:

This section provides additional information about using the method.

Also See:

This section identifies other methods and properties that interact with the method.

Getting an Object ID


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

Code Sample:
 

/*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;
}

Class Constructors


Description:

This method is the TDG.Perspective class constructor. It creates an instance of Perspective.

Syntax:

public class Perspective ( );

public class Perspective ( Applet a );

public class PerspectiveBase ( );

Input Parameters:

a: Applet (optional)

Return Values:

class

Code Sample:
 

/*
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.setBounds(0,0,300,200);
		add(perspective1);
	}
	TDG.Perspective perspective1;
}

Add/RemovePerspectiveListener()


Description:

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).

Syntax:

public static final synchronized void addPerspectiveListener (
TDGListener listener );

public removePerspectiveListener ( TDGListener );

Input Parameters:

listener:

Return Values:

None

Code Sample:
 

/*	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);
		}
}
void perspective1_mouseClicked(java.awt.event.MouseEvent event)
	{
		perspective1.clearDataStorage();
	}
	class SymTDG implements TDG.event.TDGListener
	{
		public void perspectiveEvent(TDG.event.TDGEvent event)
		{
			Object object = event.getSource();
			if (object == perspective1)
				perspective1_perspectiveEvent(event);
		}
	}
}

announceLicense ()


Description:

This method directs the product licensing information to SysOut.

Syntax:

public static void announceLicense ();

Input Parameters:

None

Return Values:

None

 

clearDataStorage()


Description:

This method clears all data and labels from a chart.

Syntax:

public void clearDataStorage ();

Input Parameters:

None

Return Values:

None

Code Sample:
 

/*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);
		//{{REGISTER_LISTENERS
		SymMouse aSymMouse = new SymMouse();
		perspective1.addMouseListener(aSymMouse);
		SymTDG lSymTDG = new SymTDG();
		perspective1.addPerspectiveListener(lSymTDG);
		//}}
	}
	//{{DECLARE_CONTROLS
	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);
		}
	}
	void perspective1_mouseClicked(java.awt.event.MouseEvent event)
	{
		// to do: code goes here.
		perspective1.clearDataStorage();
	}
	class SymTDG implements TDG.event.TDGListener
	{
		public void perspectiveEvent(TDG.event.TDGEvent event)
		{
			Object object = event.getSource();
			if (object == perspective1)
				perspective1_perspectiveEvent(event);
		}
	}
}

focusCube()


Description:

This method sets the focus factor of a cube in a 3D graph.

Syntax:

public void focusCube (
double focusFactor
);

Input Parameters:

focusFactor = 15000...75000

Return Values:

None

Code Sample:
 

/*
	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;
}
Also See:

The CubeFocusFactor property in Chapter 7.

getApplet()


Description:

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.

Syntax:

public Applet getApplet ( );

Input Parameters:

None

Return Values:

Applet = the current applet

get/setAutofit()


Description:

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.

Syntax:

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);

Input Parameters:

id = Object ID

objectID = Object Number

newValue = TRUE = enable autofitting/FALSE = disable autofitting

Return Values:

getAutofit(): TRUE = Autofit enabled/FALSE = Autofit disabled

setAutofit(): None

Code Sample:
 

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;
}
Also See:

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()


Description:

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.

Syntax:

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 );

Input Parameters:

None

id = Object ID

seriesID = Series Number

newValue = 0 = Y1/1=Y2

Return Values:

getAxisAssignment(): 0 = Y1/1 = Y2
setAxisAssignment(): None

Code Sample:
 

<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>
Also See:

get/setAxisDescending (),get/setAxisSide() and the following properties in Chapter 7: Y1AxisSide and Y2AxisSide

get/setAxisDescending()


Description:

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.

Syntax:

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 );

Input Parameters:

None

id = Object ID

objectID = Object Number

newValue = TRUE for descending/FALSE for ascending

Return Values:

getAxisDescending(): TRUE = Descending/FALSE = Ascending
setAxisDescending(): None

Code Sample:
 

/*	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;
}
Also See:

get/setAxisAssignment(),get/setAxisSide() and the following properties in Chapter 7: X1AxisDescending, Y1AxisDescending, and Y2AxisDescending

get/setAxisSide()


Description:

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.

Syntax:

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 );

Input Parameters:

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

Return Values:

getAxisSide(): 0 = Left (or bottom for Horizontal charts), 1=right (or top for Horizontal charts), 2=Both sides of chart

setAxisSide(): None

Code Sample:
 

/*	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;
}
Also See:

get/setAxisAssignment(), get/setAxisDescending() and the following properties in Chapter 7: O1AxisSide, X1AxisSide, Y1AxisSide, and Y2AxisSide

get/setBorderColor()


Description:

These methods can be used get/set the border color attribute of an object in a chart.

Syntax:

public color getBorderColor ( IdentObj id );

public void setBorderColor ( Color newValue );

public void setBorderColor ( IdentObj id, Color newValue );

Input Parameters:

id: Object ID

Color: value of color to be assigned to border

Return Values:

getBorderColor(): color: A color value

setBorderColor(): None

Code Sample:
 

/*
	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;
}
Also See:

get/setFillColor(), get/setSelectionBorderColor, get/setTransparentBorderColor(),selectionHasTransparentBorderColor(), setSeriesBorderColor(), and the ColorMode property in Chapter 7.

getChartDataValid()


Description:

This method can be used to determine whether or not chart data is valid.

Syntax:

public boolean getChartDataValid( );

Input Parameters:

None

Return Values:

TRUE = Chart data is valid/FALSE = Chart data is not valid

Code Sample:
 

if ( getChartDataValid() == true ) {
if (m_chart != null) {
long t1 = System.currentTimeMillis();
m_chart.calc();
if ( m_chart.m_Legend != null )
m_chart.m_Legend.calc();
long t2 = System.currentTimeMillis();
System.out.println("calc time (ms) = " + (t2-t1));
}

getChartFromFTP()


Description:

This method can be used to get a chart from an FTP server.

Syntax:

public boolean getChartFromFTP (
String strHost,/* Host Name */
String strUser,/* User Name */
String strPass,/* Password */
String strDir,/* Directory Name */
String strDestFile/* File Name */
);

Input Parameters:

strHost: Host Name

strUser: User Name

strPass: Password

strDir: Directory location

strDestFile: File Name

Return Values:

TRUE = Successful/FALSE = Unsuccessful

Code Sample:
 

/*
	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;
}
Also See:

sendChartToFTP(), sendGIFToFTP ()

get/setCubeRotationMatrix()


Description:

This method get/set the rotation matrix of a 3D chart.

Syntax:

public Matrix3d getCubeRotationMatrix ( );

public void setCubeRotationMatrix ( double rx, double ry, double rq );

public void setCubeRotationMatrix (Matrix3d m);

Input Parameters:

rx; rotation in x direction

ry: rotation in y direction

rz: rotation in z direction

m: Matrix 3D in the format shown below

Return Values:

setRotationMatrix(): None

getRotationMatrix(): Matrix3d =

 

public class Matrix3d implements java.io.Serializable
{
public double m00;// row 0, col 0
public double m01;// row 0, col 1
public double m02;
public double m10;
public double m11;
public double m12;
public double m20;
public double m21;
public double m22;

Code Sample:
 

/* 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;
}
Notes:

The default setting is: setCubeRotationMatrix (0.7071067811865474,
0.0, 0.7071067811865477, -0.3535533905932738, 0.8660254037844387, 0.3535533905932736, -0.6123724356957947, -0.49999999999999994, 0.6123724356957945);

Also See:

rotateCubeX(), rotateCubeY(), rotateCubeZ()

 

getCurrentMatrix()


Description:

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.

Syntax:

public Matrix4d getCurrentMatrix ( );

Input Parameters:

None

Return Values:

Matrix4d = the current matrix

 

public class Matrix4d
{
public static final int ROT_X = 0;
public static final int ROT_Y = 1;
public static final int ROT_Z = 2;
public double m00; // row 0, col 0
public double m01; // row 0, col 1
public double m02;
public double m03;
public double m10;
public double m11;
public double m12;
public double m13;
public double m20;
public double m21;
public double m22;
public double m23;
public double m30;
public double m31;
public double m32;
public double m33;

Code Sample:
 

/*
	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;
}
Also See:

getCurrentViewer()

getCurrentViewer()


Description:

This method returns the X-, Y-, and Z- coordinates of the current viewer.

Syntax:

public Point3d getCurrentViewer ();

Input Parameters:

None.

Return Values:
 

Point3d = the current viewer

 

public class Point3d
{
public double x;
public double y;
public double z;

Code Sample:
 

/*
	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;
}
Also See:

getCurrentMatrix()

getDataAsDouble()


Description:

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.

Syntax:

public double getDataAsDouble (
int s, /* Series */
int g,/* Group */
DataItem item/* Data Item */

);

Input Parameters:

s: Series from which to retrieve data

g: Group from which to retrieve data

item: Data item

Return Values:

double = the data at the specified row and column

Code Sample:
 

/*	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);
	}
}
Also See:

getDataAsString()

getDataAsString()


Description:

This method gets a value for any series/group intersection and converts it to a string.

Syntax:

public string getDataAsString (
int row, /* Chart Row */
int col /* Chart Column */

);

Input Parameters:

row: Chart row from which to get value

col: Chart column from which to get value

Return Values:

string = Character string at row,col

Code Sample:
 

/*	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);
	}
}
Also See:

getDataAsDouble()

getDataCoord()


Description:

This method gets the coordinates of an object in a chart.

Syntax:

public int getDataCoord (
IdentObj id /* Object ID */

);

Input Parameters:

id: Identification number of an object in a chart

Return Values:

int = x,y coordinates of an object in a chart

Also See:

getDataFromCoord()

getDataFromCoord()


Description:

This method gets a data value for an object at a specified coordinates in a chart.

Syntax:

public double getDataFromCoord (
IdentObj id, /* Object ID */
int nCoordVC /* Object Coordnance */

);

Input Parameters:

id: Identification number of an object in a chart

nCoordVC: Virtual coordnance of object

Return Values:

double = the data at the specified coordinates

Also See:

getDataCoord()

get/setDataLabel()


Description:

These methods get/set a label string at a specified series (s) and group (g).

Syntax:

public String getDataLabel ( int s, int g );

public void setDataLabel ( int s, int g, String newValue );

Input Parameters:

s: Series number

g: Group number

newValue: Data label string

Return Values:

getDataLabel(): String = the data label at series (s)/group (g)

setDataLabel(): None

Code Sample:
 

/*
	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;
}
Also See:

get/setGroupLabel(), get/setSeriesLabel(). For HTML ONLY, see setSeriesLabelArray() and setGroupLabelArray() in Chapter 4.

get/setDataTextAngle ()


Description:

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.

Syntax:

public int getDataTextAngle ( );
public int getDataTextAngle ( IdentObj id );
public int getDataTextAngle ( int seriesID );
public int getDataTextAngle ( int seriesID, int groupID );
public void setDataTextAngle ( int newValue);
public void setDataTextAngle ( IdentObj id, int newValue );
public void setDataTextAngle ( int seriesID, int newValue );
public void setDataTextAngle(int seriesID, int groupID, int newValue );

Input Parameters:

id: Object ID
seriesID: Series number
groupID: Group number
newValue: Data text angle (0...360)

Return Values:

getDataTextAngle(): int = the data text angle (0...360)
setDataTextAngle(): None

Code Sample:
 

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;
}
Notes:

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.

Also See:

get/setDataTextRadius and the following properties in Chapter 7: DataTextAngleDefault, DataTextDisplay, DataTextPosition

get/setDataTextRadius ()


Description:

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.

Syntax:

public int getDataTextRadius ( );
public int getDataTextRadius ( IdentObj id );
public int getDataTextRadius ( int seriesID );
public int getDataTextRadius ( int seriesID, int groupID );
public void setDataTextRadius ( int newValue );
public void setDataTextRadius ( IdentObj id, int newValue );
public void setDataTextRadius ( int seriesID, int newValue );
public void setDataTextRadius(int seriesID,int groupID,int newValue);

Input Parameters:

id: Object ID
seriesID: Series number
groupID: Group number
newValue: Data text radius (0...100)

Return Values:

getDataTextRadius(): int = the data text radius (0...100)
setDataTextRadius(): None

Code Sample:
 

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;
}
Notes:

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.

Also See:

get/setDataTextAngle and the following properties in Chapter 7: DataTextRadiusDefault, DataTextDisplay, DataTextPosition

get/setDataValue()


Description:

These methods get/set a data value for a specific data object (riser) in a chart.

Syntax:

public double getDataValue ( IdentObj id );

public void setDataValue ( IdentObj id, double newValue );

Input Parameters:

id: Object ID

newValue: data value to be assigned to the object

Return Values:

getDataValue(): double = data value at id

setDataValue(): None

Code Sample:
 

/*
	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 ()


Description:

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);.

Syntax:

public boolean getDisplay ( );
public boolean getDisplay ( IdentObj id );
public boolean getDisplay ( int objectID );
public void setDisplay ( boolean newValue);
public void setDisplay ( IdentObj id, boolean newValue );
public void setDisplay ( int objectID, boolean newValue );

Input Parameters:

id or objectID: Object ID
newValue: True = Object is displayed/False = Object is not imaged

Return Values:

getDisplay(): True = Object is displayed/False = Object is not imaged
setDisplay(): None

Code Sample:
 

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;
}
Also See:

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()


Description:

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.).

Syntax:

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 );

Input Parameters:

id or objectID: Identification number of an object in a chart

newValue: TRUE = off scale values are imaged /FALSE = offscale values are not imaged

Return Values:

getDisplayOffScale(): boolean: TRUE = off scale values are imaged / FALSE = offscale values are not imaged

setDisplayOffScale: None

Code Sample:
 

/*
	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;
}
Also See:

X1OffScaleDisplay, Y1OffScaleDisplay, Y2OffScaleDisplay

getDocumentBase()


Description:

This method gets the document URL.

Syntax:

public URL getDocumentBase ( );

Input Parameters:

None

Return Values:

URL = document URL

Code Sample:
 

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 ()


Description:

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.).

Syntax:

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);

Input Parameters:

id or objectID: Identifies an axis in the chart where you want to determine whether or not the max label is excluded

newValue: TRUE = exclude max label at axis identified by id or objectID / FALSE = do not exclude max label at the specified axis.

Return Values:

getExcludeMaxLabel(): TRUE = Max labels are excluded/FALSE = Max labels are included

setExcludeMaxLabel(): None

Code Sample:
 

/*
	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;
}
Also See:

get/setExcludeMinLabel, O1ExcludeMaxLabel, O2ExcludeMaxLabel, X1ExcludeMaxLabel, Y1ExcludeMaxLabel, Y2ExcludeMaxLabel.

get/setExcludeMinLabel ()


Description:

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.).

Syntax:

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);

Input Parameters:

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

Return Values:

getExcludeMinLabel(): TRUE = Min labels are excluded / FALSE = Min labels are included

setExcludeMinLabel(): None

Code Sample:
 

/*
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.setExcludeMinLabel (id, false); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; }
Also See:

get/setExcludeMaxLabel, O1ExcludeMinLabel, O2ExcludeMinLabel, X1ExcludeMinLabel, Y1ExcludeMinLabel, Y2ExcludeMinLabel.

get/setFillColor()


Description:

These method set/get the value of a fill color for a particular object in a chart.

Syntax:

public Color getFillColor ( IdentObj id );

public void setFillColor ( Color newValue );

public void setFillColor ( IdentObj id, Color newValue );

Input Parameters:

id: Identification number of an object in a chart

newValue: the value of the fill color

Return Values:

getFillColor(): Color = the value of the fill color for the object identified by id, null = no fill color applied

setFillColor(): None

Code Sample:
 

/*
	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;
}
Notes:

The fill type must be set to color with setFillType(1);

Also See:

get/setBorderColor, get/setFillType, getSelectionFillColor, get/setTransparentFillColor, selectionHasTransparentFillColor, setSeriesFillColor

get/setFillType()


Description:

These methods get/set the fill type for a particular object in a chart.

Syntax:

public int getFillType ( IdentObj id );

public void setFillType ( int newValue );

public void setFillType ( IdentObj id, int newValue );

Input Parameters:

id: Identification number of an object in a chart

newValue: fill type (1=Color, 2=Gradient, 3=Texture)

Return Values:

getFillType(): int = the fill type of the object identified by id (1=Color, 2=Gradient, 3=Texture)

setFillType(): None

Code Sample:
 

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;
}
Notes:

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.

Also See:

get/setTexture, get/setTextureDisplayMode, get/setGradientNumPins, get/setGradientPinLeftColor, get/setGradientPinRightColor, get/setGradientPinPosition

get/setFontName()


Description:

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.

Syntax:

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);

Input Parameters:

id or objectID: Identifies an object in the chart to get a font name from.

newValue: Font name string

Return Values:

getFontName(): String = font name, null = no font name applied at id or objectID

setFontName(): None

Code Sample:
 

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");
Also See:

get/setFontSizeVC, get/setFontStyle, setFontSize

get/setFontSizeVC()


Description:

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.

Syntax:

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 );

Input Parameters:

id or objectID: identifies a specific object in a chart.

newValue: Font size in virtual coordinates

Return Values:

getFontSizeVC(): int = the font size in virtual coordinates.

setFontSizeVC(): None

Code Sample:
 

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);
Notes:

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.

Also See:

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 ()


Description:

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.

Syntax:

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 );

Input Parameters:

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)

Return Values:

getFontStyle(): int = font style (0=Plain, 1=Italic, 2=Bold, 3=Italic/Bold, 4=Underline, 5=Italic/Underline)

setFontStyle(): None

Code Sample:
 

/*	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;
}
Also See:

get/setFontSizeVC, get/setFontName, setFontSize

getFrameDepthOffset


Description:

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.

Syntax:

public Point getFrameDepthOffset ( );

Input Parameters:

None

Return Values:

Point = frame depth in 2.5D

Code Sample:
 

/*
	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;
}
Also See:

DepthAngle and DepthRadius in Chapter 7

getFrameRect()


Description:

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.

Syntax:

public Rectangle getFrameRect (
boolean bInner

);

Input Parameters:

bInner: true = inner edge of frame / false = outer edge of frame

Return Values:

Rectangle = size of the frame in virtual coordinates

Code Sample:
 

/*
	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;
}
Also See:

get/setRect

get/setGradientDirection()


Description:

These methods get/set the direction of the gradient applied to an object in a chart.

Syntax:

public int getGradientDirection ( IdentObj id );
public void setGradientDirection (int newValue );
public void setGradientDirection (IdentObj id, int newValue);

Input Parameters:

id: Identification number of an object in a chart

newValue: 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)

Return Values:

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

Code Sample:
 

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;
}
Notes:

The fill type for the selected object must be set to two with the method setFillType(2).

Also See:

get/setFillType, get/setGradientNumPins, get/setGradientPinLeftColor, get/setGradientPinRightColor, get/setGradientPinPosition

get/setGradientNumPins()


Description:

These methods get/set the number of pins in a gradient applied to a particular object in a chart.

Syntax:

public int getGradientNumPins ( IdentObj id );

public void setGradientNumPins ( int newValue );

public void setGradientNumPins ( IdentObj id, int newValue );

Input Parameters:

id: Identification number of an object in a chart

newValue: Number of pins in gradient

Return Values:

getGradientNumPins(): int = Number of pins in gradient

setGradientNumPins(): None

Code Sample:
 

/*	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;
}
Notes:

The fill type for the selected object must be set to two with the method setFillType(2).

Also See:

get/setFillType, get/setGradientDirection, get/setGradientPinLeftColor, get/setGradientPinRightColor, get/setGradientPinPosition

get/setGradientPinLeftColor()


Description:

These methods get/set the color value of the left pin of a gradient for an object in a chart.

Syntax:

public Color getGradientPinLeftColor ( IdentObj id, int nIndex );

public void setGradientPinLeftColor ( Color newValue, int nIndex );

public void setGradientPinLeftColor ( IdentObj id, Color newValue,
int nIndex );

Input Parameters:

id: Identification number of an object in a chart
nIndex:
newValue: the color value of the left pin in a gradient

Return Values:

getGradientPinLeftColor(): the color value of the left pin in a gradient
setGradientPinLeftColor(): None

Code Sample:
 

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;
}
Notes:

The fill type for the selected object must be set to two with the method setFillType(2).

Also See:

get/setFillType, get/setGradientDirection, get/setGradientNumPins, get/setGradientPinRightColor, get/setGradientPinPosition

get/setGradientPinPosition()


Description:

These methods get/set the pin position of a gradient for an object in a chart.

Syntax:

public double getGradientPinPosition ( IdentObj id, int nIndex );

public void setGradientPinPosition ( double newValue, int nIndex );

public void setGradientPinPosition ( IdentObj id, double NewValue,
int nIndex );

Input Parameters:

id: Identification number of an object in a chart
nIndex:
newValue: position in the gradient (0.0 to 1.0)

Return Values:

getGradientPinPosition(): double = position in the gradient (0.0 to 1.0)
setGradientPinPosition (): None

Code Sample:
 

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;
}
Notes:

The fill type for the selected object must be set to two with the method setFillType(2).

Also See:

get/setFillType, get/setGradientDirection, get/setGradientNumPins, get/setGradientPinRightColor, get/setGradientPinLeftColor

get/setGradientPinRightColor()


Description:

These methods get/set the color value of the right pin of a gradient for an object in a chart.

Syntax:

public Color getGradientPinRightColor ( IdentObj id, int nIndex );

public void setGradientPinRightColor ( Color newValue, int nIndex );

public void setGradientPinRightColor ( IdentObj id, Color newValue,
int nIndex );

Input Parameters:

id: Identification number of an object in a chart

nIndex:

newValue: the color value of the right pin in a gradient

Return Values:

getGradientPinRightColor(): the color value of the right pin in a gradient

setGradientPinRightColor (): None

Code Sample:
 

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;
}
Notes:

The fill type for the selected object must be set to two with the method setFillType(2).

Also See:

get/setFillType, get/setGradientDirection, get/setGradientNumPins, get/setGradientPinPosition, get/setGradientPinLeftColor

get/setGridCount()


Description:

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.

Syntax:

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 );

Input Parameters:

id or objectID: Object ID

Return Values:

int = the number of grid lines for the object specified by id or objectID

Also See:

O1MinorGridCount

get/setGridStep ()


Description:

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.

Syntax:

public double getGridStep ( );
public double getGridStep ( IdentObj id );
public double getGridStep ( int objectID );
public void setGridStep ( double newValue );
public void setGridStep ( IdentObj id, double newValue );
public void setGridStep ( int objectID, double newValue );

Input Parameters:

id or objectID: identifies an object in the chart
newValue: the number of grid steps on an axis

Return Values:

getGridStep(): double = the number of grid steps on an axis
setGridStep (): None

Code Sample:
 

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;
}
Also See:

get/setGridStepAuto, X1MajorGridStep, X1MajorGridStepAuto, X1MinorGridStep, X1MinorGridStepAuto, Y1MajorGridStep, Y1MajorGridStepAuto, Y1MinorGridStep, Y1MinorGridStepAuto

get/setGridStepAuto()


Description:

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.

Syntax:

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 );

Input Parameters:

id or objectID: identifies a specific object in a chart

newValue: TRUE = grid steps are automatically calculated / FALSE = grid steps are not automatically calculated

Return Values:

getGridStepAuto(): TRUE = grid steps are automatically calculated / FALSE = grid steps are not automatically calculated

setGridStepAuto (): None

Code Sample:
 

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;
}
Also See:

get/setGridStep, X1MajorGridStepAuto, X1MinorGridStepAuto, Y1MajorGridStepAuto, Y1MinorGridStepAuto

get/setGridStyle()


Description:

These methods can be used to get/set the style of grids on a particular axis in a chart.

Syntax:

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);

Input Parameters:

id or objectID: Object ID

newValue: 0...5 (0=No Grid, 1=Normal Grid, 2=Grid and Ticks, 3=Inner Ticks, 4=Outer Ticks, 5=Spanned Ticks)

Return Values:

getGridStyle(): grid style value 0...5

setGridStyle(): None

Code Sample:
 

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.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.setGridStepAuto(id,false);
perspective1.setGridStep(id,2);
id = perspective1.getY1MajorGrid();
perspective1.setGridStyle(id,3);
perspective1.setBounds(0,0,300,200);
add(perspective1);
}
TDG.Perspective perspective1;
}
Also See:

O1MajorGridStyle, O1MinorGridStyle, X1MajorGridStyle, X1MinorGridStyle, Y1MajorGridStyle, Y1MinorGridStyle, Y2MajorGridStyle, Y2MinorGridStyle

get/setGroupLabel()


Description:

These methods can be used to get and set a group label in a chart.

Syntax:

public String getGroupLabel ( );
public String getGroupLabel ( IdentObj id );
public String getGroupLabel ( int groupID );
public void setGroupLabel ( IdentObj id, String newValue );
public void setGroupLabel ( int g, String newValue);
public void setGroupLabel ( String newValue );

Input Parameters:

id = an object ID
groupID = a group number

Return Values:

getGroupLabel(): String = group label
setGroupLabel(): None

Code Sample:
 

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;
}
Example Results:

Also See:

get/setDataLabel, get/setSeriesLabel

get/setLabelStagger()


Description:

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.).

Syntax:

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 );

Input Parameters:

id or objectID: Object ID

newValue: TRUE = labels are staggered / FALSE = labels are not staggered

Return Values:

getLabelStagger(): TRUE = labels are staggered / FALSE = labels are not staggered

setLabelStagger (): None

Code Sample:
 

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;
}
Also See:

O1LabelStagger, X1LabelStagger, Y1LabelStagger

get/setLegendRect()


Description:

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.

Syntax:

public Rectangle getLegendRect ( );

public void setLegendRect ( Rectangle newValue );

public void setLegendRect ( Rectangle newValue, boolean bSetRecalc );

Input Parameters:

Rectangle: location/size of legend area

bSetRecalc: true = recalculate entire chart based on new legend rectangle / false = do not recalculate

Return Values:

getLegendRect: Rectangle = location/size of legend rectangle
setLegendRect: None

Code Sample:
 

/*
	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;
}
Also See:

LegendAutomatic, LegendDisplay, LegendMarkerPosition, LegendReverse, LegendTextAutofit

get/setLineWidth


Description:

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.

Syntax:

public int getLineWidth (IdentObj id)

public void setLineWidth( IdentObj id, int newValue )

Input Parameters:

id: the object ID of a series line

newValue: line width in pixels

Return Values:

getLineWidth: int = the wdith of the data line in pixels
setLineWidth: None

Code Sample:
 

/*
	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()


Description:

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.).

Syntax:

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 );

Input Parameters:

id or objectID: Object ID

newValue: TRUE = logarithmic scale is used / FALSE = logarithmic scale is not used

Return Values:

getLogScale(): TRUE = logarithmic scale is used / FALSE = logarithmic scale is not used

setLogScale(): None

Code Sample:
 

/*	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;
}

Also See:

X1LogScale, Y1LogScale, Y2LogScale

get/setMarkerShape()


Description:

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.

Syntax:

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 );

Input Parameters:

id: Object ID

seriesID: a series number

newValue: a value 0...6 (0 = Null, 1 = Square, 2 = Circle, 3 = Diamond, 4 = Plus, 5 = Triangle/Down, 6 = Triangle/Up)

Return Values:

getMarkerShape(): int = a value 0...6 (0 = Null, 1 = Square, 2 = Circle, 3 = Diamond, 4 = Plus, 5 = Triangle/Down, 6 = Triangle/Up)

setMarkerShape(): None

Code Sample:
 

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;
}
Also See:

get/setMarkerSize()


Description:

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.

Syntax:

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 );

Input Parameters:

id or objectID: Object ID

seriesID: series number

groupID: group number

newValue: a value (0...100) that represents the size of a marker

Return Values:

getMarkerSize(): int = a value (0...100) that represents the size of a marker

setMarkerSize (): None

Code Sample:
 

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;
}
Also See:

get/setMarkerShape, get/setMarkerTemplate, get/setMarkerTemplateIndex, and the MarkerDisplay and MarkerSizeDefault properties in Chapter 7.

get/setMarkerTemplate()


Description:
Syntax:

public MarkerTemplate getMarkerTemplate ( IdentObj id );

public void setMarkerTemplate ( IdentObj id, MarkerTemplate newValue );

Input Parameters:

id: Identification number of an object in a chart

newValue: 0...6 (0 = Null, 1 = Square, 2 = Circle, 3 = Diamond, 4 = Plus, 5 = Triangle/Down, 6 = Triangle/Up)

Return Values:

getMarkerTemplete(): MarkerTemplate 0...6 (0 = Null, 1 = Square, 2 = Circle, 3 = Diamond, 4 = Plus, 5 = Triangle/Down, 6 = Triangle/Up)

setMarkerTemplate(): None

Also See:

get/setMarkerShape, get/setMarkerSize, get/setMarkerTemplateIndex, and the MarkerDisplay and MarkerSizeDefault properties in Chapter 7.