get/setMarkerTemplateIndex()
This method assigns a marker template index to an object or series in a chart. |
public int getMarkerTemplateIndex ( ); public int getMarkerTemplateIndex ( IdentObj id ); public int getMarkerTemplateIndex ( int seriesID ); public void setMarkerTemplateIndex ( IdentObj id, int integerMarkerTemplate ); public void setMarkerTemplateIndex ( IdentObj id, int newValue ); public void setMarkerTemplateIndex ( int newValue ); public void setMarkerTemplateIndex ( int seriesID, int newValue ); |
id : Object IDseriesID: series number newValue: = 0...6 (0 = Null, 1 = Square, 2 = Circle, 3 = Diamond, 4 = Plus, 5 = Triangle/Down, 6 = Triangle/Up) |
getMarkerTempleteIndex(): 0...6 (0 = Null, 1 = Square, 2 = Circle, 3 = Diamond, 4 = Plus, 5 = Triangle/Down, 6 = Triangle/Up). setMarkerTemplateIndex(): 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(41); perspective1.setData(0,0,1); perspective1.setData(0,1,2); perspective1.setData(1,0,11); perspective1.setData(1,1,12); perspective1.setSeriesLabel (0,"Series 0"); perspective1.setSeriesLabel (1,"Series 1"); id = perspective1.getSeries(0); perspective1.setMarkerTemplateIndex(id,4); id = perspective1.getSeries(1); perspective1.setMarkerTemplateIndex(id,3); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setMarkerShape, get/setMarkerSize, get/setMarkerTemplate, and the MarkerDisplay and MarkerSizeDefault properties in Chapter 7. |
This method returns the minimum dimensions (height and width) of a Perspective for Java chart. |
public Dimension getMinimumSize ( ); |
None |
Dimension = the minimum size (Height=100, Width=100) |
/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import java.awt.Dimension; import TDG.Perspective; public class Applet1 extends Applet { public void init() { Dimension MinDim; setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); MinDim=perspective1.getMinimumSize(); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
This method is used to determine the number of groups in a chart. |
public int getNumGroups ( ); |
None |
int = Number of groups in the chart |
/* 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() { int i; setLayout(null); setSize(426,266); perspective1 = new TDG.Perspective(); perspective1.setBounds(0,0,426,266); i = perspective1.getNumGroups(); perspective1.setO1LabelWrap(true); perspective1.setO1LabelAutofit(false); perspective1.setGroupLabel(i-1,"This is the largest group"); add(perspective1); } TDG.Perspective perspective1; } |
This method gets the number of series in a chart. |
public int getNumSeries ( ); |
None |
int = Number of series in the chart |
/* 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() { int i; setLayout(null); setSize(426,266); perspective1 = new TDG.Perspective(); i = perspective1.getNumSeries(); perspective1.setSeriesLabel(i-1,"This is the largest series"); perspective1.setBounds(0,0,426,247); add(perspective1); } TDG.Perspective perspective1; } |
get/setPieSliceDelete()
These methods can be used to set/determine whether or not pie slices have been deleted from a pie chart. |
public boolean getPieSliceDelete ( ); public boolean getPieSliceDelete ( IdentObj id ); public boolean getPieSliceDelete ( int seriesID ); public boolean getPieSliceDelete ( int seriesID, int groupID); public void setPieSliceDelete ( boolean newValue); public void setPieSliceDelete ( IdentObj id, boolean newValue ); public void setPieSliceDelete ( int seriesID, boolean newValue ); public void setPieSliceDelete ( int seriesID, int groupID, |
id : Object IDseriesID: series number groupID: group number newValue: TRUE = delete slice / FALSE = do not delete slice |
getPieSliceDelete(): TRUE = slices have been deleted / FALSE = slices not deleted setPieSliceDelete(): 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.setBounds(0,0,300,200); perspective1.setGraphType(55); boolean b = perspective1.getPieSliceDelete (1); if (b==false)perspective1.setPieSliceDelete(1,true); add(perspective1); } TDG.Perspective perspective1; } |
get/setPieSliceDetach and the Pie... properties in Chapter 7 |
get/setPieSliceDetach()
These methods can be used to get/set the distance a slice is detached from a pie chart. |
public int getPieSliceDetach ( ); public int getPieSliceDetach ( IdentObj id ); public int getPieSliceDetach ( int seriesID ); public int getPieSliceDetach ( int seriesID, int groupID ); public void setPieSliceDetach ( boolean newValue); public void setPieSliceDetach ( IdentObj id, boolean newValue ); public void setPieSliceDetach ( int seriesID, boolean newValue ); public void setPieSliceDetach ( int seriesID, int groupID, int newValue); |
id : Object IDseriesID: series number groupID: group number newValue: 0...100 |
getPieSliceDetach(): 0...100 setPieSliceDetach(): None |
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.setGraphType(55); 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.setPieSliceDetach (0,0,100); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setPieSliceDelete and the Pie... properties in Chapter 7. |
get/setRect()
These methods get/set the bounding rectangle for a user-movable object in virtual coordinates (x, y, width, height). See Chapter 3 for a description of the virtual coordinates and a list of user-movable objects. |
public Rectangle getRect ( ); public Rectangle getRect ( IdentObj id ); public Rectangle getRect ( int objectID ); public void setRect ( Rectangle newValue ); public void setRect ( IdentObj id, Rectangle newValue ); public void setRect ( int objectID, Rectangle newValue ); |
id or objectID: the ID number of an object in a chartRectangle: the bounding rectangle for a user-movable object in virtual coordinates (x, y, width, height) |
getRect(): Rectangle = the bounding rectangle for a user-movable object in virtual coordinates (x, y, width, height) setRect(): None |
/* 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.setLegendRect(myRect,true); id=perspective1.getFrame(); perspective1.setRect(id, myRect); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setScaleMax()
These methods get/set the maximum scale value assigned to a numeric axis in a chart. You may also use one of the axis-specific properties/methods to get/set the maximum scale on a particular axis (e.g., X1ScaleMax(), Y1ScaleMax(), Y2ScaleMax(), etc.). If getScaleMaxAuto() returns a value of TRUE or setScaleMaxAuto() sets autoscaling to TRUE, the value returned by getScaleMax() or set by setScaleMax() will be ignored. If an object ID is not specified, the method gets/sets the value of this attribute (if any) for the first item in the selection list. |
public double getScaleMax ( ); public double getScaleMax ( IdentObj id ); public double getScaleMax ( int objectID ); public void setScaleMax ( double newValue ); public void setScaleMax ( IdentObj id, double newValue ); public void setScaleMax ( int objectID, double newValue ); |
id or objectID: Object IDnewValue: a value identifying the maximum scale value on an axis |
getScaleMax(): double = the maximum value that can be used on the axis identified by id or objectID setScaleMax(): 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.setScaleMaxAuto(id,false); perspective1.setScaleMax (id,20); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setScaleMaxAuto, get/setScaleMin, get/setScaleMinAuto, and the following properties in Chapter 7: X1ScaleMax, X1ScaleMaxAuto, Y1ScaleMax, Y1ScaleMaxAuto, Y2ScaleMax, Y2ScaleMaxAuto |
get/setScaleMaxAuto()
These methods get/set automatic calculation of the maximum scale value for a numeric axis. You may also use one of the axis-specific properties to get/set automatic scaling on a particular axis (e.g., X1ScaleMaxAuto(), Y1ScaleMaxAuto(), Y2ScaleMaxAuto(), etc.). If this method returns a value of true, a value returned by getScaleMax() or set by setScaleMax() is ignored. If an object ID is not specified, this method returns the value of this attribute (if any) for the first item in the selection list. |
public boolean getScaleMaxAuto ( ); public boolean getScaleMaxAuto ( IdentObj id ); public boolean getScaleMaxAuto ( int objectID ); public void setScaleMaxAuto ( boolean newValue ); public void setScaleMaxAuto ( IdentObj id, boolean newValue ); public void setScaleMaxAuto ( int objectID, boolean newValue ); |
id or objectID: the ID number of an object in a chartnewValue: TRUE = automatically calculate maximum value on axis / FALSE = use value set by setScaleMax() |
getScaleMaxAuto(): TRUE = max value is automatically scaled / FALSE = max value is not automatically scaled setScaleMaxAuto(): 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.setScaleMaxAuto(id,false); perspective1.setScaleMax (id,20); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setScaleMax, get/setScaleMin, get/setScaleMinAuto, and the following properties in Chapter 7: X1ScaleMax, X1ScaleMaxAuto, Y1ScaleMax, Y1ScaleMaxAuto, Y2ScaleMax, Y2ScaleMaxAuto |
get/setScaleMin()
These methods get/set the minimum scale value assigned to a numeric axis in a chart. You may also use one of the axis-specific properties/methods to get/set the minimum scale on a particular axis (e.g., X1ScaleMin(), Y1ScaleMin(), Y2ScaleMin(), etc.). If getScaleMinAuto() returns a value of TRUE or setScaleMinAuto() sets autoscaling to TRUE, the value returned by getScaleMin() or set by setScaleMin() will be ignored. If an object ID is not specified, the method gets/sets the value of this attribute (if any) for the first item in the selection list. |
public double getScaleMin ( ); public double getScaleMin ( IdentObj id ); public double getScaleMin ( int objectID); public void setScaleMin ( double newValue ); public void setScaleMin ( IdentObj id, double newValue ); public void setScaleMin ( int objectID, double newValue ); |
id or objectID: the ID number of an object in a chartnewValue: the minimum scaling value that can be used on an axis |
getScaleMin(): the minimum scale value on the axis setScaleMin(): 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,11); perspective1.setData(0,1,12); perspective1.setData(0,2,13); perspective1.setData(0,3,14); id = perspective1.getY1Axis(); perspective1.setScaleMaxAuto(id,false); perspective1.setScaleMax (id,20); perspective1.setScaleMinAuto(id,false); perspective1.setScaleMin(id,10); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setScaleMax, get/setScaleMaxAuto, get/setScaleMinAuto, and the following properties in Chapter 7: X1ScaleMin, X1ScaleMinAuto, Y1ScaleMin, Y1ScaleMinAuto, Y2ScaleMin, Y2ScaleMinAuto |
get/setScaleMinAuto()
These methods get/set automatic calculation of the maximum scale value for a numeric axis. You may also use one of the axis-specific properties to get/set automatic scaling on a particular axis (e.g., X1ScaleMinAuto(), Y1ScaleMinAuto(), Y2ScaleMinAuto(), etc.). If these methods set or returns a value of true, a value returned by getScaleMin() or set by setScaleMin() is ignored. |
public boolean getScaleMinAuto ( ); public boolean getScaleMinAuto ( IdentObj id ); public boolean getScaleMinAuto ( int objectID ); public void setScaleMinAuto ( boolean newValue ); public void setScaleMinAuto ( IdentObj id, boolean newValue ); public void setScaleMinAuto ( int objectID, boolean newValue ); |
id or objectID: the ID number of an object in a chartnewValue: TRUE = automatically calculate minimum value / FALSE = use value set by setScaleMin() |
getScaleMinAuto(): TRUE = min value is automatically calculated / FALSE = min value is not automatically calculated setScaleMinAuto(): 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,11); perspective1.setData(0,1,12); perspective1.setData(0,2,13); perspective1.setData(0,3,14); id = perspective1.getY1Axis(); perspective1.setScaleMaxAuto(id,false); perspective1.setScaleMax (id,20); perspective1.setScaleMinAuto(id,false); perspective1.setScaleMin(id,10); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setScaleMax, get/setScaleMaxAuto, get/setScaleMin, and the following properties in Chapter 7: X1ScaleMin, X1ScaleMinAuto, Y1ScaleMin, Y1ScaleMinAuto, Y2ScaleMin, Y2ScaleMinAuto |
get/setScaleMustIncludeZero()
These methods are used to get/set whether or not a given axis must include a zero value. You may also use one of the axis-specific properties/methods to get/set a mandatory zero on a particular axis (e.g., X1MustIncludeZero(), Y1MustIncludeZero(), Y2MustIncludeZero (), etc.). If an object ID is not specified, the method gets/set the value of this attribute (if any) for the first item in the selection list. |
public boolean getScaleMustIncludeZero ( ); public boolean getScaleMustIncludeZero ( IdentObj id ); public boolean getScaleMustIncludeZero ( int objectID ); public void setScaleMustIncludeZero ( boolean newValue ); public void setScaleMustIncludeZero(IdentObj id, boolean newValue ); public void setScaleMustIncludeZero(int objectID, boolean newValue ); |
id or objectID: the ID number of an object in a chartnewValue: TRUE = axis must include zero / FALSE = zero is not required on this axis |
getScaleMustIncludeZero(): TRUE = axis must include zero / FALSE = zero is not required on this axis setScaleMustIncludeZero(): None |
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.setGraphType(17); perspective1.setData(0,0,11); perspective1.setData(0,1,12); perspective1.setData(0,2,13); perspective1.setData(0,3,14); id = perspective1.getY1Axis(); perspective1.setScaleMaxAuto(id,false); perspective1.setScaleMax (id,20); perspective1.setScaleMinAuto(id,false); perspective1.setScaleMin(id,-10); perspective1.setScaleMustIncludeZero(id,true); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
This method gets the border color (if any) for the first item in the selection list. |
public Color getSelectionBorderColor ( ); |
None |
Color = the border color of the first item in the selection list. |
import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; 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(2); perspective1.setViewing3DAnglePreset(-1); perspective1.setData(0,0,10); perspective1.setData(0,1,11); perspective1.setData(0,2,12); perspective1.setData(0,3,13); perspective1.setSelectionEnable(3); perspective1.setBounds(0,0,300,200); add(perspective1); //{{REGISTER_LISTENERS SymMouse aSymMouse = new SymMouse(); perspective1.addMouseListener(aSymMouse); //}} } //{{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. Color myColor; IdentObj id; myColor=perspective1.getSelectionBorderColor(); id = perspective1.getCubeRightWall(); perspective1.setFillColor(id, myColor); } } |
get/setBorderColor, get/setTransparentBorderColor, selectionHasTransparentBorderColor, setSeriesBorderColor |
This method returns the fill color (if any) for the first item in the selection list. |
public Color getSelectionFillColor ( ); |
None. |
Color = the fill color of the first item in the selection list. |
import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; 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(2); perspective1.setViewing3DAnglePreset(-1); perspective1.setData(0,0,10); perspective1.setData(0,1,11); perspective1.setData(0,2,12); perspective1.setData(0,3,13); perspective1.setSelectionEnable(3); perspective1.setBounds(0,0,300,200); add(perspective1); //{{REGISTER_LISTENERS SymMouse aSymMouse = new SymMouse(); perspective1.addMouseListener(aSymMouse); //}} } //{{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. Color myColor; IdentObj id; myColor=perspective1.getSelectionFillColor(); id = perspective1.getCubeRightWall(); perspective1.setFillColor(id, myColor); } } |
get/setFillColor, get/setTransparentFillColor, selectionHasTransparentFillColor, setSeriesFillColor |
This method gets number of the group that is currently selected (if any). |
public int getSelGroup ( ); |
None |
int = the number of the group that is currently selected |
import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setSelectionEnable(2); perspective1.setSubtitleString(""); perspective1.setGraphType(2); perspective1.setUseSampleData(false); perspective1.setO1TitleString(""); perspective1.setY2TitleDisplay(false); perspective1.setFootnoteString(""); perspective1.setY1TitleDisplay(false); perspective1.setY1TitleString(""); perspective1.setTitleString(""); perspective1.setY2TitleString(""); perspective1.setO1TitleDisplay(false); perspective1.setViewing3DAnglePreset(-1); perspective1.setBounds(0,0,300,181); add(perspective1); SymMouse aSymMouse = new SymMouse(); perspective1.addMouseListener(aSymMouse); } 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. int grp; int ser; String label = ""; grp = perspective1.getSelGroup(); ser = perspective1.getSelSeries(); label = perspective1.getDataAsString(ser,grp); perspective1.setGroupLabel(grp, label); perspective1.setSeriesLabel(ser,label); } } |
This method gets the number of the series that is currently selected (if any) in a chart. |
public int getSelSeries ( ); |
None |
int = Number of the series that is currently selected |
import java.awt.*; import java.applet.*; import TDG.draw.IdentObj; import TDG.Perspective; public class Applet1 extends Applet { public void init() { setLayout(null); setSize(300,200); perspective1 = new TDG.Perspective(); perspective1.setSelectionEnable(2); perspective1.setSubtitleString(""); perspective1.setGraphType(2); perspective1.setUseSampleData(false); perspective1.setO1TitleString(""); perspective1.setY2TitleDisplay(false); perspective1.setFootnoteString(""); perspective1.setY1TitleDisplay(false); perspective1.setY1TitleString(""); perspective1.setTitleString(""); perspective1.setY2TitleString(""); perspective1.setO1TitleDisplay(false); perspective1.setViewing3DAnglePreset(-1); perspective1.setBounds(0,0,300,181); add(perspective1); SymMouse aSymMouse = new SymMouse(); perspective1.addMouseListener(aSymMouse); } 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. int grp; int ser; String label = ""; grp = perspective1.getSelGroup(); ser = perspective1.getSelSeries(); label = perspective1.getDataAsString(ser,grp); perspective1.setGroupLabel(grp, label); perspective1.setSeriesLabel(ser,label); } } |
get/setSeriesLabel()
These methods get/set the label string associated with a series in a chart. |
public string getSeriesLabel ( ); public string getSeriesLabel ( IdentObj id ); public string getSeriesLabel ( int objectID ); public void setSeriesLabel ( String newValue ); public void setSeriesLabel ( IdentObj id, String newValue ); public void setSeriesLabel ( int seriesID, String newValue ); |
id or objectID: the ID number of an object in a chartseriesID: series number newValue: series label string |
getSeriesLabel(): string = series label setSeriesLabel(): 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() { int i; setLayout(null); setSize(426,266); perspective1 = new TDG.Perspective(); i = perspective1.getNumSeries(); perspective1.setSeriesLabel(i-1,"This is the largest series"); perspective1.setBounds(0,0,426,247); add(perspective1); } TDG.Perspective perspective1; } |
get/setSeriesType()
These methods get/set the series type for a specific object, series number, or the first item in the selection list. |
public int getSeriesType ( ); public int getSeriesType ( IdentObj id ); public int getSeriesType ( int seriesID ); public void setSeriesType ( int newValue ); public void setSeriesType ( IdentObj id, int newValue ); public void setSeriesType ( int seriesID, int newValue ); |
id : the ID number of an object in a chartseriesID: series number newValue: series type (0 = riser unspecified, 1=riser bar, 2=riser marker, 3=riser area) |
getSeriesType(): int = the series type (0 = riser unspecified, 1=riser bar, 2=riser marker, 3=riser area) setSeriesType(): 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.setSeriesType(1,1); perspective1.setSeriesType(2,2); perspective1.setSeriesType(3,3); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setShadowColor()
These methods get/set the color value of a drop shadow for a specified object in a chart. |
public color getShadowColor ( IdentObj id ); public void setShadowColor( IdentObj id, Color newValue ) |
id: Identification number of an object in a chartnewValue: the value of the drop shadow applied to id |
getShadowColor(): color = the value of the drop shadow applied to id, null = no drop shadow color applied setShadowColor(): 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.getFrame(); perspective1.setShadowDisplay(id,true); perspective1.setShadowColor(id, new Color(0,0,0)); perspective1.setShadowXOffset(id,10); perspective1.setShadowYOffset(id,12); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setShadowDisplay, get/setShadowXOffset, get/setShadowYOffset |
get/setShadowDisplay()
This method can be used to determine whether or not a drop shadow is displayed for a particular object in a chart. |
public boolean getShadowDisplay ( ); public boolean getShadowDisplay ( IdentObj id ); public boolean getShadowDisplay ( int objectID ); public void setShadowDisplay ( boolean newValue ); public void setShadowDisplay ( IdentObj id, boolean newValue ); public void setShadowDisplay ( int objectID, boolean newValue ); |
id or objectID: the ID number of an object in a chartnewValue: TRUE = display drop shadow/FALSE = do not display drop shadow |
getShadowDisplay(): TRUE = drop shadow is displayed / FALSE = drop shadow is not displayed setShadowDisplay(): 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.getFrame(); perspective1.setShadowDisplay(id,true); perspective1.setShadowColor(id, new Color(0,0,0)); perspective1.setShadowXOffset(id,10); perspective1.setShadowYOffset(id,12); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setShadowColor, get/setShadowXOffset, get/setShadowYOffset |
get/setShadowXOffset()
These methods get/set the offset in the X-direction of a drop shadow for a particular object in a chart. |
public int getShadowXOffset ( ); public int getShadowXOffset ( IdentObj id ); public int getShadowXOffset ( int objectID ); public void setShadowXOffset ( int newValue ); public void setShadowXOffset ( IdentObj id, int newValue ); public void setShadowXOffset ( int objectID, int newValue ); |
id or objectID: Identification number of an object in a chartnewValue: X-direction offset of the drop shadow applied to id, null = no drop shadow applied |
getShadowXOffset(): int = X-direction offset of the drop shadow applied to id, null = no drop shadow applied setShadowXOffset(): None |
setShadowDisplay(getTitle(),false); setShadowXOffset(getTitle(),2); setShadowYOffset(getTitle(),2); |
get/setShadowColor, get/setShadowDisplay, get/setShadowYOffset |
get/setShadowYOffset()
These methods can be used to get/set the offset in the Y-direction of a drop shadow for a particular object in a chart. |
public int getShadowYOffset ( ); public int getShadowYOffset ( IdentObj id ); public int getShadowYOffset ( int objectID ); public void setShadowYOffset ( int newValue ); public void setShadowYOffset ( IdentObj id, int newValue ); public void setShadowYOffset ( int objectID, int newValue ); |
id or objectID: the ID number of an object in a chartnewValue: Y-direction offset of the drop shadow applied to id, , null = no drop shadow applied |
getShadowYOffset(): int = Y-direction offset of the drop shadow applied to id, , null = no drop shadow applied setShadowYOffset(): None |
setShadowDisplay(getTitle(),false); setShadowXOffset(getTitle(),2); setShadowYOffset(getTitle(),2); |
get/setShadowColor, get/setShadowDisplay, get/setShadowXOffset |
get/setTextFormatPattern()
These methods can be used to get/set a standard Java number format pattern for data text. |
public String getTextFormatPattern ( ); public void setTextFormatPattern ( String szPattern ); |
getTextFormatPattern(): None |
getTextFormatPattern(): String = A pattern string in the following format: setTextFormatPattern(): None |
get/setTextFormatPreset(),DataTextFormat, PieFeelerTextFormat, PieRingTotalFormat, X1LabelFormat, Y1LabelFormat, Y2LabelFormat |
get/setTextFormatPreset()
This method can be used to set and determine the format of a text object. See "Getting an Object ID" at the beginning of this chapter to get the ID of a text object. |
public int getTextFormatPreset ( ); public int getTextFormatPreset ( IdentObj id ); public int getTextFormatPreset ( int objectID ); public void setTextFormatPreset ( int newValue ); public void setTextFormatPreset ( IdentObj id, int newValue ); public void setTextFormatPreset ( int objectID, int newValue ); |
id or objectID: the ID number of an object in a chartnewValue: -1...14 (-1 = use format set by setTextFormatPattern();) |
Value |
Format |
Example |
Value |
Format |
Example |
|
0 |
General |
560 |
8 |
$0K |
$56K |
|
1 |
General |
560 |
9 |
0M |
56M |
|
2 |
0% |
56% |
10 |
$0M |
$56M |
|
3 |
0.0% |
56.6% |
11 |
0B |
56B |
|
4 |
0.00% |
56.66% |
12 |
$0B |
$56B |
|
5 |
$0.00 |
$56.66 |
13 |
0T |
56T |
|
6 |
$0 |
$56 |
14 |
$0T |
$56T |
|
7 |
0K |
56K |
getTextFormatPreset(): value of text format (-1...14) setTextFormatPreset(): None |
setTextFormatPreset(getY1Label(),0); |
get/setTextFormatPattern(), DataTextFormat, PieFeelerTextFormat, PieRingTotalFormat, X1LabelFormat, Y1LabelFormat, Y2LabelFormat |
get/setTextJustHoriz()
These methods can be used to get/set horizontal justification of text in a chart. See "Getting an Object ID" at the beginning of this chapter to get the ID of a text object. |
public int getTextJustHoriz ( ); public int getTextJustHoriz ( IdentObj id ); public int getTextJustHoriz ( int objectID ); public void setTextJustHoriz ( int newValue ); public void setTextJustHoriz ( IdentObj id, int newValue ); public void setTextJustHoriz ( int objectID, int newValue ); |
id or objectID: the ID number of an object in a chartnewValue: 0...2 (0=Left, 1=Center, 2=Right) |
getTextJustHoriz(): 0...2 (0=Left, 1=Center, 2=Right) setTextJustHoriz(): None |
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.setGraphType(17); perspective1.setData(0,0,10); perspective1.setData(0,1,11); perspective1.setData(0,2,12); perspective1.setData(0,3,13); perspective1.setGroupLabel(0,"Group 0"); perspective1.setGroupLabel(1,"Group 1"); perspective1.setGroupLabel(2,"Group 2"); perspective1.setGroupLabel(3,"Group 3"); perspective1.setAutofit(false); perspective1.setFontSize(24); id = perspective1.getO1Label(); perspective1.setTextJustVert(id,1); perspective1.setTextJustHoriz(id,2); perspective1.setSeriesBorderColor(3,new Color (0,0,0)); perspective1.setSeriesFillColor(3, new Color (255,255,255)); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setTextJustVert()
These methods can be used to get/set vertical justification of text in a chart. See "Getting an Object ID" at the beginning of this chapter to get the ID of a text object. |
public int getTextJustVert ( ); public int getTextJustVert ( IdentObj id ); public int getTextJustVert ( int objectID ); public void setTextJustVert ( int newValue ); public void setTextJustVert ( IdentObj id, int newValue ); public void setTextJustVert ( int objectID, int newValue ); |
id or objectID: the ID number of an object in a chartnewValue: 0...2 (0=Top, 1=Center, 2=Bottom) |
getTextJustVert(): 0...2 (0=Top, 1=Center, 2=Bottom) setTextJustVert(): None |
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.setGraphType(17); perspective1.setData(0,0,10); perspective1.setData(0,1,11); perspective1.setData(0,2,12); perspective1.setData(0,3,13); perspective1.setGroupLabel(0,"Group 0"); perspective1.setGroupLabel(1,"Group 1"); perspective1.setGroupLabel(2,"Group 2"); perspective1.setGroupLabel(3,"Group 3"); perspective1.setAutofit(false); perspective1.setFontSize(24); id = perspective1.getO1Label(); perspective1.setTextJustVert(id,1); perspective1.setTextJustHoriz(id,2); perspective1.setSeriesBorderColor(3,new Color (0,0,0)); perspective1.setSeriesFillColor(3, new Color (255,255,255)); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setTextRotation()
These methods can be used to set/determine the angle by which text is rotated. See "Getting an Object ID" at the beginning of this chapter to get the ID of the text object to be rotated. |
public int getTextRotation ( ); public int getTextRotation ( IdentObj id ); public int getTextRotation ( int objectID ); public void setTextRotation ( int newValue ); public void setTextRotation ( IdentObj id, int newValue ); public void setTextRotation ( int objectID, int newValue ); |
id or objectID: the ID number of an object in a chartnewValue: 0...2 (0=none, 1=90 degrees, 2=270 degrees) |
getTextRotation():0...2 (0=none, 1=90 degrees, 2=270 degrees) setTextRotation(): 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,10); perspective1.setData(0,1,11); perspective1.setData(0,2,12); perspective1.setData(0,3,13); perspective1.setGroupLabel(0,"Group 0"); perspective1.setGroupLabel(1,"Group 1"); perspective1.setGroupLabel(2,"Group 2"); perspective1.setGroupLabel(3,"Group 3"); perspective1.setAutofit(false); perspective1.setFontSize(24); id = perspective1.getO1Label(); perspective1.setTextJustVert(id,1); perspective1.setTextJustHoriz(id,2); perspective1.setSeriesBorderColor(3,new Color (0,0,0)); perspective1.setSeriesFillColor(3, new Color (255,255,255)); perspective1.setY1TitleString("This is the Y1 Axis Title"); id = perspective1.getY1Title(); perspective1.setTextRotation(id,2); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setTextString()
These methods get/set the string that is displayed in a text object. See "Getting an Object ID" at the beginning of this chapter to get the ID of a text object. |
public string getTextString ( ); public string getTextString ( IdentObj id ); public string getTextString ( int objectID ); public void setTextString ( String newValue ); public void setTextString ( IdentObj id, String newValue ); public string setTextString ( int objectID, String newValue ); |
id or objectID: the ID number of an object in a chartnewValue: string of characters displayed in a text object |
getTextString(): string = text object displayed setTextString(): 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; } |
FootnoteString, O1TitleString, O2TitleString, SubtitleString, TitleString, X1TitleString, Y1TitleString, Y2TitleString |
get/setTexture()
This method is used to get and set a texture. The texture is identified by a URL that can specify any bit-map image file that is in .GIF format. The setFillType() property must be set to 3 (texture) to apply the texture to an object. You may also use the DisplayBarAsPictograph property to apply the texture to risers in a bar chart. Use the setTextureDisplayMode() method to identify whether the texture should be stretched or tiled. |
public Image getTexture ( String szURL ); public String getTexture ( IdentObj id ); public void setTexture ( String szURL ); public void setTexture( IdentObj id, String szURL ) |
szURL: URL that identifies a .GIF file |
getTexture(): Image = the image from the .GIF file setTexture(): None |
get/setTextureDisplayMode() and get/setFillType DisplayBarAsPictorgraph in Chapter 7. |
get/setTextureDisplayMode()
These method get/set the texture display mode for an object in a chart. |
public int getTextureDisplayMode ( IdentObj id ); public void setTextureDisplayMode ( int newValue ); public void setTextureDisplayMode ( IdentObj id, int newValue ); |
id: Identification number of an object in a chartnewValue: Texture display mode (0=Stretched/1=Tiled) |
getTextureDisplayMode(): int = Texture display mode (0=Stretched/1=Tiled) setTextureDisplayMode(): None |
get/setTextWrap()
These methods can be used to get/set text wrapping for a text object in a chart. See "Getting an Object ID" at the beginning of this chapter to get the ID of a text object. |
public boolean getTextWrap ( ); public boolean getTextWrap ( IdentObj id ); public boolean getTextWrap ( int objectID ); public void setTextWrap ( boolean newValue ); public void setTextWrap ( IdentObj id, boolean newValue ); public void setTextWrap ( int objectID, boolean newValue ); |
id or objectID: the ID number of an object in a chartnewValue: TRUE = enable text wrapping/FALSE = disable text wrapping |
getTextWrap(): TRUE = text wrapping is enabled / FALSE = text wrapping disabled setTextWrap(): 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.setGraphType(17); perspective1.setData(0,0,10); perspective1.setData(0,1,11); perspective1.setData(0,2,12); perspective1.setData(0,3,13); perspective1.setO1LabelAutofit(false); 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.setTextWrap(id,true); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setToolTipCustomString()
When tool tips are enabled with the ToolTipDisplay property, these methods can be used to get and set the strings that are displayed by tool tips. |
public String getToolTipCustomString ( ); public String getToolTipCustomString ( IdentObj id ); public String getToolTipCustomString ( int seriesID ); public String getToolTipCustomString(int seriesID, int groupID) public void setToolTipCustomString ( String newValue ); public void setToolTipCustomString ( IdentObj id, String newValue ); public void setToolTipCustomString ( int seriesID, String newValue ); public void setToolTipCustomString (int seriesID, int groupID, String newValue); |
id or objectID: the ID number of an object in a chartseriesID: series number groupID: group number newValue: tool tip custom string |
getToolTipCustomString(): string = tool tip custom string setToolTipCustomString(): 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,10); perspective1.setData(0,1,11); perspective1.setData(0,2,12); perspective1.setData(0,3,13); perspective1.setO1LabelAutofit(false); perspective1.setGroupLabel(0,"Group 0"); perspective1.setGroupLabel(1,"Group 1"); perspective1.setGroupLabel(2,"Group 2"); perspective1.setGroupLabel(3,"Group 3"); perspective1.setToolTipDisplay(true); perspective1.setToolTipCustomString( Z,0,"This is my custom tool tip string"); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setTransparentBorderColor()
These methods are used to get/set the transparent border color that is applied to a particular object in a chart. |
public boolean getTransparentBorderColor ( IdentObj id ); public void setTransparentBorderColor ( boolean newValue); public void setTransparentBorderColor ( IdentObj id, |
id: Identification number of an object in a chartnewValue: TRUE = apply transparent border color to object/ FALSE = transparent border color is not applied to object |
getTransparentBorderColor(): TRUE = transparent border color is applied/FALSE = transparent border color is not applied setTransparentBorderColor(): None |
setTransparentBorderColor(getBackgrnd(),false); setTransparentBorderColor(getDataText(),false); setTransparentBorderColor(getFootnote(),false); setTransparentBorderColor(getLegendArea(),true); setTransparentBorderColor(getO1Label(),false); setTransparentBorderColor(getO1Title(),false); setTransparentBorderColor(getO2Label(),false); setTransparentBorderColor(getO2Title(),false); setTransparentBorderColor(getPieFrame(),true); setTransparentBorderColor(getStockMALine(),false); setTransparentBorderColor(getSubtitle(),false); setTransparentBorderColor(getTitle(),false); setTransparentBorderColor(getX1Label(),false); setTransparentBorderColor(getY1Label(),false); setTransparentBorderColor(getY1MinorGrid(),false); setTransparentBorderColor(getY1Title(),false); |
get/setBorderColor, getSelectionBorderColor, selectionHasTransparentBorderColor, setSeriesBorderColor |
get/setTransparentFillColor()
These method can be used to get/set a transparent fill color applied to a particular object in a chart. |
public boolean getTransparentFillColor ( IdentObj id ); public void setTransparentFillColor ( boolean newValue ); public void setTransparentFillColor ( IdentObj id, boolean newValue ); |
id: Identification number of an object in a chartnewValue: TRUE = transparent fill color is applied to object / FALSE = transparent fill color is not applied to object |
getTransparentFillColor(): TRUE = transparent fill color is applied to object / FALSE = transparent fill color is not applied to object setTransparentFillColor(): None |
setTransparentFillColor(getBackgrnd(),false); setTransparentFillColor(getCubeFloor(),false); setTransparentFillColor(getCubeLeftWall(),false); setTransparentFillColor(getCubeRightWall(),false); setTransparentFillColor(getDataText(),false); setTransparentFillColor(getFootnote(),false); setTransparentFillColor(getFrame(),false); setTransparentFillColor(getFrameSeparator(),true); setTransparentFillColor(getLegendArea(),true); setTransparentFillColor(getLegendText(),false); setTransparentFillColor(getO1Label(),false); setTransparentFillColor(getO1Title(),false); setTransparentFillColor(getO2Label(),false); setTransparentFillColor(getO2Title(),false); setTransparentFillColor(getPieFrame(),true); setTransparentFillColor(getPieLabel(),false); |
get/setFillColor, getSelectionFillColor, selectionHasTransparentFillColor, setSeriesFillColor |
get/setURL()
These methods get/set the Universal Resource Locator for any specific Object. These methods and the get/setURLTarget() methods can be used to include drill-downs in HTML files. They allow any series/group intersection in the chart to be used as a link reference. When the user selects/clicks on an object in a chart where a setURL() is defined, the HTML file provided as an input parameter to the method will automatically be loaded and displayed at the location specified by the setURLTarget(). For example, in the example HTML file below, setURL() selects a different .HTML file for each series/group (slice) in a pie chart. The example setURLTarget() defines the location/frame in the page where each HTML file will be displayed. |
public String getURL ( ); public String getURL ( IdentObj id ); public String getURL ( int seriesID ); public String getURL ( int seriesID, int groupID ); public void setURL ( string newValue ); public void setURL ( IdentObj id, string newValue ); public void setURL ( int seriesID, string newValue ); public void setURL ( int seriesID, int groupID, string newValue ); |
id : Object IDseriesID: Series ID groupID: Group ID newValue: URL |
getURL(): String = URL string / setURL(): None |
See get/setURLTarget() |
get/setURLTarget()
These methods get/set the Frame Target for URL associated with any specific Object. They are used in conjunction with get/setURL to create drill-downs in an HTML file. The setURLTarget() defines the location on the page where the .HTML defined by setURL() will be displayed. |
public String getURLTarget ( ); public String getURLTarget ( IdentObj id ); public String getURLTarget ( int seriesID ); public String getURLTarget ( int seriesID, int groupID ); public void setURLTarget ( IdentObj id, String newValue ); public void setURLTarget ( int seriesID, int groupID, String newValue); public void setURLTarget ( int seriesID, String newValue ); public void setURLTarget ( String newValue ); |
id : the ID number of an object in a chartseriesID: Series ID groupID: Group ID newValue: Location in the HTML page |
getURLTarget(): URL Target string / setURLTarget(): None |
<html> <head> <title>Pie Drill Down Example</title> </head> <body> <p> <applet code="TDGChartApplet.class" archive="javaCHARTg.jar" width="400" height="280"> <param name="TDGSCRIPT" value="setTitleString("Pie Chart with Drilldown"); /* Set the Title String */ setSubtitleString("Click on the slices to see a description"); setGraphType(55); /* Set the graph type to Pie */ setSeriesLabelArray("Mon", "Tue", "Wed", "Thur", "Fri"); setDataSeries(35.00); setDataSeries(27.00); setDataSeries(15.00); setURL(0,0,"series0.html"); /* When user clicks on series 0, show series0.html file */ setURL(1, 0,"series1.html"); /* When user clicks on series 1, show series1.html file */ setURL(2, 0,"series2.html"); /* When user clicks on series 2, show series2.html file */ setURLTarget(0,0, "Bottom");/* Set location on page where each .html file is displayed */ setURLTarget(1,0, "Bottom"); setURLTarget(2,0, "Bottom"); setToolTipDisplay(1); "></applet></p><p><br><br> <a href="series2.html" target="Bottom">Show the Series2 page by force</a> </p></body></html> |
This method can be used to determine whether or not there are any items in the selection list. |
public boolean isSelection ( ); |
None |
TRUE = there are one or more items in the selection list / FALSE = no items in selection list. |
This method can be used to determine whether or not the first item in the selection list is associated with a series. |
public boolean isSelectionSeriesRelated ( ); |
None |
TRUE = first item in selection is series related / FALSE = item is not associated with a series. |
This method can be used to determine whether or not an SQL data type is numeric. |
public boolean isSQLTypeNumeric ( int sqlType ); |
sqlType : an SQL data type |
TRUE = sqlType is one of case TINYINT, SMALLINT, INTEGER, FLOAT, REAL, DOUBLE, NUMERIC, DECIMAL / FALSE sqlType is not a numeric data type |
This method can be used to determine whether or not an SQL data type is a string. |
public boolean isSQLTypeString ( int sqlType ); |
sqlType : an SQL data type |
TRUE = sqlType is one of the following data types: CHAR, VARCHAR, or LONGVARCHAR. FALSE = sqlType is not a string |
These methods are used to load and save a chart in ASCII text format. The load() method loads a saved chart from a Java input stream or a URL. If bMerge is true, the contents of the file will be merged with the methods and properties that define the current chart. If bMerge is false, the contents of the file replaces the definition of the current file. Note that the Java input stream or URL must identify an ASCII text file that contains the properties and methods that are supported by Perspective. The save() method can be used to save a chart to an output stream. It will save all of the properties and methods required to recreate the chart in ASCII text file format. The contents of the file can be viewed or edited with any text editor. |
public void load ( InputStream is, boolean bMerge ); |
load(): is: a Java Input Stream szURL: URL bMerge: true = merge loaded file with current chart definition / false = replace current chart with the loaded file save(): os: a Java Output Stream |
None |
// // Allocate an memory output stream to store the Chart... // ByteArrayOutputStream chartStreamOut = new ByteArrayOutputStream(); // // Encode the chart to a stream... // save(chartStreamOut); |
This method is the HTML Parsing Interface. |
public void parsePARAMS ( String szInString ); |
szInString: Parameter String |
None |
/* This applet is a "raw" version of Perspective.java with PARAM support Use this when you need a flat chart in a page with simple HTML attributes Example use of the Perspective Applet "TDGScriptDemo" <HTML><HEAD> <TITLE>TDGCharApplet</TITLE> </HEAD><BODY> <APPLET CODE="TDGChartApplet.class" WIDTH=400 HEIGHT=350> <PARAM NAME=TDGSCRIPT VALUE=' setGraphType(17); setTitleString("Wilde Java Joe!"); '> </APPLET> </BODY> </HTML> */ import java.awt.*; import java.applet.*; import TDG.Perspective; public class TDGChartApplet extends Applet { Perspective m_Chart; // APPLET INFO SUPPORT: //The getAppletInfo() method returns a string describing the // applet's author, copyright date, or miscellaneous information. //-------------------------------------------------------------- public String getAppletInfo() { return "Name: TDGJavaChart\r\n" + "Author: Joe Terry\r\n" + "Created with Symantec Visual Cafe Pro 1.0\r\n" + "Copyright(c) 1997 Three D Graphics, Inc.\r\n" + "Version 1.0\r\n" + "Tel: 310.553.3313\r\n" + "Fax: 310.788.8975\r\n" + ""; } public boolean handleEvent(Event event) { return super.handleEvent(event); } public void init() { // PARAMETER SUPPORT String param; super.init(); //{{INIT_CONTROLS setLayout(null); //}} // Chart size & shape comes from Applet TAG in HTML m_Chart = new Perspective(this); add(m_Chart); m_Chart.setUseSampleData(false); param = getParameter("TDGSCRIPT"); if (param != null) m_Chart.parsePARAMS(param); } } |
This method is called to listen for Perspective events. |
public void perspectiveEvent ( TDGEvent e ); |
e : On return will be set to the perspective event. See TDGEvent.Java for a list of possible events. |
// Send a "TDGEvent" to every listener. Each listener will examine // the "EventID" to determine if they are interested. for ( int elem = 0; elem < thisList.size(); elem++) { ((TDGListener)thisList.elementAt(elem)).perspectiveEvent(thisEvent); |
This method can be used to restore all slices to a pie chart that have been deleted or detached. |
public void restoreAllSlices ( ); |
None |
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.setBounds(0,0,300,200); perspective1.setGraphType(55); boolean b = perspective1.getPieSliceDelete (1); if (b==false)perspective1.setPieSliceDelete(1,true); perspective1.restoreAllSlices(); add(perspective1); } TDG.Perspective perspective1; } |
rotateCubeX / Y / Z()
These properties are used to rotate a 3D cube a number of degrees in the X-, Y-, and Z-directions. |
public void rotateCubeX ( double degreesX ); public void rotateCubeY ( double degreesY ); public void rotateCubeZ ( double degreesZ ); |
degreesX: Number of degrees to rotate in the X-directiondegressY: Number of degrees to rotate in the Y-direction degreesZ: Number of degrees to rotate in the Z direction |
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.setBounds(0,0,300,200); perspective1.setGraphType (2); perspective1.setViewing3DAnglePreset(-1); perspective1.rotateCubeX(90); add(perspective1); } TDG.Perspective perspective1; } |
public void scaleCube ( double scaleFactor ); |
scaleFactor: scaling factor |
None |
case 25: // Zoom Out m_Perspective.scaleCube(1 / ZOOM_STEP); break; case 26: // Zoom In m_Perspective.scaleCube(ZOOM_STEP); break; |
selectionHasTransparentBorderColor()
This method can be used to determine whether or not the first item in the selection list has a transparent border color. |
public boolean selectionHasTransparentBorderColor ( ); |
None |
TRUE = selection has transparent border color / FALSE = selection does not have transparent border color |
public void perspectiveEvent(TDGEvent e) { switch( e.getID() ) { case TDGEvent.TDG_SELECTION_CHANGED: setTransparentFillColor(((Perspective)e. getSource()).selectionHasTransparentFillColor()); setFillColor(((Perspective)e.getSource()).getSelectionFillColor()); setTransparentBorderColor(((Perspective)e. getSource()).selectionHasTransparentBorderColor()); setBorderColor(((Perspective)e.getSource()).getSelectionBorderColor()); break; default: } } |
get/setBorderColor, getSelectionBorderColor, get/setTransparentBorderColor, setSeriesBorderColor, selectionHasTransparentFillColor |
selectionHasTransparentFillColor()
This method can be used to determine whether or not the first item in the selection list has a transparent fill color. |
public boolean selectionHasTransparentFillColor ( ); |
None |
TRUE = selection has transparent fill color / FALSE = selection does not have transparent fill color |
public void perspectiveEvent(TDGEvent e) { switch( e.getID() ) { case TDGEvent.TDG_SELECTION_CHANGED: setTransparentFillColor(((Perspective)e. getSource()).selectionHasTransparentFillColor()); setFillColor(((Perspective)e.getSource()).getSelectionFillColor()); setTransparentBorderColor(((Perspective)e. getSource()).selectionHasTransparentBorderColor()); setBorderColor(((Perspective)e.getSource()).getSelectionBorderColor()); break; default: } } |
get/setFillColor, getSelectionFillColor, get/setTransparentFillColor, setSeriesFillColor, selectionHasTransparentBorderColor |
This method is used to send a chart to an FTP server. |
public boolean sendChartToFTP ( ); |
strHost: Host NamestrUser: User Name strPass: Password strDir: Directory name strDestFile: Destination file name |
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.sendChartToFTP("myHost","myUserName","myPassword","myDirectory","myTargetFile"); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
sendGIFToFTP ()
This method can be used to write the current chart out as a GIF file to the specified FTP server. |
public void sendGIFToFTP ( ); |
strHost: Host NamestrUser: User Name strPass: Password strDir: Directory name strDestFile: Destination file name |
/* 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.sendGIFToFTP("myHost","myUserName","myPassword","myDirectory","myTargetFile"); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
setData()
This method sets the data value for a series/group intersection. This is THE master method for setting data in charts It can be used to assign a single value to a row and column in a chart for the currently selected object or for a specific object in the chart. You may also specify whether or not the chart should be repainted when the new value is assigned. |
public void setData ( int row, int col, double fValue ); public void setData ( int row, int col, double fValue, boolean bRepaint ); public void setData ( int row, int col, Object obj ); public void setData ( int row, int col, Object obj, boolean bRepaint ); |
row: Row numbercol: Column number fValue: Data value to set at row/column bRepaint: TRUE = Repaint the chart when the new data value is assigned / FALSE = Don't repaint the chart. obj: Object ID |
None |
perspective1.setData(0,0,.5); /* Row 0/Col 0 Value = .5 */ perspective1.setData(0,1,1); /* Row 0/Col 1 Value = 1 */ perspective1.setData(0,2,2); /* Row 0/Col 2 Value = 2 */ perspective1.setData(0,3,3); perspective1.setData(0,4,4); perspective1.setData(0,5,5); perspective1.setData(1,0,.5); perspective1.setData(1,1,1); perspective1.setData(1,2,2); perspective1.setData(1,3,3); perspective1.setData(1,4,4); perspective1.setData(1,5,5); |
setDataFileURL(), setDataFromCallBack(), setDataFromDataGrid(), setDataFromResultSet(), setDataFromSQL(), setDataRange(), setDataRangeToExtent() |
You can load any text file into a Perspective applet. This is done by using the setDataFileURL method, which takes as input any valid file location or Internet URL. The text file needs to be organized in "spreadsheet" fashion, with rows of number for series, and columns of numbers for groups. You can optionally supply row and/or column headers, which will then be used for labeling the series and groups on the graph. Each value must be separated by a comma, and each text value needs to be in quotes. However, if you ARE supplying row and column headers, the very first word in the file must be "labels", in quotes, separated by a comma. |
public void setDataFileURL ( String aDataFileURL ); |
aDataFileURL: |
None |
setData(), setDataFromCallBack(), setDataFromDataGrid(), setDataFromResultSet(), setDataFromSQL(), setDataRange(), setDataRangeToExtent() |
The setDataFromCallback() method can be used to load data from a predefined data grid. The input parameter to this method identifies the data grid. |
public void setDataFromCallBack ( TDGDataGrid grid ); |
grid : An Interface that represents an abstract data model that is one way of preparing data for graphing by |
None |
void button2_Action(java.awt.event.ActionEvent event) { // register data source with javaCHART m_Chart.setDataFromCallBack(aDataImport); for(int row = 0; row < aDataImport.getRows(); row++) for(int col=0; col < aDataImport.getColumns(); col++) aDataImport.setValue(row, col, new Double(RandomData.nextDouble() * 50)); aDataImport.setDirty(true); m_Chart.repaint(); } |
setData(), setDataFileURL(), setDataFromDataGrid(), setDataFromResultSet(), setDataFromSQL(), setDataRange(), setDataRangeToExtent() |
TDGDataGrid is series of methods that you must implement into an object. You can have any number of other methods or functions inside this object, but the following methods must be included: public abstract String columnLabel (int c); Perspective will then get data from this object based on whatever you do inside each of these methods. It does not matter how you process, parse, or access your data; only that somewhere in your code you make public these methods, with Perspective can then access to retrieve data. |
public void setDataFromDataGrid ( TDGDataGrid grid ); |
grid : An Interface that represents an abstract data model that is one way of preparing data for graphing by |
None |
/* See Chapter 6 */ void button1_Action(java.awt.event.ActionEvent event) { m_Chart.setDataFromDataGrid(aDataImport); } |
setData(), setDataFileURL(), setDataFromCallBack(), setDataFromResultSet(), setDataFromSQL(), setDataRange(), setDataRangeToExtent() |
processSQLResultSet. Graph columns and rows in the given result set. The result set is _not_ closed. |
public void setDataFromResultSet ( ResultSet rs ); |
rs : SQL Result Set |
None |
public void setDataFromSQL(String SQLQuery, Statement aStmt) { ResultSet rs; try { // Submit a query, creating a ResultSet object rs = aStmt.executeQuery (SQLQuery); // Display all columns and rows from the result set setDataFromResultSet(rs); // Close the result set rs.close(); } |
setData(), setDataFileURL(), setDataFromCallBack(), setDataFromDataGrid(), setDataFromSQL(), setDataRange(), setDataRangeToExtent() |
setDataFromSQL. Graph columns and rows in the given query. Creates a result set and closes the result set. |
public void setDataFromSQL ( String SQLQuery, Statement aStmt); |
SQLQuery: aStmt: |
None |
void button3_Action(java.awt.event.ActionEvent event) { String Harry = textField1.getText(); if ( Harry.length() > 0 ) { // assumes current connection to DataSource through JDBC m_Chart.setDataFromSQL(Harry, stmt); } } |
setData(), setDataFileURL(), setDataFromCallBack(), setDataFromDataGrid(), setDataFromResultSet(), setDataRange(), setDataRangeToExtent() |
This method is used to establish the range of data that will be used in a chart. |
public void setDataRange ( int rowStop, int colStop ); public void setDataRange ( int rowStart, int colStart, int rowStop, int colStop ); |
rowStop: last row numbercolStop: last column number rowStart: first row number (0 if not specified) colStart: first column number (0 if not specified) |
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); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(17); perspective1.setDepthAngle(0); perspective1.setDepthRadius(0); perspective1.setGroupLabel (0,"Group 0"); perspective1.setGroupLabel (1,"Group 1"); perspective1.setGroupLabel (2,"Group 2"); perspective1.setGroupLabel (3,"Group 3"); perspective1.setData(0,0,1); perspective1.setData(0,1,2); perspective1.setData(0,2,3); perspective1.setData(0,3,4); perspective1.setData(1,0,1); perspective1.setData(1,1,2); perspective1.setData(1,2,3); perspective1.setData(1,3,4); perspective1.setData(2,0,1); perspective1.setData(2,1,2); perspective1.setData(2,2,3); perspective1.setData(2,3,4); perspective1.setDataRange(3,3); add(perspective1); } TDG.Perspective perspective1; } |
setData(), setDataFileURL(), setDataFromCallBack(), setDataFromDataGrid(), setDataFromResultSet(), setDataFromSQL(), setDataRangeToExtent() |
This method sets the range of data to be used in the chart according to the number of values identified by the setData() method. It will override values that may be set by the setDataRange() property. |
public void setDataRangeToExtent ( ); |
None |
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); perspective1 = new TDG.Perspective(); perspective1.setUseSampleData(false); perspective1.setGraphType(17); perspective1.setDepthAngle(0); perspective1.setDepthRadius(0); perspective1.setGroupLabel (0,"Group 0"); perspective1.setGroupLabel (1,"Group 1"); perspective1.setGroupLabel (2,"Group 2"); perspective1.setGroupLabel (3,"Group 3"); perspective1.setData(0,0,1); perspective1.setData(0,1,2); perspective1.setData(0,2,3); perspective1.setData(0,3,4); perspective1.setData(1,0,1); perspective1.setData(1,1,2); perspective1.setData(1,2,3); perspective1.setData(1,3,4); perspective1.setData(2,0,1); perspective1.setData(2,1,2); perspective1.setData(2,2,3); perspective1.setData(2,3,4); perspective1.setDataRange(1,1,3,3); perspective1.setDataRangeToExtent(); add(perspective1); } TDG.Perspective perspective1; } |
setData(), setDataFileURL(), setDataFromCallBack(), setDataFromDataGrid(), setDataFromResultSet(), setDataFromSQL(), setDataRange() |
This method can be used to set the font size for all text objects in a chart. |
public void setFontSize ( int newValue ); |
newValue: Font size value |
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.setGraphType(17); perspective1.setData(0,0,10); perspective1.setData(0,1,11); perspective1.setData(0,2,12); perspective1.setData(0,3,13); perspective1.setGroupLabel(0,"Group 0"); perspective1.setGroupLabel(1,"Group 1"); perspective1.setGroupLabel(2,"Group 2"); perspective1.setGroupLabel(3,"Group 3"); perspective1.setAutofit(false); perspective1.setFontSize(24); perspective1.setLegendOrient(0); id = perspective1.getLegendText(); perspective1.setFontSizeVC(id,4000); perspective1.setLegendTextAutofit(false); perspective1.setSeriesLabel(0,"This is the Series 0 Label"); perspective1.setSeriesBorderColor(3,new Color (0,0,0)); perspective1.setSeriesFillColor(3, new Color (255,255,255)); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
This method disables text autofitting (i.e., setAutofit(false);). |
get/setFontSizeVC to set the font size of specific text objects in a chart. |
This method is used to set the orientation of the legends in a chart. |
public void setLegendOrient (int newValue ); |
newValue : 0 = Vertical / 1 = Horizontal |
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(17); perspective1.setLegendOrient(1); perspective1.setSeriesBorderColor(4,new Color (0,0,0)); perspective1.setSeriesFillColor(4, new Color (255,255,255)); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
setLegendTextAutofit() and the following properties in Chapter 7: LegendAutomatic, LegendDisplay, LegendMarkerPosition, LegendReverse |
This method is used to enable (true) / disable (false) autofitting of the legend text. |
public void setLegendTextAutofit ( boolean newValue ); |
newValue : true = autofit legend text / false = use font size setting |
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.setGraphType(17); perspective1.setAutofit(false); perspective1.setFontSize(14); perspective1.setLegendOrient(0); id = perspective1.getLegendText(); perspective1.setFontSizeVC(id,2000); perspective1.setLegendTextAutofit(false); perspective1.setSeriesLabel(0,"This is the Series 0 Label"); perspective1.setSeriesBorderColor(4,new Color (0,0,0)); perspective1.setSeriesFillColor(4, new Color (255,255,255)); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
setLegendOrient () and the following properties in Chapter 7: LegendAutomatic, LegendDisplay, LegendMarkerPosition, LegendReverse |
This method can be used to set the border color of risers for a specified series in a chart. |
public void setSeriesBorderColor ( int s, Color newValue ); |
s : Series NumbernewValue: RGB Color Value |
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.setSeriesBorderColor(4,new Color (255,255,255)); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setBorderColor(), getSelectionBorderColor(), get/setTransparentBorderColor(), selectionHasTransparentBorderColor(), and setSeriesFillColor |
This method can be used to set the fill color of risers for a specified series in a chart. |
public void setSeriesFillColor ( int s, Color newValue ); |
s : Series NumbernewValue: RGB Color Value |
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.setSeriesBorderColor(4,new Color (0,0,0)); perspective1.setSeriesFillColor(4, new Color (255,255,255)); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
get/setFillColor(), getSelectionFillColor(), get/setTransparentFillColor(), selectionHasTransparentFillColor(), and setSeriesBorderColor |
These methods are not currently implemented. |
public void setToolTipUser ( int aCustomMacro ); public void setToolTipUser ( int aCustomMacroA, int aCustomMarcoB); public void setToolTipUser ( int aCustomMacroA, int aCustomMacroB, int aCustomMarcoC ); public void setToolTipUser ( int aCustomMacroA, int aCustomMacroB, int aCustomMarcoC, int aCustomMacroD ); public void setToolTipUser ( int aCustomMacroA, int aCustomMacroB, int aCustomMarcoC, int aCustomMacroD, int aCustomMacroE ); |
get/setToolTipCustomString and the following properties in Chapter 7: ToolTipDelay, ToolTipDisplay, ToolTipMode |
This method can be used to translate the cube in a 3D chart in the X-, Y-, and Z-directions. |
public void translateCube (double tx, double ty, double tz ); |
tx : cube translation in X-directionty: cube translation in Y-direction tz: cube translation in Z-direction |
/* 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.translateCube(10000,20000,30000); perspective1.setSeriesBorderColor(4,new Color (0,0,0)); perspective1.setSeriesFillColor(4, new Color (255,255,255)); perspective1.setBounds(0,0,300,200); add(perspective1); } TDG.Perspective perspective1; } |
The CubeTranslationX, CubeTranslationY, and CubeTranslationZ properties in Chapter 7. |