org.diylc.presenter
Class DrawingManager

java.lang.Object
  extended by org.diylc.presenter.DrawingManager

public class DrawingManager
extends java.lang.Object

Utility that deals with painting Project on the Graphics2D and keeps areas taken by each drawn component.

Author:
Branislav Stojkovic

Field Summary
static java.awt.Color CONTROL_POINT_COLOR
           
static int CONTROL_POINT_SIZE
           
static java.lang.String DEBUG_COMPONENT_AREAS
           
static java.awt.Color SELECTED_CONTROL_POINT_COLOR
           
static java.lang.String ZOOM_KEY
           
 
Constructor Summary
DrawingManager(org.diylc.appframework.simplemq.MessageDispatcher<EventType> messageDispatcher)
           
 
Method Summary
 void clearComponentAreaMap()
           
 java.util.List<IDIYComponent<?>> drawProject(java.awt.Graphics2D g2d, Project project, java.util.Set<DrawOption> drawOptions, IComponentFiler filter, java.awt.Rectangle selectionRect, java.util.List<IDIYComponent<?>> selectedComponents, java.util.Set<IDIYComponent<?>> lockedComponents, java.util.Set<IDIYComponent<?>> groupedComponents, java.util.List<java.awt.Point> controlPointSlot, java.util.List<IDIYComponent<?>> componentSlot, boolean dragInProgress)
          Paints the project onto the canvas and returns the list of components that failed to draw.
 java.util.List<IDIYComponent<?>> findComponentsAt(java.awt.Point point, Project project)
           
 void fireZoomChanged()
           
 java.awt.Dimension getCanvasDimensions(Project project, java.lang.Double zoomLevel, boolean useZoom)
           
 java.awt.geom.Area getComponentArea(IDIYComponent<?> component)
           
 Theme getTheme()
           
 double getZoomLevel()
           
 void invalidateComponent(IDIYComponent<?> component)
           
 void setTheme(Theme theme)
           
 void setZoomLevel(double zoomLevel)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTROL_POINT_SIZE

public static int CONTROL_POINT_SIZE

ZOOM_KEY

public static final java.lang.String ZOOM_KEY
See Also:
Constant Field Values

DEBUG_COMPONENT_AREAS

public static java.lang.String DEBUG_COMPONENT_AREAS

CONTROL_POINT_COLOR

public static java.awt.Color CONTROL_POINT_COLOR

SELECTED_CONTROL_POINT_COLOR

public static java.awt.Color SELECTED_CONTROL_POINT_COLOR
Constructor Detail

DrawingManager

public DrawingManager(org.diylc.appframework.simplemq.MessageDispatcher<EventType> messageDispatcher)
Method Detail

drawProject

public java.util.List<IDIYComponent<?>> drawProject(java.awt.Graphics2D g2d,
                                                    Project project,
                                                    java.util.Set<DrawOption> drawOptions,
                                                    IComponentFiler filter,
                                                    java.awt.Rectangle selectionRect,
                                                    java.util.List<IDIYComponent<?>> selectedComponents,
                                                    java.util.Set<IDIYComponent<?>> lockedComponents,
                                                    java.util.Set<IDIYComponent<?>> groupedComponents,
                                                    java.util.List<java.awt.Point> controlPointSlot,
                                                    java.util.List<IDIYComponent<?>> componentSlot,
                                                    boolean dragInProgress)
Paints the project onto the canvas and returns the list of components that failed to draw.

Parameters:
g2d -
project -
drawOptions -
filter -
selectionRect -
selectedComponents -
lockedComponents -
groupedComponents -
controlPointSlot -
componentSlot -
dragInProgress -
Returns:

getZoomLevel

public double getZoomLevel()

setZoomLevel

public void setZoomLevel(double zoomLevel)

invalidateComponent

public void invalidateComponent(IDIYComponent<?> component)

getComponentArea

public java.awt.geom.Area getComponentArea(IDIYComponent<?> component)

clearComponentAreaMap

public void clearComponentAreaMap()

findComponentsAt

public java.util.List<IDIYComponent<?>> findComponentsAt(java.awt.Point point,
                                                         Project project)

getCanvasDimensions

public java.awt.Dimension getCanvasDimensions(Project project,
                                              java.lang.Double zoomLevel,
                                              boolean useZoom)

fireZoomChanged

public void fireZoomChanged()

getTheme

public Theme getTheme()

setTheme

public void setTheme(Theme theme)