jhplot
Class HPlot3D

java.lang.Object
  extended by jhplot.GHPanel
      extended by jhplot.GHFrame
          extended by jhplot.HPlot3D
All Implemented Interfaces:
java.awt.event.ComponentListener, java.io.Serializable, java.util.EventListener
Direct Known Subclasses:
SHPlot3D

public class HPlot3D
extends GHFrame

Create a 3D frame for showing 3D objects.

See Also:
Serialized Form

Field Summary
 boolean set
           
 
Constructor Summary
HPlot3D()
          Construct a HGraph canvas with a plot with the default parameters 600 by 400, and 10% space for the global title "Default"
HPlot3D(java.lang.String title)
          Construct a HGraph canvas with a plot with the default parameters 600 by 400, and 10% space for the global title
HPlot3D(java.lang.String title, int xs, int ys)
          Construct a HView2D canvas with a single plot/graph
HPlot3D(java.lang.String title, int xsize, int ysize, int n1, int n2)
          Create a canvas to display histograms in 3D
HPlot3D(java.lang.String title, int xsize, int ysize, int n1, int n2, boolean set)
          Create a canvas to display histograms in 3D
 
Method Summary
 void clear()
          Clear the current graph including graph settings.
 void clear(int i1, int i2)
          Clear the graph characterized by an index in X and Y.
 void clearAll()
          Clear all graphs from data and settings.
 void close()
          Close the canvas (and dispose all components) Note: a memory leak is found - no time to study it.
 void draw(F2D f1)
          Draw F2D function as a surface.
 void draw(F2D f1, F2D f2)
          Draw two F2D functions on the same plot.
 void draw(F2D h2, H2D h1)
          Draw F2D and H2D on the same plot.
 void draw(H2D h)
          Draw H2D histogram
 void draw(H2D h1, F2D h2)
          Draw H2D histogram and F2D function on the same plot.
 void draw(H2D h1, H2D h2)
          Plot two H2D histograms on the same plot.
 void draw(P2D h)
          Display P2D data holder with X,Y,Z values in 3D.
 void draw(P3D h)
          Display P3D data holder with X,Y,Z values in 3D as surface.
 void draw(java.lang.String function)
          Draw a function
 java.awt.Color getAxesFontColor()
          Color for tic labels
 java.awt.Font getAxisFont()
          Get font for axes
 void getColorMode()
          Gets the color mode
 double getDistance()
          Get the distance
 double getElevationAngle()
          Get the angle
 java.awt.Color getFrameColor()
          Get color of the frame
 double getLabelOffset(int axes)
          Get offset for labels on X
 int getPenWidthAxes()
          Gets the pen width to draw axes
 double getRotationAngle()
          Get the rotation angle
 double getScaling()
          Get the scaling
 boolean isSurface()
          Is the plot will be shown as a surface?
 void quit()
          exit the frame and clear all components
 void setAxesFontColor(java.awt.Color fontColorAxes)
          Get color for tic labels
 void setAxisFont(java.awt.Font fontAxis)
          Sets font for axes
 void setBars()
          Set bar type of plot
 void setBoxColor(java.awt.Color a)
          Set color of the box
 void setBoxed(boolean boxed)
          Set boxed frame
 void setColorFill(java.awt.Color a)
          Set color of to fill histogram bars
 void setColorLines(java.awt.Color a)
          Set color of the lines to draw histogram bars
 void setColorMode(int a)
          Sets the color mode
 void setContour()
          Set Contour type of plot
 void setDensity()
          Set density type of plot
 void setDisplayXY(boolean a)
          Display or not X and Y
 void setDisplayZ(boolean a)
          Display or not title for Z
 void setDistance(double distance)
          Set distance to the object
 void setElevationAngle(double angle)
          Set the elevation angle
 void setFill(boolean fill)
          Set fill color or not for histogram bars
 void setFrameColor(java.awt.Color a)
          Set color of the frame
 void setLabelColor(java.awt.Color a)
          Set color of the label
 void setLabelFont(java.awt.Font a)
          Set Font for the labels
 void setLabelFontColor(java.awt.Color fontColorLabel)
          Set color for labels
 void setLabelOffsetX(double a)
          Set label offset on X
 void setLabelOffsetY(double a)
          Set label offset on Y
 void setLabelOffsetZ(double a)
          Set label offset on Z
 void setNameX(java.lang.String a)
          Set a name for X axis
 void setNameY(java.lang.String a)
          Set a name for Y axis
 void setNameZ(java.lang.String a)
          Set a name for Z axis
 void setPenWidthAxes(int w)
          Set line width to draw axes
 void setRange(double Xmin, double Xmax, double Ymin, double Ymax)
          Set range for the 3D plot
 void setRange(double Xmin, double Xmax, double Ymin, double Ymax, double Zmin, double Zmax)
          Set range for the 3D plot
 void setRangeZ(double zmin, double zmax)
          Sets the z range of calculated surface vertices.
 void setRotationAngle(double angle)
          Get the rotation angle
 void setScaling(double scale)
          Set the scaling
 void setSurface()
          Set surface type of plot
 void setTicFont(java.awt.Font a)
          Set font for the ticks
 void setTicOffset(double a)
          Set tick offset
 void update()
          Update the graphics
 void update(int n1, int n2)
          Refresh only a particular plot
 void updateAll()
          Refresh all the plots on the same canvas HPLOT
 void updateData()
          Update data on the plot
 void updateData(int n1, int n2)
          Update data on the plot
 void visible()
          Show the canvas
 void visible(boolean vs)
          Set the canvas frame visible or not
 
