ConForM.CoopnTools.CoKer.Visual
Interface GraphicalVisualContainer

All Superinterfaces:
GraphicalVisualEditable, GraphicalVisualElement, GraphicalVisualRenderable, GraphicalVisualRenderableGroup, GraphicalVisualShape, javax.swing.undo.StateEditable
All Known Implementing Classes:
AbstractGraphicalContainer

public interface GraphicalVisualContainer
extends GraphicalVisualShape, GraphicalVisualRenderableGroup

Graphical visual container. This interface defines the elements of graphical visual which are containers, by extending graphical visual shapes. Containers contain elements with shapes. They can e moved and resized, and so on. Containers have a ContainerAspect aspect.


Fields inherited from interface javax.swing.undo.StateEditable
RCSID
 
Method Summary
 void abortResize()
          Abort the resize.
 java.awt.Point centre()
          Get a representation of the centre of the container.
 void commitResize()
          Commit the resize.
 int findInterfacePointNear(java.awt.Point point, GraphicalVisualNode node)
          Get an interface point near another point.
 boolean getShownInternal()
          Look if the internal part of the associated element is shown.
 java.awt.Rectangle getSize()
          Get the size.
 java.awt.Shape internalShape()
          Get the internal shape.
 boolean resize(java.awt.Dimension dim, int h, int v)
          Try to resize the container.
 boolean resize(java.awt.Dimension dim, int h, int v, java.awt.Dimension grid)
          Try to resize the container on a grid.
 void setLayoutSize(java.awt.Rectangle newSize)
          Set the size according to a layout.
 void setShownInternal(boolean shown)
          Specifiy if the internal part of the associated element is shown.
 
Methods inherited from interface ConForM.CoopnTools.CoKer.Visual.GraphicalVisualShape
addEndingArc, addNeighbour, addStartingArc, endingArcs, findEndingAttachementPointNear, findStartingAttachementPointNear, neighbours, removeNeighbour, shape, startingArcs
 
Methods inherited from interface ConForM.CoopnTools.CoKer.Visual.GraphicalVisualElement
attachToParent, description, externalBox, externalInfoBox, externalLabelBox, getInfo, getLocation, getShown, getShownInfo, getShownLabel, getStringTransfer, getTransferable, inducedSelection, induceSelection, inside, label, parent, parentMoved, partOfParent, selected, setLayoutLocation
 
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
 
Methods inherited from interface ConForM.CoopnTools.CoKer.Visual.GraphicalVisualRenderableGroup
addComponent, componentChanged, components, removeComponent
 

Method Detail

getShownInternal

public boolean getShownInternal()
Look if the internal part of the associated element is shown. If it is not shown, only the external part is shown, including the label (provided that this one is not explicitely stated as not shown).
Returns:
true iff the internal part of the element is shown.

setShownInternal

public void setShownInternal(boolean shown)
Specifiy if the internal part of the associated element is shown.
Parameters:
shown - true iff the element must be shown

getSize

public java.awt.Rectangle getSize()
Get the size.
Returns:
The size as a Rectangle.

setLayoutSize

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

resize

public boolean resize(java.awt.Dimension dim,
                      int h,
                      int v)
Try to resize the container.
Parameters:
dim - the increment in width and height; a positive value means an inflation of the container, while a negative value means a compression of the container
h - specify if resize at left, right or both part of component; one of GraphicalVisualEditor.LEFT, GraphicalVisualEditor.MIDDLE or GraphicalVisualEditor.RIGHT
v - specify if resize at top, bottom or both part of component one of GraphicalVisualEditor.TOP, GraphicalVisualEditor.MIDDLE or GraphicalVisualEditor.BOTTOM
Returns:
true iff the resize is possible.

resize

public boolean resize(java.awt.Dimension dim,
                      int h,
                      int v,
                      java.awt.Dimension grid)
Try to resize the container on a grid.
Parameters:
dim - the increment in width and height; a positive value means an inflation of the container, while a negative value means a compression of the container
h - specify if resize at left, right or both part of component; one of GraphicalVisualEditor.LEFT, GraphicalVisualEditor.MIDDLE or GraphicalVisualEditor.RIGHT
v - specify if resize at top, bottom or both part of component one of GraphicalVisualEditor.TOP, GraphicalVisualEditor.MIDDLE or GraphicalVisualEditor.BOTTOM
grid - grid size
Returns:
true iff the resize is possible.

commitResize

public void commitResize()
Commit the resize.

abortResize

public void abortResize()
Abort the resize.

centre

public java.awt.Point centre()
Get a representation of the centre of the container.
Returns:
a point, giving the centre of the container; both coordinates are actually the double of the coordinates of the centre.

internalShape

public java.awt.Shape internalShape()
Get the internal shape.
Returns:
the shape in which its internal elements must be included, as a shape in the logical coordinate space. The shape is located on the origin of this element.

findInterfacePointNear

public int findInterfacePointNear(java.awt.Point point,
                                  GraphicalVisualNode node)
Get an interface point near another point.
Parameters:
point - the point in logical coordinates; cannot be null; this point is modified such that it is on the interface of the container
node - the interface node
Returns:
an approximation of the angle of a line, perpendicular to the container's visible shape, and passing through the interface point. The angle is expressed in degree, following the trigonometric sense.