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

java.lang.Object
  extended byorg.devaki.nextobjects.workspace.models.graphics.ObjectView
      extended byorg.devaki.nextobjects.workspace.models.graphics.ClassView
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AssociationView, EntityView, LabelView, ModelTitleView, TableView

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

This class is responsible for drawing all classes-like objects

Author:
Emmanuel Florent
See Also:
Serialized Form

Field Summary
protected  java.awt.Font font
           
protected  java.awt.Font fontI
           
protected  java.awt.FontMetrics metriques
          Font metrics
protected  ClassStyle myStyle
          The style
protected  java.awt.Rectangle oldRectangle
          Old size and location
 java.awt.Rectangle rectangle
          Size and location
 
Fields inherited from class org.devaki.nextobjects.workspace.models.graphics.ObjectView
actionPoint, myObject, selectionPoints
 
Constructor Summary
ClassView()
          Construct a new ObjectView object
ClassView(BaseObject pObject)
          Construct a new ObjectView object
 
Method Summary
 java.awt.Dimension autoResize(boolean act_it)
          Return the optimal surface of the object Optionaly resize the object.
 java.awt.Point getLocation()
          Get the location
 java.awt.Point getMiddlePoint()
          Returns a computed gravity center.
 java.awt.Rectangle getOldrectangle()
          Get the old Rectangle
 java.awt.Dimension getSize()
          Get the size
 ClassStyle getStyle()
          Get the style
 java.awt.Polygon getSurface()
          Get the surface on which the user can click to select the object
 void printColumns(java.awt.Graphics2D g2, int x, int y)
          Paint the text common in all ClassViews
 void resetSelectionPoint()
          ResetSelectionPoint
 void setLocation(java.awt.Point p)
          Set the location
 void setOldLocation(java.awt.Point p)
          Set the old location
 void setOldSize(java.awt.Dimension pDimension)
          Set the old size
 void setSize(java.awt.Dimension pDimension)
          Define the size
 void setStyle(ClassStyle pStyle)
          Define the style
 
Methods inherited from class org.devaki.nextobjects.workspace.models.graphics.ObjectView
getBaseObject, getSelectionPoint, getSelectionPoints, paint, renderSelected, resetActionLocation, setActionLocation, setBaseObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myStyle

protected ClassStyle myStyle
The style


metriques

protected java.awt.FontMetrics metriques
Font metrics


font

protected java.awt.Font font

fontI

protected java.awt.Font fontI

rectangle

public java.awt.Rectangle rectangle
Size and location


oldRectangle

protected java.awt.Rectangle oldRectangle
Old size and location

Constructor Detail

ClassView

public ClassView(BaseObject pObject)
Construct a new ObjectView object

Parameters:
pObject - the context object

ClassView

public ClassView()
Construct a new ObjectView object

Method Detail

getMiddlePoint

public java.awt.Point getMiddlePoint()
Returns a computed gravity center.

Returns:
the middle point

getStyle

public ClassStyle getStyle()
Get the style

Returns:
the style

setStyle

public void setStyle(ClassStyle pStyle)
Define the style

Parameters:
pStyle - the context style

getLocation

public java.awt.Point getLocation()
Get the location

Specified by:
getLocation in class ObjectView
Returns:
the location

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()
Get the size

Overrides:
getSize in class ObjectView
Returns:
the dimension

setSize

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

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

getOldrectangle

public java.awt.Rectangle getOldrectangle()
Get the old Rectangle

Returns:
the old rectangle

setOldLocation

public void setOldLocation(java.awt.Point p)
Set the old location

Parameters:
p - the old location

setOldSize

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

Parameters:
pDimension - the old size

resetSelectionPoint

public void resetSelectionPoint()
ResetSelectionPoint

Specified by:
resetSelectionPoint in class ObjectView

getSurface

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

Specified by:
getSurface in class ObjectView
Returns:
the shape

autoResize

public java.awt.Dimension autoResize(boolean act_it)
Return the optimal surface of the object Optionaly resize the object.

Parameters:
act_it - really set the size or just return
Returns:
the dimension

printColumns

public void printColumns(java.awt.Graphics2D g2,
                         int x,
                         int y)
Paint the text common in all ClassViews

Parameters:
g2 - the graphics g
x - optional offset X
y - optional offset y


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