org.opensourcephysics.display3d.core
Interface DrawingPanel3D

All Superinterfaces:
org.opensourcephysics.display3d.core.interaction.InteractionSource
All Known Implementing Classes:
DrawingPanel3D

public interface DrawingPanel3D
extends org.opensourcephysics.display3d.core.interaction.InteractionSource

Title: DrawingPanel3D

Description: DrawingPanel3D is the basic 3D drawing panel


Nested Class Summary
static class DrawingPanel3D.Loader
           
 
Field Summary
static int BOTTOM_LEFT
          Message box location
static int BOTTOM_RIGHT
          Message box location
static int TARGET_PANEL
          The panel itself as the only target of the panel
static int TOP_LEFT
          Message box location
static int TOP_RIGHT
          Message box location
 
Method Summary
 void addElement(Element element)
          Adds an Element to this DrawingPanel3D.
 Camera getCamera()
          Provides the Camera object used to project the scene in 3D modes.
 java.awt.Component getComponent()
          Getting the pointer to the real JPanel in it
 java.util.ArrayList getElements()
          Gets the (cloned) list of Elements.
 double getPreferredMaxX()
          Gets the preferred maximum in the X coordinate
 double getPreferredMaxY()
          Gets the preferred maximum in the Y coordinate
 double getPreferredMaxZ()
          Gets the preferred maximum in the Z coordinate
 double getPreferredMinX()
          Gets the preferred minimum in the X coordinate
 double getPreferredMinY()
          Gets the preferred minimum in the Y coordinate
 double getPreferredMinZ()
          Gets the preferred minimum in the Z coordinate
 VisualizationHints getVisualizationHints()
          Provides the list of visualization hints that the panel uses to display the 3D scene
 boolean isSquareAspect()
          Whether the panel tries to keep a square aspect.
 void removeAllElements()
          Removes all Elements from this DrawingPanel3D
 void removeElement(Element element)
          Removes an Element from this DrawingPanel3D
 java.awt.image.BufferedImage render()
          Paints the panel immediately from within the calling thread.
 java.awt.Image render(java.awt.Image image)
          Paints the scene using the graphic context of the provided image
 void repaint()
          Repaints the panel using the event queue.
 void setPreferredMinMax(double minX, double maxX, double minY, double maxY, double minZ, double maxZ)
          Sets the preferred extrema for the panel.
 void setSquareAspect(boolean square)
          Whether the panel should try to keep a square aspect.
 void zoomToFit()
          Sets the preferred min and max in each dimension so that all elements currently in the panel are visible.
 
Methods inherited from interface org.opensourcephysics.display3d.core.interaction.InteractionSource
addInteractionListener, getInteractionTarget, removeInteractionListener
 

Field Detail

TARGET_PANEL

public static final int TARGET_PANEL
The panel itself as the only target of the panel

See Also:
Constant Field Values

BOTTOM_LEFT

public static final int BOTTOM_LEFT
Message box location

See Also:
Constant Field Values

BOTTOM_RIGHT

public static final int BOTTOM_RIGHT
Message box location

See Also:
Constant Field Values

TOP_RIGHT

public static final int TOP_RIGHT
Message box location

See Also:
Constant Field Values

TOP_LEFT

public static final int TOP_LEFT
Message box location

See Also:
Constant Field Values
Method Detail

getComponent

public java.awt.Component getComponent()
Getting the pointer to the real JPanel in it

Returns:
JFrame

setPreferredMinMax

public void setPreferredMinMax(double minX,
                               double maxX,
                               double minY,
                               double maxY,
                               double minZ,
                               double maxZ)
Sets the preferred extrema for the panel. This resets the camera of the panel to its default.

Parameters:
minX - double
maxX - double
minY - double
maxY - double
minZ - double
maxZ - double
See Also:
Camera

getPreferredMinX

public double getPreferredMinX()
Gets the preferred minimum in the X coordinate

Returns:
double

getPreferredMaxX

public double getPreferredMaxX()
Gets the preferred maximum in the X coordinate

Returns:
double

getPreferredMinY

public double getPreferredMinY()
Gets the preferred minimum in the Y coordinate

Returns:
double

getPreferredMaxY

public double getPreferredMaxY()
Gets the preferred maximum in the Y coordinate

Returns:
double

getPreferredMinZ

public double getPreferredMinZ()
Gets the preferred minimum in the Z coordinate

Returns:
double

getPreferredMaxZ

public double getPreferredMaxZ()
Gets the preferred maximum in the Z coordinate

Returns:
double

zoomToFit

public void zoomToFit()
Sets the preferred min and max in each dimension so that all elements currently in the panel are visible.


setSquareAspect

public void setSquareAspect(boolean square)
Whether the panel should try to keep a square aspect. Default value is true.

Parameters:
square - boolean

isSquareAspect

public boolean isSquareAspect()
Whether the panel tries to keep a square aspect.

Returns:
boolean

getVisualizationHints

public VisualizationHints getVisualizationHints()
Provides the list of visualization hints that the panel uses to display the 3D scene

Returns:
VisualizationHints
See Also:
VisualizationHints

getCamera

public Camera getCamera()
Provides the Camera object used to project the scene in 3D modes.

Returns:
Camera
See Also:
Camera

render

public java.awt.image.BufferedImage render()
Paints the panel immediately from within the calling thread.

Returns:
BufferedImage the generated image

render

public java.awt.Image render(java.awt.Image image)
Paints the scene using the graphic context of the provided image

Parameters:
image - Image
Returns:
Image the generated image

repaint

public void repaint()
Repaints the panel using the event queue.


addElement

public void addElement(Element element)
Adds an Element to this DrawingPanel3D.

Parameters:
element - Element
See Also:
Element

removeElement

public void removeElement(Element element)
Removes an Element from this DrawingPanel3D

Parameters:
element - Element
See Also:
Element

removeAllElements

public void removeAllElements()
Removes all Elements from this DrawingPanel3D

See Also:
Element

getElements

public java.util.ArrayList getElements()
Gets the (cloned) list of Elements. (Should be synchronized.)

Returns:
cloned list