net.algart.model3d.common.movement
Class MovingSpheresView

java.lang.Object
  extended by net.algart.model3d.common.movement.MovingSpheresView

public class MovingSpheresView
extends java.lang.Object

A tool for drawing the model, represented by MovingSpheresModel class. It is a "view" part of MVC pattern, implemented by this package.

The base task, solved by this class, is creating a BufferedImage instance, which is built and stored in modelImage field by buildModelImage(Object, MovingSpheresModel, int, int) method and can be retrieved by getModelImage() method. Note that this class does not draw anything on screen! It just creates necessary BufferedImage with fully-formed 3D scene and (if addition flag "show statistics" is set) additional textual information. Please see the source code for more details.

AlgART Laboratory 2010

Since:
JDK 1.5
Version:
1.0
Author:
Daniel Alievsky

Field Summary
Modifier and Type Field and Description
protected  java.awt.image.BufferedImage modelImage
           
 
Constructor Summary
Constructor and Description
MovingSpheresView(ParameterGetter pg, int width, int height)
           
 
Method Summary
Modifier and Type Method and Description
 void buildModelImage(java.lang.Object lock, MovingSpheresModel model, int width, int height)
           
protected  java.util.List<ColoringRule> createColoringRules()
           
static java.awt.Color decodeColorWithAlpha(java.lang.String s)
           
 void drawStatusInfo(java.awt.Graphics2D g, int x, int y, int width, MovingSpheresModel model)
           
 int getAntialiasingScale()
           
 java.awt.Color getBackgroundColor()
           
 SimpleColoringRule getBunkerWallColoringRule()
           
 CoordinateSystem3D getCoordinateSystem()
           
 SimpleColoringRule getItemColoringRule()
           
 java.awt.image.BufferedImage getModelImage()
           
 double getZCut()
           
 boolean isShowStatistics()
           
 java.lang.String movementStatusLine(MovingSpheresModel model, long calculationTime, long iterationsCount)
           
 void printAllItemsDump(MovingSpheresModel model, java.io.PrintStream stream)
           
 void setAntialiasingScale(int antialiasingScale)
           
 void setBackgroundColor(java.awt.Color backgroundColor)
           
 void setShowStatistics(boolean showStatistics)
           
 void setZCut(double zCut)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelImage

protected volatile java.awt.image.BufferedImage modelImage
Constructor Detail

MovingSpheresView

public MovingSpheresView(ParameterGetter pg,
                         int width,
                         int height)
Method Detail

getModelImage

public java.awt.image.BufferedImage getModelImage()

getAntialiasingScale

public int getAntialiasingScale()

setAntialiasingScale

public void setAntialiasingScale(int antialiasingScale)

getBackgroundColor

public java.awt.Color getBackgroundColor()

setBackgroundColor

public void setBackgroundColor(java.awt.Color backgroundColor)

getBunkerWallColoringRule

public SimpleColoringRule getBunkerWallColoringRule()

getItemColoringRule

public SimpleColoringRule getItemColoringRule()

getCoordinateSystem

public CoordinateSystem3D getCoordinateSystem()

getZCut

public double getZCut()

setZCut

public void setZCut(double zCut)

isShowStatistics

public boolean isShowStatistics()

setShowStatistics

public void setShowStatistics(boolean showStatistics)

buildModelImage

public void buildModelImage(java.lang.Object lock,
                            MovingSpheresModel model,
                            int width,
                            int height)

drawStatusInfo

public void drawStatusInfo(java.awt.Graphics2D g,
                           int x,
                           int y,
                           int width,
                           MovingSpheresModel model)

movementStatusLine

public java.lang.String movementStatusLine(MovingSpheresModel model,
                                           long calculationTime,
                                           long iterationsCount)

printAllItemsDump

public void printAllItemsDump(MovingSpheresModel model,
                              java.io.PrintStream stream)

createColoringRules

protected java.util.List<ColoringRule> createColoringRules()

decodeColorWithAlpha

public static java.awt.Color decodeColorWithAlpha(java.lang.String s)