FreeHEP API
Version current

org.freehep.graphics3d
Class PanelArtist3D

java.lang.Object
  extended byorg.freehep.swing.graphics.AbstractPanelArtist
      extended byorg.freehep.graphics3d.PanelArtist3D
All Implemented Interfaces:
EventListener, GraphicalSelectionListener, PanelArtist

public class PanelArtist3D
extends AbstractPanelArtist

A panel artists which handles 3D projections and manipulations with the mouse. It uses an ArcBall for its rotations.

Version:
$Id: PanelArtist3D.java,v 1.6 2002/08/12 17:17:15 duns Exp $
Author:
Mark Donszelmann
Source Code:
PanelArtist3D.java

Constructor Summary
PanelArtist3D()
          Creates a standard 3D panel artist, with mouse interactions enabled
 
Method Summary
 void abortDraw()
          This method aborts any drawing which is being done in another thread.
 void add(DrawableProvider provider)
          Adds a drawable provider to the list
protected  void drawObject(VectorGraphics g, Object obj)
          Draws/handles a single object.
protected  void drawObjects(VectorGraphics g, Enumeration e)
          Iterates over al drawable providers and calls drawObject on them
 boolean drawPanel()
          Applies the current ArcBall matrix to the model matrix and iterates over all the drawable providers.
 JComponent getControlPanel()
          This method returns a JComponent which contains controls for the given PanelArtist.
 String getDescription()
          This returns a descriptive string for this PanelArtist.
 Object getEventData()
          This method returns the data sample which is currently being used.
 StackedPanel getStackedPanel()
          Return the StackedPanel which is being controlled.
 void graphicalSelectionMade(GraphicalSelectionEvent event)
          Called when the user makes a graphical selection.
 void panelResized()
          This method is called when the size of the StackedPanel has changed.
 void remove(DrawableProvider provider)
          removes a drawable procvider from the list
 void setEventData(Object data)
          This method sets which data sample should be used.
 void setStackedPanel(StackedPanel panel)
          Set the StackedPanel that this PanelArtist will control.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PanelArtist3D

public PanelArtist3D()
Creates a standard 3D panel artist, with mouse interactions enabled

Method Detail

getDescription

public String getDescription()
Description copied from interface: PanelArtist
This returns a descriptive string for this PanelArtist.

Returns:
a String describing this PanelArtist

setEventData

public void setEventData(Object data)
Description copied from interface: PanelArtist
This method sets which data sample should be used.

Parameters:
data - data sample to use

getEventData

public Object getEventData()
Description copied from interface: PanelArtist
This method returns the data sample which is currently being used.

Returns:
the event data currently being used.

setStackedPanel

public void setStackedPanel(StackedPanel panel)
Description copied from interface: PanelArtist
Set the StackedPanel that this PanelArtist will control.

Parameters:
panel - StackedPanel to control

getStackedPanel

public StackedPanel getStackedPanel()
Description copied from interface: PanelArtist
Return the StackedPanel which is being controlled.

Returns:
the StackedPanel which is being controlled

abortDraw

public void abortDraw()
Description copied from interface: PanelArtist
This method aborts any drawing which is being done in another thread. This method should NOT return until the drawing has been stopped.


getControlPanel

public JComponent getControlPanel()
Description copied from interface: PanelArtist
This method returns a JComponent which contains controls for the given PanelArtist. The implementing class may return null if no controls are relevant.

Returns:
JComponent containing controls for the Panel Artist

graphicalSelectionMade

public void graphicalSelectionMade(GraphicalSelectionEvent event)
Description copied from interface: GraphicalSelectionListener
Called when the user makes a graphical selection. The graphical selection is an abstract idea which should be make specific by subclasses of the GraphicalSelectionEvent and of GraphicalSelectionPanel.


add

public void add(DrawableProvider provider)
Adds a drawable provider to the list


remove

public void remove(DrawableProvider provider)
removes a drawable procvider from the list


drawPanel

public boolean drawPanel()
Applies the current ArcBall matrix to the model matrix and iterates over all the drawable providers.

Returns:
boolean indicating whether the drawing has completed

drawObjects

protected void drawObjects(VectorGraphics g,
                           Enumeration e)
Iterates over al drawable providers and calls drawObject on them


drawObject

protected void drawObject(VectorGraphics g,
                          Object obj)
Draws/handles a single object. Currently there is support for:


panelResized

public void panelResized()
Description copied from interface: PanelArtist
This method is called when the size of the StackedPanel has changed. This gives the implementing class the opportunity to change transformation matricies, flag that a redraw is needed, etc.


FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.