SEdit.Graphics
Class GObject

java.lang.Object
  extended bySEdit.Graphics.GObject
Direct Known Subclasses:
GArrow, GConnect, GNode

public abstract class GObject
extends Object

classe abstraite correspondant à la représentation graphique des éléments de la structure.

See Also:
SElement

Field Summary
static int BOTTOM
           
protected  Rectangle bounds
           
static int CENTER
           
protected  boolean displayLabel
           
protected  SElement element
           
protected  int height
           
protected  int labelLocation
           
static int LEFT
           
static int RIGHT
           
 boolean selected
           
static int TOP
           
static int TOP_RIGHT
           
protected  int width
           
protected  int x
           
protected  int y
           
 
Constructor Summary
GObject()
           
 
Method Summary
 void alignHorizontalTo(GObject o)
           
 void alignVerticalTo(GObject o)
           
 boolean contains(Point p)
           
 void delete()
           
 void displayName(Graphics g)
           
 void drag(int xold, int xnew, int yold, int ynew)
           
 Rectangle getBounds()
           
 Point getCenter()
           
 Dimension getDimension()
           
 boolean getDisplayLabel()
          Get the value of displayLabel.
 StructureEditor getEditor()
          Get the value of editor.
 Color getForeground()
          Get the foreground color of this
 int getHeight()
          Get the value of height.
 int getLabelLocation()
          Get the value of labelLocation.
 Point getLocation()
           
 Rectangle getRectangle()
           
 SElement getSElement()
           
 int getWidth()
          Get the value of width.
 void init()
          Initialize the graphic component associated to a node
 int intersection(int side, int position)
           
 Point intersection(Point p)
           
 boolean isContainedIn(Polygon p)
           
 boolean isContainedIn(Rectangle r)
           
 boolean isSelectable()
           
 boolean isSelected()
           
 void paint(Graphics g)
           
 void reInstall(StructureEditor ed)
           
 void select(boolean state)
           
 void setCenter(int x, int y)
           
 void setCenter(Point p)
           
 void setDimension(int w, int h)
           
 void setDisplayLabel(boolean v)
          Set the value of displayLabel.
 void setEditor(StructureEditor v)
           
 void setForeground(Color v)
          Set the value of foreground.
 void setHeight(int v)
          Set the value of height.
 void setLabelLocation(int v)
          Set the value of labelLocation.
 void setLocation(int _x, int _y)
           
 void setLocation(Point p)
           
 void setSElement(SElement o)
           
 void setSize(int w, int h)
           
 void setWidth(int v)
          Set the value of width.
 void snapToGrid(int s)
           
 void translate(int dx, int dy)
           
 void translateBound(int dx, int dy, Rectangle r)
           
 void translateWrap(int dx, int dy, Rectangle r)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

LEFT

public static final int LEFT
See Also:
Constant Field Values

TOP

public static final int TOP
See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
See Also:
Constant Field Values

CENTER

public static final int CENTER
See Also:
Constant Field Values

TOP_RIGHT

public static final int TOP_RIGHT
See Also:
Constant Field Values

selected

public boolean selected

displayLabel

protected boolean displayLabel

labelLocation

protected int labelLocation

x

protected int x

y

protected int y

width

protected int width

height

protected int height

bounds

protected Rectangle bounds

element

protected SElement element
Constructor Detail

GObject

public GObject()
Method Detail

getEditor

public StructureEditor getEditor()
Get the value of editor.

Returns:
Value of editor.

setEditor

public void setEditor(StructureEditor v)

getRectangle

public Rectangle getRectangle()

getLabelLocation

public int getLabelLocation()
Get the value of labelLocation.

Returns:
Value of labelLocation.

setLabelLocation

public void setLabelLocation(int v)
Set the value of labelLocation.

Parameters:
v - Value to assign to labelLocation.

getDisplayLabel

public boolean getDisplayLabel()
Get the value of displayLabel.

Returns:
Value of displayLabel.

setDisplayLabel

public void setDisplayLabel(boolean v)
Set the value of displayLabel.

Parameters:
v - Value to assign to displayLabel.

getCenter

public Point getCenter()

setCenter

public void setCenter(Point p)

setCenter

public void setCenter(int x,
                      int y)

getLocation

public Point getLocation()

setLocation

public void setLocation(Point p)

setLocation

public void setLocation(int _x,
                        int _y)

init

public void init()
Initialize the graphic component associated to a node


drag

public void drag(int xold,
                 int xnew,
                 int yold,
                 int ynew)

alignHorizontalTo

public void alignHorizontalTo(GObject o)

alignVerticalTo

public void alignVerticalTo(GObject o)

select

public void select(boolean state)

isSelected

public boolean isSelected()

isSelectable

public boolean isSelectable()

paint

public void paint(Graphics g)

contains

public boolean contains(Point p)

intersection

public Point intersection(Point p)

intersection

public int intersection(int side,
                        int position)

translate

public void translate(int dx,
                      int dy)

translateWrap

public void translateWrap(int dx,
                          int dy,
                          Rectangle r)

translateBound

public void translateBound(int dx,
                           int dy,
                           Rectangle r)

snapToGrid

public void snapToGrid(int s)

getSElement

public SElement getSElement()

setSElement

public void setSElement(SElement o)

isContainedIn

public boolean isContainedIn(Rectangle r)

isContainedIn

public boolean isContainedIn(Polygon p)

displayName

public void displayName(Graphics g)

getForeground

public Color getForeground()
Get the foreground color of this

Returns:
Value of foreground.

setForeground

public void setForeground(Color v)
Set the value of foreground.

Parameters:
v - Value to assign to foreground.

getWidth

public int getWidth()
Get the value of width.

Returns:
Value of width.

setWidth

public void setWidth(int v)
Set the value of width.

Parameters:
v - Value to assign to width.

getHeight

public int getHeight()
Get the value of height.

Returns:
Value of height.

setHeight

public void setHeight(int v)
Set the value of height.

Parameters:
v - Value to assign to height.

setSize

public void setSize(int w,
                    int h)

setDimension

public void setDimension(int w,
                         int h)

getDimension

public Dimension getDimension()

getBounds

public Rectangle getBounds()

delete

public void delete()

reInstall

public void reInstall(StructureEditor ed)


Copyright © J. Ferber, O. Gutknecht All Rights Reserved.