Methods inherited from class jhplot.GHFrame
addGraph, cd, componentHidden, componentMoved, componentShown, getCdX, getCdY, getFrame, getHTMLUrl, getNtotX, getNtotY, setPlotsNum, updateFrame
 
Methods inherited from class jhplot.GHPanel
addComp, componentResized, export, exportDialog, exportImage, getCanvasPanel, getMarginBackground, getMarginPanelBottom, getMarginPanelCenter, getMarginPanelLeft, getMarginPanelRight, getMarginPanelTop, getMarginSizeBottom, getMarginSizeLeft, getMarginSizeRight, getMarginSizeTop, getSizeX, getSizeY, getTextBottom, getTextBottomColor, getTextBottomColorBack, getTextBottomFont, getTextLeft, getTextLeftColor, getTextLeftColorBack, getTextLeftFont, getTextPosBottomX, getTextPosBottomY, getTextPosLeftX, getTextPosLeftY, getTextPosRightX, getTextPosRightY, getTextPosTopX, getTextPosTopY, getTextRight, getTextRightColor, getTextRightColorBack, getTextRightFont, getTextRotationBottom, getTextRotationLeft, getTextRotationRight, getTextRotationTop, getTextTop, getTextTopColor, getTextTopColorBack, getTextTopFont, isBorderShown, printGraph, resetMargins, setGTitle, setGTitle, setGTitle, setGTitle, setGTitle, setMarginBackground, setMarginSizeBottom, setMarginSizeLeft, setMarginSizeRight, setMarginSizeTop, setSizePanel, setTextBottom, setTextBottom, setTextBottom, setTextBottom, setTextBottomColorBack, setTextLeft, setTextLeft, setTextLeft, setTextLeft, setTextLeftColorBack, setTextPosBottomX, setTextPosBottomY, setTextPosLeftX, setTextPosLeftY, setTextPosRightX, setTextPosRightY, setTextPosTopX, setTextPosTopY, setTextRight, setTextRight, setTextRight, setTextRight, setTextRightColorBack, setTextRotationBottom, setTextRotationLeft, setTextRotationRight, setTextRotationTop, setTextTop, setTextTop, setTextTop, setTextTopColorBack, showBorders
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

set

public boolean set
Constructor Detail

HPlot3D

public HPlot3D(java.lang.String title,
               int xsize,
               int ysize,
               int n1,
               int n2,
               boolean set)
Create a canvas to display histograms in 3D

Parameters:
title - Title
xsize - size in x direction
ysize - size in y direction
n1 - number of plots/graphs in x
n2 - number of plots in y

HPlot3D

public HPlot3D(java.lang.String title,
               int xsize,
               int ysize,
               int n1,
               int n2)
Create a canvas to display histograms in 3D

Parameters:
title - Title
xsize - size in x direction
ysize - size in y direction
n1 - number of plots/graphs in x
n2 - number of plots/graphs in y
set - set or not the graph

HPlot3D

public HPlot3D(java.lang.String title,
               int xs,
               int ys)
Construct a HView2D canvas with a single plot/graph

