org.devaki.nextobjects.workspace.models.graphics
Class ObjectView

java.lang.Object
  extended byorg.devaki.nextobjects.workspace.models.graphics.ObjectView
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ClassView, LineView

public abstract class ObjectView
extends java.lang.Object
implements java.io.Serializable

This class is responsible of drawing an object

Author:
Emmanuel Florent
See Also:
Serialized Form

Field Summary
protected  java.awt.Point actionPoint
          Action point : the point where the object is to be moved.
protected  BaseObject myObject
          the context objects
protected  SelectionPoint[] selectionPoints
          selections points
 
Constructor Summary
ObjectView()
          Construct a new 'ObjectView' object
ObjectView(BaseObject pObject)
          Construct a new 'ObjectView' object
 
Method Summary
 BaseObject getBaseObject()
          Get the object represented by this view
abstract  java.awt.Point getLocation()
          The parent function needs to be overriden because of a bug in the program.
 SelectionPoint getSelectionPoint(int i)
          Return the Selection Point
 SelectionPoint[] getSelectionPoints()
          Return the Selection Points Array
 java.awt.Dimension getSize()
          Define the dimension
abstract  java.awt.Polygon getSurface()
          Get the surface on which the user can click to select the object
abstract  void paint(java.awt.Graphics g)
          paint
 void renderSelected(java.awt.Graphics g)
          Paint selection around the object
 void resetActionLocation()
           
abstract  void resetSelectionPoint()
          Reset Selection points do nothing
 void setActionLocation(int pX, int pY)
           
 void setBaseObject(BaseObject pBaseObject)
          Set the object represented by this view
abstract  void setLocation(java.awt.Point p)
          Set the location
abstract  void setSize(java.awt.Dimension pDimension)
          Define the dimension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myObject

protected BaseObject myObject
the context objects


selectionPoints

protected SelectionPoint[] selectionPoints
selections points


actionPoint

protected java.awt.Point actionPoint
Action point : the point where the object is to be moved.

Constructor Detail

ObjectView

public ObjectView(BaseObject pObject)
Construct a new 'ObjectView' object

Parameters:
pObject - the object

ObjectView

public ObjectView()
Construct a new 'ObjectView' object

Method Detail

setActionLocation

public void setActionLocation(int pX,
                              int pY)

resetActionLocation

public void resetActionLocation()

renderSelected

public void renderSelected(java.awt.Graphics g)
Paint selection around the object

Parameters:
g - Graphic axis of the main view

getSurface

public abstract java.awt.Polygon getSurface()
Get the surface on which the user can click to select the object

Returns:
the surface shape

getSelectionPoints

public SelectionPoint[] getSelectionPoints()
Return the Selection Points Array

Returns:
selections points

getSelectionPoint

public SelectionPoint getSelectionPoint(int i)
Return the Selection Point

Parameters:
i - index
Returns:
selectionPoint

setLocation

public abstract void setLocation(java.awt.Point p)
Set the location

Parameters:
p - the location

getLocation

public abstract java.awt.Point getLocation()
The parent function needs to be overriden because of a bug in the program.

Returns:
the location

setSize

public abstract void setSize(java.awt.Dimension pDimension)
Define the dimension

Parameters:
pDimension - the dimension

getSize

public java.awt.Dimension getSize()
Define the dimension

Returns:
the dimension

setBaseObject

public void setBaseObject(BaseObject pBaseObject)
Set the object represented by this view

Parameters:
pBaseObject - the context object

getBaseObject

public BaseObject getBaseObject()
Get the object represented by this view

Returns:
the object

resetSelectionPoint

public abstract void resetSelectionPoint()
Reset Selection points do nothing


paint

public abstract void paint(java.awt.Graphics g)
paint

Parameters:
g - the graphics context


Copyright © 2002-2004 devaki.org. All Rights Reserved.