jhplot
Class HPlot3DP
- java.lang.Object
-
- jhplot.gui.GHPanel
-
- jhplot.gui.GHFrame
-
- jhplot.HPlot3DP
-
- All Implemented Interfaces:
- java.awt.event.ComponentListener, java.io.Serializable, java.util.EventListener
public class HPlot3DP extends GHFrame
Create a frame for showing 3D parametric functions.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description boolean
set
-
Constructor Summary
Constructors Constructor and Description HPlot3DP()
Construct a canvas with a plot with the default parameters 600 by 400, and 10% space for the global title "Default"HPlot3DP(java.lang.String title)
Construct a canvas with a plot with the default parameters 600 by 400, and 10% space for the global titleHPlot3DP(java.lang.String title, int xs, int ys)
Construct a canvas with a single plot/graphHPlot3DP(java.lang.String title, int xs, int ys, int n1, int n2)
Construct a canvas with plots/graphsHPlot3DP(java.lang.String title, int xsize, int ysize, int n1, int n2, boolean set)
Create a canvas with several plots showing 3D function
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description 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
destroy()
Destroy the canvas framevoid
doc()
Show online documentation.void
draw(FPR h)
Draw a parametric function.void
draw(FPR[] f)
Draw array of functionsdouble
getCameraPosition()
Get camera position.double[]
getEyePosition()
Get a vector with eye positiondouble
getFov()
Get field of visionvoid
quit()
void
resizePad(double widthScale, double heightScale)
Resize the current pad.void
setAxes(boolean bShowAxes)
Set all axes or notvoid
setAxes(boolean axisX, boolean axisY, boolean axisZ)
Show or not axes for X, Y, Zvoid
setAxesArrows(boolean showArrows)
Show or not small arrows on axesvoid
setAxesColor(java.awt.Color c)
Set Color for axesvoid
setAxisArrows(boolean showArrows)
Set or not arrows for axisvoid
setBackgColor(java.awt.Color c)
Set background for current padvoid
setCameraPosition(double d)
Set camera positionvoid
setEyePosition(double x, double y, double z)
Set position oy eyevoid
setFog(boolean fogEnabled)
Set fog for objectsvoid
setFontValue(java.awt.Font font)
Set Font for axis numbersvoid
setFov(double factor)
Set field of visionvoid
setLabelColor(java.awt.Color color)
Set Color for the labelsvoid
setLabelFont(java.awt.Font font)
Set Font for the labelsvoid
setNameX(java.lang.String name)
Set a name for X axisvoid
setNameY(java.lang.String name)
Set a name for Y axisvoid
setNameZ(java.lang.String name)
Set a name for Z axisvoid
setRangeX(double min, double max)
Set range for X axisvoid
setRangeY(double min, double max)
Set range for Yvoid
setRangeZ(double min, double max)
Set range for Zvoid
update()
Just update the current plot selected using cd() methodvoid
updateAll()
Refresh all the plots on the same canvas HPLOTvoid
visible()
Set the canvas frame visiblevoid
visible(boolean vs)
Set the canvas frame visible or notvoid
visible(int posX, int posY)
Set the canvas frame visible.-
Methods inherited from class jhplot.gui.GHFrame
addGraph, cd, componentHidden, componentMoved, componentShown, getCdX, getCdY, getFrame, getHTMLUrl, getNtotX, getNtotY, setPlotsNum, updateFrame
-
Methods inherited from class jhplot.gui.GHPanel
addComp, componentResized, convertSVG, convertSVG, disableDoubleBuffering, enableDoubleBuffering, export, 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
-
-
-
-
Constructor Detail
-
HPlot3DP
public HPlot3DP(java.lang.String title, int xsize, int ysize, int n1, int n2, boolean set)
Create a canvas with several plots showing 3D function- Parameters:
title
- Titlexsize
- size in x directionysize
- size in y directionn1
- number of plots/graphs in xn2
- number of plots/graphs in yset
- set or not the graph
-
HPlot3DP
public HPlot3DP(java.lang.String title, int xs, int ys)
Construct a canvas with a single plot/graph- Parameters:
title
- Title for the canvasxs
- size in xys
- size in y
-
HPlot3DP
public HPlot3DP(java.lang.String title, int xs, int ys, int n1, int n2)
Construct a canvas with plots/graphs- Parameters:
title
- Title for the canvasxs
- size in xys
- size in yn1
- number of plots/graphs in xn2
- number of plots/graphs in y
-
HPlot3DP
public HPlot3DP(java.lang.String title)
Construct a canvas with a plot with the default parameters 600 by 400, and 10% space for the global title- Parameters:
title
- Title
-
HPlot3DP
public HPlot3DP()
Construct a canvas with a plot with the default parameters 600 by 400, and 10% space for the global title "Default"
-
-
Method Detail
-
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(int posX, int posY)
Set the canvas frame visible. Also set its location.- Parameters:
posX
- - the x-coordinate of the new location's top-left corner in the parent's coordinate space;posY
- - he y-coordinate of the new location's top-left corner in the parent's coordinate space
-
visible
public void visible()
Set the canvas frame visible
-
destroy
public void destroy()
Destroy the canvas frame
-
resizePad
public void resizePad(double widthScale, double heightScale)
Resize the current pad. It calculates the original pad sizes, and then scale it by a given factor. In this case, the pad sizes can be different.- Parameters:
widthScale
- scale factor applied to the width of the current padheightScale
- scale factor applied the height of the current pad.
-
update
public void update()
Just update the current plot selected using cd() method
-
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 Xi2
- location of the graph in Y
-
draw
public void draw(FPR h)
Draw a parametric function.- Parameters:
h
-
-
draw
public void draw(FPR[] f)
Draw array of functions- Parameters:
f
- array of functions
-
setRangeX
public void setRangeX(double min, double max)
Set range for X axis- Parameters:
min
- min valuemax
- max value
-
setRangeY
public void setRangeY(double min, double max)
Set range for Y- Parameters:
min
- min valuemax
- max value
-
setRangeZ
public void setRangeZ(double min, double max)
Set range for Z- Parameters:
min
- min valuemax
- max value
-
setFov
public void setFov(double factor)
Set field of vision- Parameters:
factor
- factor
-
getFov
public double getFov()
Get field of vision- Returns:
- factor
-
setBackgColor
public void setBackgColor(java.awt.Color c)
Set background for current pad- Parameters:
c
- color
-
setEyePosition
public void setEyePosition(double x, double y, double z)
Set position oy eye- Parameters:
x
-y
-z
-
-
setAxisArrows
public void setAxisArrows(boolean showArrows)
Set or not arrows for axis- Parameters:
showArrows
- true if shown
-
getEyePosition
public double[] getEyePosition()
Get a vector with eye position- Returns:
- array with positions
-
getCameraPosition
public double getCameraPosition()
Get camera position. It is 0 by deafult. Negative value means sooming out, positive is zooming in.- Returns:
- camera position. Position: zooming in
-
setCameraPosition
public void setCameraPosition(double d)
Set camera position- Parameters:
d
- set camera position
-
setFog
public void setFog(boolean fogEnabled)
Set fog for objects- Parameters:
fogEnabled
-
-
setAxes
public void setAxes(boolean bShowAxes)
Set all axes or not- Parameters:
bShowAxes
- true if shown
-
setNameX
public void setNameX(java.lang.String name)
Set a name for X axis- Parameters:
name
- Name of the label for X
-
setNameY
public void setNameY(java.lang.String name)
Set a name for Y axis- Parameters:
name
- Name of the label for Y
-
setNameZ
public void setNameZ(java.lang.String name)
Set a name for Z axis- Parameters:
name
- Name of the label for Y
-
setLabelFont
public void setLabelFont(java.awt.Font font)
Set Font for the labels- Parameters:
font
- Font
-
setLabelColor
public void setLabelColor(java.awt.Color color)
Set Color for the labels- Parameters:
color
- Color
-
setAxesColor
public void setAxesColor(java.awt.Color c)
Set Color for axes- Parameters:
color
- Color
-
setFontValue
public void setFontValue(java.awt.Font font)
Set Font for axis numbers- Parameters:
font
- Font
-
setAxes
public void setAxes(boolean axisX, boolean axisY, boolean axisZ)
Show or not axes for X, Y, Z- Parameters:
axisX
-axisY
-axisZ
-
-
setAxesArrows
public void setAxesArrows(boolean showArrows)
Show or not small arrows on axes- Parameters:
showArrows
- set true if arrows are shown (default)
-
clearAll
public void clearAll()
Clear all graphs from data and settings.
-
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
-
quit
public void quit()
-
doc
public void doc()
Show online documentation.
-
-
DMelt 3.0 © DataMelt by jWork.ORG