Parameters:
title - Title for the canvas
xs - size in x
ys - size in y

HPlot3D

public HPlot3D(java.lang.String title)
Construct a HGraph canvas with a plot with the default parameters 600 by 400, and 10% space for the global title

Parameters:
title - Title

HPlot3D

public HPlot3D()
Construct a HGraph canvas with a plot with the default parameters 600 by 400, and 10% space for the global title "Default"

Method Detail

setDistance

public void setDistance(double distance)
Set distance to the object

Parameters:
distance - distance

getDistance

public double getDistance()
Get the distance

Returns:
distance

setScaling

public void setScaling(double scale)
Set the scaling

Parameters:
scale -

getScaling

public double getScaling()
Get the scaling

Returns:

setRotationAngle

public void setRotationAngle(double angle)
Get the rotation angle

Parameters:
angle - angle

getRotationAngle

public double getRotationAngle()
Get the rotation angle

Returns:
angle

setElevationAngle

public void setElevationAngle(double angle)
Set the elevation angle

Parameters:
angle - elevation angle

getElevationAngle

public double getElevationAngle()
Get the angle

Returns:

setLabelFontColor

public void setLabelFontColor(java.awt.Color fontColorLabel)
Set color for labels

Parameters:
fontColorLabel -

update

public void update(int n1,
                   int n2)
Refresh only a particular plot

Parameters:
n1 - the location of the plot in x
n2 - the location of the plot in y

updateData

public void updateData(int n1,
                       int n2)
Update data on the plot

Parameters:
n1 - the location of the plot in x
n2 - the location of the plot in y

updateData

public void updateData()
Update data on the plot


getLabelOffset

public double getLabelOffset(int axes)
Get offset for labels on X

Returns:
axes 0 for X, 1 for Y, 2 for Z

updateAll

public void updateAll()
Refresh all the plots on the same canvas HPLOT


clear

public void clear()
Clear the current graph including graph settings. Note: the current graph is set by the cd() method


clear

public void clear(int i1,
                  int i2)
Clear the graph characterized by an index in X and Y. This method cleans the data and all graph settings.

Parameters:
i1 - location of the graph in X
i2 - location of the graph in Y

setPenWidthAxes

public void setPenWidthAxes(int w)
Set line width to draw axes

Parameters:
w -

getPenWidthAxes

public int getPenWidthAxes()
Gets the pen width to draw axes

Returns:

draw

public void draw(java.lang.String function)
Draw a function


clearAll

public void clearAll()
Clear all graphs from data and settings.


quit

public void quit()
exit the frame and clear all components


visible

public void visible(boolean vs)
Set the canvas frame visible or not

Parameters:
vs - (boolean) true: visible, false: not visible

visible

public void visible()
Show the canvas


isSurface

public boolean isSurface()
Is the plot will be shown as a surface?

Returns:
true, if this is a surface plot

setNameX

public void setNameX(java.lang.String a)
Set a name for X axis

Parameters:
a - Name of the label for X axis

setNameY

public void setNameY(java.lang.String a)
Set a name for Y axis

Parameters:
a - Name of the label for Y axis

setNameZ

public void setNameZ(java.lang.String a)
Set a name for Z axis

Parameters:
a - Name of the label for Z axis

setLabelFont

public void setLabelFont(java.awt.Font a)
Set Font for the labels

Parameters:
a - Font

setAxisFont

public void setAxisFont(java.awt.Font fontAxis)
Sets font for axes

Parameters:
fontAxis - font

getAxisFont

public java.awt.Font getAxisFont()
Get font for axes

Returns:

setLabelColor

public void setLabelColor(java.awt.Color a)
Set color of the label

Parameters:
a - Color

setColorLines

public void setColorLines(java.awt.Color a)
Set color of the lines to draw histogram bars

Parameters:
a - Color

setColorFill

public void setColorFill(java.awt.Color a)
Set color of to fill histogram bars

Parameters:
a - Color

setFill

public void setFill(boolean fill)
Set fill color or not for histogram bars

Parameters:
fill - if true, color will be set for the histogram bars

setTicFont

public void setTicFont(java.awt.Font a)
Set font for the ticks

Parameters:
a - Font

setDisplayXY

public void setDisplayXY(boolean a)
Display or not X and Y

Parameters:
a - true if it should be shown

setDisplayZ

public void setDisplayZ(boolean a)
Display or not title for Z

