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

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

public abstract class LineView
extends ObjectView
implements java.io.Serializable

This class is responsible for drawing all line-like objects

Author:
Emmanuel Florent
See Also:
Serialized Form

Field Summary
protected  LineStyle myStyle
          The style
 
Fields inherited from class org.devaki.nextobjects.workspace.models.graphics.ObjectView
actionPoint, myObject, selectionPoints
 
Constructor Summary
LineView(BaseObject pObject)
          Create a new instance of LineView
 
Method Summary
 void computeBestPoints()
          Compute the best point (North -S-E-W , ...) to use for drawing the line
 void computeBestPoints(java.awt.Point p1)
          Compute the best point for a given mouse click.
 SelectionPoint getChildClassPoint()
          Get the child class control point
 int getForeignPosition()
          Get the position ( N,S,E,W,NE,...) of the selection point for the point foreign to the line (child class) This method is used during (de)serialization
 int getLocalPosition()
          Get the position ( N,S,E,W,NE,...) of the selection point for the point local to the line (parent class) This method is used during (de)serialization
 java.awt.Point getLocation()
          Return the location This is ambiguous for a line but we provide graphic context as a smallest rectangle containig the line...
 SelectionPoint getParentClassPoint()
          Get the parent class control point
 java.awt.Point getSelectionPoint(java.awt.Point pPoint)
          Get the closest SelectionPoint.
 java.awt.Dimension getSize()
          Return the size This is ambiguous for a line but we provide graphic context as a smallest rectangle containig the line...
 LineStyle getStyle()
          Get the style
abstract  java.awt.Polygon getSurface()
          Return the surface on which the user can click to select the object
 void renderSelected(java.awt.Graphics g)
          Paint selection around the object
 void setChildClassPoint(SelectionPoint pSelectionPoint)
          Set the child class control point
 void setForeignPosition(int pPosition)
          set the position ( N,S,E,W,NE,...) of the selection point for the point foreign to the line (child class) This method is used during (de)serialization
 void setLocalPosition(int pPosition)
          set the position ( N,S,E,W,NE,...) of the selection point for the point local to the line (parent class) This method is used during (de)serialization
 void setLocation(java.awt.Point p)
          Set the Location
 void setParentClassPoint(SelectionPoint pSelectionPoint)
          Set the parent class control point
 void setSize(java.awt.Dimension pDimension)
          Set the size
 void setStyle(LineStyle pStyle)
          Define the style
 
Methods inherited from class org.devaki.nextobjects.workspace.models.graphics.ObjectView
getBaseObject, getSelectionPoint, getSelectionPoints, paint, resetActionLocation, resetSelectionPoint, setActionLocation, setBaseObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myStyle

protected LineStyle myStyle
The style

Constructor Detail

LineView

public LineView(BaseObject pObject)
Create a new instance of LineView

Parameters:
pObject - the context object
Method Detail

renderSelected

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

Overrides:
renderSelected in class ObjectView
Parameters:
g - Graphic axis of the main view

getLocation

public java.awt.Point getLocation()
Return the location This is ambiguous for a line but we provide graphic context as a smallest rectangle containig the line...

Specified by:
getLocation in class ObjectView
Returns:
the smallest rectangle location

getSelectionPoint

public java.awt.Point getSelectionPoint(java.awt.Point pPoint)
Get the closest SelectionPoint.

Parameters:
pPoint - the pointed point
Returns:
the closest SelectionPoint

setLocation

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

Specified by:
setLocation in class ObjectView
Parameters:
p - the location

getSize

public java.awt.Dimension getSize()
Return the size This is ambiguous for a line but we provide graphic context as a smallest rectangle containig the line...

Overrides:
getSize in class ObjectView
Returns:
the dimension

setSize

public void setSize(java.awt.Dimension pDimension)
Set the size

Specified by:
setSize in class ObjectView
Parameters:
pDimension - the dimension

getSurface

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

Specified by:
getSurface in class ObjectView
Returns:
the surface as polygon/shape

getParentClassPoint

public SelectionPoint getParentClassPoint()
Get the parent class control point

Returns:
the parent selection point

getChildClassPoint

public SelectionPoint getChildClassPoint()
Get the child class control point

Returns:
the child selection point

setParentClassPoint

public void setParentClassPoint(SelectionPoint pSelectionPoint)
Set the parent class control point

Parameters:
pSelectionPoint - the selection point

setChildClassPoint

public void setChildClassPoint(SelectionPoint pSelectionPoint)
Set the child class control point

Parameters:
pSelectionPoint - the selection point

getStyle

public LineStyle getStyle()
Get the style

Returns:
the style object

setStyle

public void setStyle(LineStyle pStyle)
Define the style

Parameters:
pStyle - the style

computeBestPoints

public void computeBestPoints()
Compute the best point (North -S-E-W , ...) to use for drawing the line


setLocalPosition

public void setLocalPosition(int pPosition)
set the position ( N,S,E,W,NE,...) of the selection point for the point local to the line (parent class) This method is used during (de)serialization

Parameters:
pPosition -
See Also:
SelectionPoint

setForeignPosition

public void setForeignPosition(int pPosition)
set the position ( N,S,E,W,NE,...) of the selection point for the point foreign to the line (child class) This method is used during (de)serialization

Parameters:
pPosition -
See Also:
SelectionPoint

getLocalPosition

public int getLocalPosition()
Get the position ( N,S,E,W,NE,...) of the selection point for the point local to the line (parent class) This method is used during (de)serialization

Returns:
the north
See Also:
SelectionPoint

getForeignPosition

public int getForeignPosition()
Get the position ( N,S,E,W,NE,...) of the selection point for the point foreign to the line (child class) This method is used during (de)serialization

Returns:
the north
See Also:
SelectionPoint

computeBestPoints

public void computeBestPoints(java.awt.Point p1)
Compute the best point for a given mouse click.

Parameters:
p1 - the clicked point


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