Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Draw2d
3.3

org.eclipse.draw2d
Class AbstractLocator

java.lang.Object
  extended by
org.eclipse.draw2d.AbstractLocator
All Implemented Interfaces:
Locator
Direct Known Subclasses:
ConnectionLocator

public abstract class AbstractLocator
extends java.lang.Object
implements Locator

Places a figure relative to a point determined by the subclass. The figure may be placed in some location relative to the point with a configurable amount of spacing.


Constructor Summary
AbstractLocator ()
          Creates a new AbstractLocator.
 
Method Summary
 int getGap ()
          Returns the number of pixels to leave between the figure being located and the reference point.
protected   Rectangle getNewBounds ( Dimension size, Point center)
          Recalculate the location of the figure according to its desired position relative to the center point.
protected abstract   Point getReferencePoint ()
          Returns the reference point in absolute coordinates used to calculate the location.
 int getRelativePosition ()
          Returns the position of the figure with respect to the center point.
 void relocate ( IFigure target)
          Recalculates the position of the figure and returns the updated bounds.
 void setGap (int i)
          Sets the gap between the reference point and the figure being placed.
 void setRelativePosition (int pos)
          Sets the position of the figure with respect to the center point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLocator

public AbstractLocator()
Creates a new AbstractLocator.

Method Detail

getGap

public int getGap()
Returns the number of pixels to leave between the figure being located and the reference point. Only used if getRelativePosition() returns something other than PositionConstants.CENTER.

Returns:
The gap
Since:
2.0

getReferencePoint

protected abstract 
Point getReferencePoint()
Returns the reference point in absolute coordinates used to calculate the location.

Returns:
The reference point in absolute coordinates
Since:
2.0

getNewBounds

protected 
Rectangle getNewBounds(
Dimension size,
                                 
Point center)
Recalculate the location of the figure according to its desired position relative to the center point.

Parameters:
size - The size of the figure
center - The center point
Returns:
The new bounds
Since:
2.0

getRelativePosition

public int getRelativePosition()
Returns the position of the figure with respect to the center point. Possible values can be found in PositionConstants and include CENTER, NORTH, SOUTH, EAST, WEST, NORTH_EAST, NORTH_WEST, SOUTH_EAST, or SOUTH_WEST.

Returns:
An int constant representing the relative position
Since:
2.0

relocate

public void relocate(
IFigure target)
Recalculates the position of the figure and returns the updated bounds.

Specified by:
relocate in interface Locator
Parameters:
target - The figure to relocate

setGap

public void setGap(int i)
Sets the gap between the reference point and the figure being placed. Only used if getRelativePosition() returns something other than PositionConstants.CENTER.

Parameters:
i - The gap
Since:
2.0

setRelativePosition

public void setRelativePosition(int pos)
Sets the position of the figure with respect to the center point. Possible values can be found in PositionConstants and include CENTER, NORTH, SOUTH, EAST, WEST, NORTH_EAST, NORTH_WEST, SOUTH_EAST, or SOUTH_WEST.

Parameters:
pos - The relative position
Since:
2.0

Eclipse Draw2d
3.3

Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire