ConForM.CoopnTools.CoKer.Visual
Interface GraphicalVisualElement

All Superinterfaces:
GraphicalVisualEditable, GraphicalVisualRenderable, javax.swing.undo.StateEditable
All Known Subinterfaces:
CoopnGraphicalElement, GraphicalVisualArc, GraphicalVisualContainer, GraphicalVisualNode, GraphicalVisualRotatableNode, GraphicalVisualShape
All Known Implementing Classes:
AbstractGraphicalElement

public interface GraphicalVisualElement
extends GraphicalVisualEditable, GraphicalVisualRenderable

General graphical visual elements. This interfaceclass defines the common components of graphical visual elements. Such elements are used and managed by the graphical visuals of CoopnTools. Locations and sizes of elements are given in the so-called logical space, i.e. without zooming, and distances expressed in logical coordinates, like in Aspects (1 inch = 81,92 logical units). When drawing itself, a component may be obliged to transform its coordinates in the so-called PHYSICAL space; this transformation is actually a simple affine transformation (a multiplication by an integer constant and an offset). This class must be extended for coping with the different kinds of visual elements.


Fields inherited from interface javax.swing.undo.StateEditable
RCSID
 
Method Summary
 void attachToParent(GraphicalVisualRenderableGroup parent)
          Set the parent group if this element.
 java.lang.String description()
          Description of the element.
 java.awt.Rectangle externalBox()
          Get the external box.
 java.awt.Rectangle externalInfoBox()
          Get the external info box.
 java.awt.Rectangle externalLabelBox()
          Get the external label box.
 java.lang.String getInfo()
          Get the information field.
 java.awt.Point getLocation()
          Get the location.
 boolean getShown()
          Look if the associated element is shown.
 boolean getShownInfo()
          Look if the information field is shown.
 boolean getShownLabel()
          Look if the label is shown.
 java.lang.String getStringTransfer()
          Get the String image of this element used in textual transfers.
 java.awt.datatransfer.Transferable getTransferable()
          Get a transferable representing the element.
 boolean inducedSelection()
          Look if the element is selected, or if it is selected by induction.
 void induceSelection()
          Set the induced selection of this element; when this method is called, this element must retrieve its induced selection state from its closely related elements.
 int inside(java.awt.Point p)
          Look if a point is "inside" the element, and if the case arises, how the point is "inside" (border, angle, middle, and so on).
 java.lang.String label()
          Label of the element.
 GraphicalVisualRenderableGroup parent()
          Get the parent node of the element.
 void parentMoved()
          Notification of the modification of location of the parent.
 boolean partOfParent()
          Specify if the element is part of its parent or not.
 boolean selected()
          Look if the element if selected or not.
 void setLayoutLocation(java.awt.Point newLocation)
          Set the location according to a layout.
 
Methods inherited from interface ConForM.CoopnTools.CoKer.Visual.GraphicalVisualEditable
abortMove, commitMove, inChange, move, move, moveInfo, moveInfo, moveLabel, moveLabel, restoreCompleteState, setColor, setInfo, setShown, setShownInfo, setShownLabel, storeCompleteState
 
Methods inherited from interface javax.swing.undo.StateEditable
restoreState, storeState
 
Methods inherited from interface ConForM.CoopnTools.CoKer.Visual.GraphicalVisualRenderable
actionOnMultipleClick, boundingBox, deselect, export, paint, pointedElement, print, saveAspect, saveAspectAs, saveAspectAsPossible, saveAspectPossible, selectElement, selectInfo, selectLabel, specificPopup
 

Method Detail

partOfParent

public boolean partOfParent()
Specify if the element is part of its parent or not. An element which is part of its parent must be phisically enclosed in its parent, and cannot intersect its brothers if it is a shape.
Returns:
true iff the element is part of its parent.

parent

public GraphicalVisualRenderableGroup parent()
Get the parent node of the element. Every elements in a graphics has exactly 1 or 0 parent. If it has 0 parent, it is not included in the picture.
Returns:
the parent of this element, or null

attachToParent

public void attachToParent(GraphicalVisualRenderableGroup parent)
Set the parent group if this element.
Parameters:
parent - the parent group, or null if the element should be dettached from its parent

parentMoved

public void parentMoved()
Notification of the modification of location of the parent.