Parameters:
a - true, if it is shown

setContour

public void setContour()
Set Contour type of plot


setDensity

public void setDensity()
Set density type of plot


setSurface

public void setSurface()
Set surface type of plot


setBars

public void setBars()
Set bar type of plot


setBoxColor

public void setBoxColor(java.awt.Color a)
Set color of the box

Parameters:
a - Color

setFrameColor

public void setFrameColor(java.awt.Color a)
Set color of the frame

Parameters:
a - Color

setBoxed

public void setBoxed(boolean boxed)
Set boxed frame

Parameters:
boxed - true if it is boxed

getAxesFontColor

public java.awt.Color getAxesFontColor()
Color for tic labels

Returns:

setAxesFontColor

public void setAxesFontColor(java.awt.Color fontColorAxes)
Get color for tic labels

Parameters:
fontColorAxes - color

getFrameColor

public java.awt.Color getFrameColor()
Get color of the frame

Returns:
a Color

setColorMode

public void setColorMode(int a)
Sets the color mode

Parameters:
a - color mode: 0: WIREFRAME 1: HIDDEN 2: SPECTRUM IN COLOR 3: GRAYSCALE 4: DUALSHADES

getColorMode

public void getColorMode()
Gets the color mode


update

public void update()
Update the graphics


setTicOffset

public void setTicOffset(double a)
Set tick offset

Parameters:
a - tick offset

setLabelOffsetX

public void setLabelOffsetX(double a)
Set label offset on X

Parameters:
a - label offset

setLabelOffsetY

public void setLabelOffsetY(double a)
Set label offset on Y

Parameters:
a - label offset

setLabelOffsetZ

public void setLabelOffsetZ(double a)
Set label offset on Z

Parameters:
a - label offset

setRange

public void setRange(double Xmin,
                     double Xmax,
                     double Ymin,
                     double Ymax)
Set range for the 3D plot

Parameters:
Xmin - Min in X
Xmax - Max in X
Ymin - Min in Y
Ymax - Max in Y

setRange

public void setRange(double Xmin,
                     double Xmax,
                     double Ymin,
                     double Ymax,
                     double Zmin,
                     double Zmax)
Set range for the 3D plot

Parameters:
Xmin - Min in X
Xmax - Max in X
Ymin - Min in Y
Ymax - Max in Y
Zmin - Min in Z
Zmax - Max in Z

setRangeZ

public void setRangeZ(double zmin,
                      double zmax)
Sets the z range of calculated surface vertices. The ranges will not affect surface appearance. They affect axes scale appearance.

Parameters:
zmin - the minimum z
zmax - the maximum z

draw

public void draw(H2D h)
Draw H2D histogram

Parameters:
h - H2D histogram

draw

public void draw(P2D h)
Display P2D data holder with X,Y,Z values in 3D. If setSurface applied, it will draw the surface.

Parameters:
h - P2D data holder

draw

public void draw(P3D h)
Display P3D data holder with X,Y,Z values in 3D as surface. If setSurface applied, it will draw the surface

Parameters:
h - P3D data holder.

draw

public void draw(H2D h1,
                 H2D h2)
Plot two H2D histograms on the same plot. When only one histogram is plotted, i.e. h2=null, then the bar option is used. If two histograms are plotted, the surface option is used (in this case the numbers of bins in X and Y should be the same.

Parameters:
h1 - first H2D histogram
h2 - second H2D histogram

draw

public void draw(F2D f1)
Draw F2D function as a surface.

Parameters:
f1 - F2D function

draw

public void draw(F2D f1,
                 F2D f2)
Draw two F2D functions on the same plot. The bar option is not supported, i.e. the functions will be shown by surface.

Parameters:
f1 - first F2D function
f2 - second F2D function

draw

public void draw(H2D h1,
                 F2D h2)
Draw H2D histogram and F2D function on the same plot. Note: the bar option for histogram is not supported. In addition, the number of bins in X and Y should be the same.

Parameters:
h1 - H2D histogram
h2 - F2D function

draw

public void draw(F2D h2,
                 H2D h1)
Draw F2D and H2D on the same plot.

Parameters:
h2 - F2D function
h1 - H2D histogram

close

public void close()
Close the canvas (and dispose all components) Note: a memory leak is found - no time to study it. set to null all the stuff



jHepWork 1.7 (C) Chekanov