|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Mediator
public void add(ControlPanel controlPanel)
add
in interface Mediator
public void add(MainMenuBar mainMenuBar)
add
in interface Mediator
public void add(Renderer renderer)
add
in interface Mediator
public Structure getStructure()
getStructure
in interface Mediator
public void readStructure(File file)
readStructure
in interface Mediator
file
- a PDB formatted file.public void redrawCanvas()
redrawCanvas
in interface Mediator
public Model getCurrentModel()
getCurrentModel
in interface Mediator
public Chain getCurrentChain()
getCurrentChain
in interface Mediator
public Residue[] getCurrentResidues()
getCurrentResidues
in interface Mediator
public Atom[] getCurrentAtoms()
getCurrentAtoms
in interface Mediator
public StyleEnum getStyle()
getStyle
in interface Mediator
public Frame getFrame()
getFrame
in interface Mediator
public void cacheGeometricObject(GeometricListInfo info)
cacheGeometricObject
in interface Mediator
info
- describes the geometric object to cache.public SphereListInfo getSphereInfo(StyleEnum style)
getSphereInfo
in interface Mediator
public CylinderListInfo getCylinderInfo(StyleEnum style)
getCylinderInfo
in interface Mediator
public Vector<Texture> getPatternsTextures()
getPatternsTextures
in interface Mediator
public Vector<Texture> getHalftoningTextures()
getHalftoningTextures
in interface Mediator
public Vector<Texture> getBendTextures()
getBendTextures
in interface Mediator
public void setCurrentModel(Model model)
setCurrentModel
in interface Mediator
model
- the current Model.public void updateRenderer()
updateRenderer
in interface Mediator
public void setCurrentChain(Chain chain)
setCurrentChain
in interface Mediator
chain
- the current Chain.public void setCurrentResidues(Residue[] residues)
setCurrentResidues
in interface Mediator
residues
- the current Residues.public void setCurrentAtoms(Atom[] atoms)
setCurrentAtoms
in interface Mediator
atoms
- the current Atoms.public void setStyle(StyleEnum style)
setStyle
in interface Mediator
style
- the current style.public void setImageOrientation(OrientationEnum orientation)
setImageOrientation
in interface Mediator
orientation
- the orientation to set the image to.public void setAutoTiling(boolean autoTiling)
setAutoTiling
in interface Mediator
autoTiling
- boolean value for automatic tiling.public void showAminoAcids(boolean b)
showAminoAcids
in interface Mediator
b
- a boolean value indicating if AminoAcids should be displayed.public void showHeterogens(boolean b)
showHeterogens
in interface Mediator
b
- a boolean value indicating if Heterogens should be displayed.public void showWaters(boolean b)
showWaters
in interface Mediator
b
- a boolean value indicating if Waters should be displayed.public void setExtraLines(boolean b)
setExtraLines
in interface Mediator
b
- a boolean value indicating if extra lines should be used.public void openControlFrame()
openControlFrame
in interface Mediator
public void closeControlFrame()
closeControlFrame
in interface Mediator
public void displayErrorAndExit(String title, String message)
displayErrorAndExit
in interface Mediator
title
- the title to place on the JOptionPane.message
- the error message to display.public void displayWarning(String title, String message)
displayWarning
in interface Mediator
title
- the title to place on the JOptionPane.message
- the warning message to display.public void startAnimation(double xAxisSpeed, double yAxisSpeed)
startAnimation
in interface Mediator
xAxisSpeed
- the x-axis speed in degrees per second.yAxisSpeed
- the y-axis speed in degrees per second.public void stopAnimation()
stopAnimation
in interface Mediator
public void clickStartAnimation()
clickStartAnimation
in interface Mediator
public void clickStopAnimation()
clickStopAnimation
in interface Mediator
public void updateFPSDisplay(double fps)
updateFPSDisplay
in interface Mediator
fps
- the frames per second for the animation.public void setImageScale(double scale)
setImageScale
in interface Mediator
scale
- the scale factor as a double.public void setBackgroundColor(float red, float green, float blue)
setBackgroundColor
in interface Mediator
red
- 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 Mediator
format
- the screen shot image format.file
- the file to save the screen shot to.public void setRadioPanelSelectedMenu(String item)
setRadioPanelSelectedMenu
in interface Mediator
item
- the name of a menu choice.public void blendObjectEdges(boolean b)
blendObjectEdges
in interface Mediator
b
- boolean value to determine if object edges should be smoothed.public void jitterScene(JitterEnum jitter)
jitterScene
in interface Mediator
jitter
- 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 |