label

public java.lang.String label()
Label of the element. The label usually identifies the element, in a shot way.
Returns:
a String, the label. Nevel null.

description

public java.lang.String description()
Description of the element. This description typically contains the profile of an element, and may be used by graphical visuals to display additionnal information.
Returns:
a String, the description. Never null.

getStringTransfer

public java.lang.String getStringTransfer()
Get the String image of this element used in textual transfers.
Returns:
a String image, or null if this element cannot participate in data transfer.

getTransferable

public java.awt.datatransfer.Transferable getTransferable()
Get a transferable representing the element.
Returns:
a transferable, as rich as possible, representing the element, or null if this element cannot participate in data transfer. Should at least deliver a stringFlavor DataFlavor, encompassing the String returned by getStringTranfer().

getLocation

public java.awt.Point getLocation()
Get the location.
Returns:
The location as a Point.

setLayoutLocation

public void setLayoutLocation(java.awt.Point newLocation)
Set the location according to a layout. This method is intended to be used by layouters only; it should not be called by external objects.
Parameters:
newLocation - the new location, in absolute coordinates

getInfo

public java.lang.String getInfo()
Get the information field. This field is never null, but may be an empty string.
Returns:
The information field as a String

getShown

public boolean getShown()
Look if the associated element is shown. If the element is not shown, nothing of its components must be shown, and in particular the label must not be shown.
Returns:
true iff the associated element is shown.

getShownLabel

public boolean getShownLabel()
Look if the label is shown.
Returns:
true iff the label is shown.

getShownInfo

public boolean getShownInfo()
Look if the information field is shown.
Returns:
true iff the information field is shown.

selected

public boolean selected()
Look if the element if selected or not. Do not look at the selection state of the label or info.
Returns:
true iff the element itself is selected

induceSelection

public void induceSelection()
Set the induced selection of this element; when this method is called, this element must retrieve its induced selection state from its closely related elements. The induced selection of an element is a selection state induced by closely related elements; typically, the selection of an arc is induced by the selection of one of its ending node, or the selection of a shape is induced by the selection of its parent. The induced selection of an element does not affect the selection state of this element. From a paint's point of view, the behaviour of an element with a set induced selection is the same as the behaviour of a selected element; it is painted only if the selected argument is true.

inducedSelection

public boolean inducedSelection()
Look if the element is selected, or if it is selected by induction.

externalBox

public java.awt.Rectangle externalBox()
Get the external box. The external box is the rectangle containing the element, with a small inset.
Returns:
the external box of the element, as a rectangle in the logical coordinate space. An empty rectangle means that the element has no external box.

externalLabelBox

public java.awt.Rectangle externalLabelBox()
Get the external label box. The box is the rectangle containing the label, with a small inset.
Returns:
the external label box of the element, as a rectangle in the logical coordinate space. An empty rectangle means that the element has no external label box.

externalInfoBox

public java.awt.Rectangle externalInfoBox()
Get the external info box. The box is the rectangle containing the info field, with a small inset.
Returns:
the external info box of the element, as a rectangle in the logical coordinate space. An empty rectangle means that the element has no external info box.

inside

public int inside(java.awt.Point p)
Look if a point is "inside" the element, and if the case arises, how the point is "inside" (border, angle, middle, and so on).
Parameters:
point - the point in logicial coordinates; cannot be null
Returns:
an integer, with following meaning: Cursor.DEFAULT_CURSOR: point not in element; Cursor.HAND_CURSOR: point "inside" element; Cursor.TEXT_CURSOR: point "inside" info; Cursor.WAIT_CURSOR: point "inside" label; Cursor.N_RESIZE_CURSOR: point on upper side; Cursor.NE_RESIZE_CURSOR: point on up-right corner; Cursor.E_RESIZE_CURSOR: point on right side; Cursor.SE_RESIZE_CURSOR: point on down-right corner; Cursor.S_RESIZE_CURSOR: point on down side; Cursor.SW_RESIZE_CURSOR: point on down-left corner; Cursor.W_RESIZE_CURSOR: point on left side; Cursor.NW_RESIZE_CURSOR: point on up-left corner; a negative value n: point on the (-1-n)th intermediary point;
Throws:
java.lang.IllegalArgumentException - the argument is null.