|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.proteinshader.gui.MediatorImpl
public class MediatorImpl
Serves as the central mediator central object that allows communication between objects of the gui, the data structure, and the renderer.
| Constructor Summary | |
|---|---|
MediatorImpl(ProteinShaderGUI gui,
GLCanvas canvas)
Constructs a ProteinShaderGUI. |
|
| Method Summary | |
|---|---|
void |
add(ControlPanel controlPanel)
Adds the address of the ControlPanel to the Mediator. |
void |
add(MainMenuBar mainMenuBar)
Adds the address of the MainMenuBar to the Mediator. |
void |
add(Renderer renderer)
Adds the address of the Renderer to the Mediator. |
void |
add(SpringLoadedJFrame controlFrame)
Adds the address of the ControlFrame to the Mediator. |
void |
blendObjectEdges(boolean b)
Turns on or off the ability of the halftoning shaders to soften aliasing (jagged edges) by rendering translucent black silhouettes of tube and ribbon segments (and using jitter) before calling on the halftoning shaders. |
void |
cacheGeometricObject(GeometricListInfo info)
Caches a new geomtric object (sphere or cylinder) in the form of an OpenGL display list and redraws the canvas. |
void |
clickStartAnimation()
Calls on the startAnimation() method of the MotionPanel (equivalent to clicking the Start button on the MotionPanel). |
void |
clickStopAnimation()
Calls on the stopAnimation() method of the MotionPanel (equivalent to clicking the Stop button on the MotionPanel). |
void |
closeControlFrame()
Closes the spring-loaded frame holding the ControlPanel. |
void |
displayErrorAndExit(String title,
String message)
Display an error message in a JOptionPane before exiting. |
void |
displayWarning(String title,
String message)
Display a warning message in a JOptionPane. |
Vector<Texture> |
getBendTextures()
Returns the list of Textures intended for highlighting segment bend regions when halftoning is being used. |
Atom[] |
getCurrentAtoms()
Returns the current Atoms. |
Chain |
getCurrentChain()
Returns the current Chain. |
Model |
getCurrentModel()
Returns the current Model. |
Residue[] |
getCurrentResidues()
Returns the current Residues. |
CylinderListInfo |
getCylinderInfo(StyleEnum style)
Returns the CylinderListInfo object that holds the information on an OpenGL display list for a cylinder that is currently used for drawing Bonds. |
Frame |
getFrame()
Returns the frame that should be used as a parent frame for Dialogs. |
String |
getGraphicsCardInfo()
Returns information on the graphics card that was gathered when the init() method of the Renderer was called. |
Vector<Texture> |
getHalftoningTextures()
Returns the list of Texture objects intended for halftoning. |
Vector<Texture> |
getPatternsTextures()
Returns the list of Texture objects intended for placing patterns on colored surfaces (rather than textures for halftoning). |
SphereListInfo |
getSphereInfo(StyleEnum style)
Returns the SphereListInfo object that holds the information on an OpenGL display list for a sphere that is currently used for drawing Atoms. |
Structure |
getStructure()
Returns the current Structure to display. |
StyleEnum |
getStyle()
Returns the current style (TUBES, RIBBONS, RIBBONS_AND_TUBES, FRENET_FRAMES, SPACE_FILLING, BALLS_AND_STICKS, or STICKS). |
void |
jitterScene(JitterEnum jitter)
Draws the scene multiple times to an accumulation buffer while jittering the xy-coordinates a fraction of a pixel. |
void |
openControlFrame()
Opens the spring-loaded frame holding the ControlPanel. |
void |
readStructure(File file)
Reads in a new Structure to display. |
void |
redrawCanvas()
Redraws the canvas. |
void |
setAutoTiling(boolean autoTiling)
If automatic tiling is set to true, then the level of detail (tiling number) for a sphere or cylinder will be calculated based on the camera distance for each Atom or Bond, respectively. |
void |
setBackgroundColor(float red,
float green,
float blue)
Sets the background color for the canvas. |
void |
setCurrentAtoms(Atom[] atoms)
Sets the current Atoms. |
void |
setCurrentChain(Chain chain)
Sets the current Chain. |
void |
setCurrentModel(Model model)
Sets the current Model. |
void |
setCurrentResidues(Residue[] residues)
Sets the current Residues. |
void |
setExtraLines(boolean b)
Controls whether extra lines (at the beginning and end of each segment of a tube or ribbon) will be shown when the style is a cartoon type. |
void |
setImageOrientation(OrientationEnum orientation)
Sets the image to the requested orientation (Front, Back, Left, etc.). |
void |
setImageScale(double scale)
Sets the scale factor for the image. |
void |
setRadioPanelSelectedMenu(String item)
Sets the "Selected:" menu in the RadioPanel (for both atom and cartoon modifier panels) of the ModiferPanel. |
void |
setStyle(StyleEnum style)
Sets the current style (TUBES, RIBBONS, RIBBONS_AND_TUBES, FRENET_FRAMES, SPACE_FILLING, BALLS_AND_STICKS, or STICKS). |
void |
showAminoAcids(boolean b)
Controls whether the Renderer will display AminoAcids. |
void |
showHeterogens(boolean b)
Controls whether the Renderer will display Heterogens. |
void |
showWaters(boolean b)
Controls whether the Renderer will display Waters. |
void |
startAnimation(double xAxisSpeed,
double yAxisSpeed)
Starts an animation that rotates the image about its x-axis and/or y-axis based on the speeds given as argument. |
void |
stopAnimation()
Stops the rotation that was started with the startAnimation() method. |
void |
takeScreenShot(ImageFormatEnum format,
File file)
Causes the Render to take a screen shot of the current canvas image and save it as a JPEG, PNG or GIF file. |
void |
updateFPSDisplay(double fps)
During a rotation animation the Renderer will call this method to update the ControlPanel with the current frames per second the animation is operating at. |
void |
updateRenderer()
Updates the arrays of visible objects (opaque and translucent Drawables) held by the Renderer and then has the canvas call display(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MediatorImpl(ProteinShaderGUI gui,
GLCanvas canvas)
| Method Detail |
|---|
public void add(SpringLoadedJFrame controlFrame)
add in interface Mediatorpublic void add(ControlPanel controlPanel)
add in interface Mediatorpublic void add(MainMenuBar mainMenuBar)
add in interface Mediatorpublic void add(Renderer renderer)
add in interface Mediatorpublic Structure getStructure()
getStructure in interface Mediatorpublic void readStructure(File file)
readStructure in interface Mediatorfile - a PDB formatted file.public void redrawCanvas()
redrawCanvas in interface Mediatorpublic Model getCurrentModel()
getCurrentModel in interface Mediatorpublic Chain getCurrentChain()
getCurrentChain in interface Mediatorpublic Residue[] getCurrentResidues()
getCurrentResidues in interface Mediatorpublic Atom[] getCurrentAtoms()
getCurrentAtoms in interface Mediatorpublic StyleEnum getStyle()
getStyle in interface Mediatorpublic Frame getFrame()
getFrame in interface Mediatorpublic void cacheGeometricObject(GeometricListInfo info)
cacheGeometricObject in interface Mediatorinfo - describes the geometric object to cache.public SphereListInfo getSphereInfo(StyleEnum style)
getSphereInfo in interface Mediatorpublic CylinderListInfo getCylinderInfo(StyleEnum style)
getCylinderInfo in interface Mediatorpublic Vector<Texture> getPatternsTextures()
getPatternsTextures in interface Mediatorpublic Vector<Texture> getHalftoningTextures()
getHalftoningTextures in interface Mediatorpublic Vector<Texture> getBendTextures()
getBendTextures in interface Mediatorpublic void setCurrentModel(Model model)
setCurrentModel in interface Mediatormodel - the current Model.public void updateRenderer()
updateRenderer in interface Mediatorpublic void setCurrentChain(Chain chain)
setCurrentChain in interface Mediatorchain - the current Chain.public void setCurrentResidues(Residue[] residues)
setCurrentResidues in interface Mediatorresidues - the current Residues.public void setCurrentAtoms(Atom[] atoms)
setCurrentAtoms in interface Mediatoratoms - the current Atoms.public void setStyle(StyleEnum style)
setStyle in interface Mediatorstyle - the current style.public void setImageOrientation(OrientationEnum orientation)
setImageOrientation in interface Mediatororientation - the orientation to set the image to.public void setAutoTiling(boolean autoTiling)
setAutoTiling in interface MediatorautoTiling - boolean value for automatic tiling.public void showAminoAcids(boolean b)
showAminoAcids in interface Mediatorb - a boolean value indicating if AminoAcids should be displayed.public void showHeterogens(boolean b)
showHeterogens in interface Mediatorb - a boolean value indicating if Heterogens should be displayed.public void showWaters(boolean b)
showWaters in interface Mediatorb - a boolean value indicating if Waters should be displayed.public void setExtraLines(boolean b)
setExtraLines in interface Mediatorb - a boolean value indicating if extra lines should be used.public void openControlFrame()
openControlFrame in interface Mediatorpublic void closeControlFrame()
closeControlFrame in interface Mediator
public void displayErrorAndExit(String title,
String message)
displayErrorAndExit in interface Mediatortitle - the title to place on the JOptionPane.message - the error message to display.
public void displayWarning(String title,
String message)
displayWarning in interface Mediatortitle - the title to place on the JOptionPane.message - the warning message to display.
public void startAnimation(double xAxisSpeed,
double yAxisSpeed)
startAnimation in interface MediatorxAxisSpeed - the x-axis speed in degrees per second.yAxisSpeed - the y-axis speed in degrees per second.public void stopAnimation()
stopAnimation in interface Mediatorpublic void clickStartAnimation()
clickStartAnimation in interface Mediatorpublic void clickStopAnimation()
clickStopAnimation in interface Mediatorpublic void updateFPSDisplay(double fps)
updateFPSDisplay in interface Mediatorfps - the frames per second for the animation.public void setImageScale(double scale)
setImageScale in interface Mediatorscale - the scale factor as a double.
public void setBackgroundColor(float red,
float green,
float blue)
setBackgroundColor in interface Mediatorred - the red component of the background color.green - the green component of the background color.blue - the blue component of the background color.
public void takeScreenShot(ImageFormatEnum format,
File file)
takeScreenShot in interface Mediatorformat - the screen shot image format.file - the file to save the screen shot to.public void setRadioPanelSelectedMenu(String item)
setRadioPanelSelectedMenu in interface Mediatoritem - the name of a menu choice.public void blendObjectEdges(boolean b)
blendObjectEdges in interface Mediatorb - boolean value to determine if object edges should be smoothed.public void jitterScene(JitterEnum jitter)
jitterScene in interface Mediatorjitter - the JitterEnum object contains a list of xy-coordinate pairs.public String getGraphicsCardInfo()
getGraphicsCardInfo in interface Mediator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||