jhplot
Class HPlot3D

java.lang.Object
  extended by jhplot.GHPanel
      extended by jhplot.HPlot3D
All Implemented Interfaces:
java.awt.event.ComponentListener, java.util.EventListener

public class HPlot3D
extends GHPanel

This is a main canvas class to display histograms and functions in 3D. Extends GHPanel


Constructor Summary
HPlot3D(java.lang.String title)
          Create a HPlot3D canvas with the default size 400 x 600
HPlot3D(java.lang.String title, int xsize, int ysize)
          Create a HPlot3D canvas
 
Method Summary
 void close()
          Same as distroy
 void distroy()
          Distroy the canvas
 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.
 boolean isSurface()
          Is the plot will be shown as a surface?
 void setBars()
          Set bar type of plot
 void setBoxColor(java.awt.Color a)
          Set color of the box
 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 setFill(boolean fill)
          Set fill color or not for histogram bars
 void setLabelColor(java.awt.Color a)
          Set color of the label
 void setLabelFont(java.awt.Font a)
          Set Font for the labels
 void setLabelOffset(double a)
          Set label offset
 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 setRange(double Xmin, double Xmax, double Ymin, double Ymax)
          Set range fo the 3D plot
 void setRange(double Xmin, double Xmax, double Ymin, double Ymax, double Zmin, double Zmax)
          Set range fo the 3D plot
 void setRangeZ(double zmin, double zmax)
          Sets the z range of calculated surface vertices.
 void setRotation(boolean a)
          Rotate or not HPlot3D
 void setSurface()
          Set surface type of plot
 void setTicFont(java.awt.Font a)
          Set tic fonts
 void setTicOffset(double a)
          Set tic offset
 void update()
          Update thje graphics
 void visible()
          Show the canvas
 void visible(boolean vs)
          Show or not the canvas
 
Methods inherited from class jhplot.GHPanel
addComp, addGraph, componentHidden, componentMoved, componentResized, componentShown, 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
 

Constructor Detail

HPlot3D

public HPlot3D(java.lang.String title,
               int xsize,
               int ysize)
Create a HPlot3D canvas

Parameters:
title - Title of the canvas
xsize - Size in X
ysize - Size in Y

HPlot3D

public HPlot3D(java.lang.String title)
Create a HPlot3D canvas with the default size 400 x 600

Parameters:
title - Title of the canvas
Method Detail

visible

public void visible(boolean vs)
Show or not the canvas

Parameters:
vs - true if it is shown

visible

public void visible()
Show the canvas


distroy

public void distroy()
Distroy the canvas


close

public void close()
Same as distroy


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

setNameY

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

Parameters:
a - Name of the label for Y

setLabelFont

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

Parameters:
a - Font

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 tic fonts

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

setRotation

public void setRotation(boolean a)
Rotate or not HPlot3D

Parameters:
a - true if it should be rotated

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

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

update

public void update()
Update thje graphics


setTicOffset

public void setTicOffset(double a)
Set tic offset

Parameters:
a - tic offset

setLabelOffset

public void setLabelOffset(double a)
Set label offset

Parameters:
a - label offset

setRange

public void setRange(double Xmin,
                     double Xmax,
                     double Ymin,
                     double Ymax)
Set range fo 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 fo 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, attemps to draw 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, attemps to draw 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 hitogram 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


jHepWork 1.1 (C) Chekanov