ConForM.CoopnTools.CoKer.Visual
Interface GraphicalVisualEditable

All Superinterfaces:
javax.swing.undo.StateEditable
All Known Subinterfaces:
CoopnGraphicalElement, GraphicalVisualArc, GraphicalVisualContainer, GraphicalVisualElement, GraphicalVisualNode, GraphicalVisualRotatableNode, GraphicalVisualShape
All Known Implementing Classes:
GraphicalVisualElementGroup

public interface GraphicalVisualEditable
extends javax.swing.undo.StateEditable

General graphical visual editable. This interface defines the most general editable elements or group of elements. 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).


Fields inherited from interface javax.swing.undo.StateEditable
RCSID
 
Method Summary
 void abortMove()
          Abort the move.
 void commitMove()
          Commit the move.
 boolean inChange()
          Look if a change of aspect is in progress.
 boolean move(java.awt.Dimension dim)
          Try to move the element.
 boolean move(java.awt.Dimension dim, java.awt.Dimension grid)
          Try to move the element on a grid.
 boolean moveInfo(java.awt.Dimension dim)
          Try to move the info field of the element.
 boolean moveInfo(java.awt.Dimension dim, java.awt.Dimension grid)
          Try to move the info field of the element on a grid.
 boolean moveLabel(java.awt.Dimension dim)
          Try to move the label of the element.
 boolean moveLabel(java.awt.Dimension dim, java.awt.Dimension grid)
          Try to move the label of the element on a grid.
 void restoreCompleteState(java.util.Hashtable state)
          Restore the aspect.
 void setColor(java.awt.Color color)
          Specifiy the color of the element.
 void setInfo(java.lang.String info)
          Set the information field.
 void setShown(boolean shown)
          Specifiy if the associated element is shown.
 void setShownInfo(boolean shown)
          Specifiy is the information field is shown.
 void setShownLabel(boolean shown)
          Specifiy is the label is shown.
 void storeCompleteState(java.util.Hashtable state)
          Store the aspect.
 
Methods inherited from interface javax.swing.undo.StateEditable
restoreState, storeState
 

Method Detail

storeCompleteState

public void storeCompleteState(java.util.Hashtable state)
Store the aspect. Upon receiving this message, the receiver should place its aspect into state. In addition, if the receiver represents a group of editable, these must (recursively) store there state too. This method is used to undo/redo edits.
Parameters:
state - an hashtable, storing states of elements

restoreCompleteState

public void restoreCompleteState(java.util.Hashtable state)
Restore the aspect. Upon receiving this message, the receiver should retrieve its aspect from state. In addition, if the receiver represents a group of editable, these must (recursively) restore there state too. This method is used to undo/redo edits.
Parameters:
state - an hashtable, storing states of elements

inChange

public boolean inChange()
Look if a change of aspect is in progress.
Returns:
true iff a change of aspect is in progress.

move

public boolean move(java.awt.Dimension dim)
Try to move the element.
Parameters:
dim - the difference of position
Returns:
true iff the move is possible (for this element point of view).

move

public boolean move(java.awt.Dimension dim,
                    java.awt.Dimension grid)
Try to move the element on a grid.
Parameters:
dim - the difference of position
grid - grid size
Returns:
true iff the move is possible (for this element point of view).

moveLabel

public boolean moveLabel(java.awt.Dimension dim)
Try to move the label of the element.
Parameters:
dim - the difference of position
Returns:
true iff the move is possible (for this element point of view).

moveLabel

public boolean moveLabel(java.awt.Dimension dim,
                         java.awt.Dimension grid)
Try to move the label of the element on a grid.
Parameters:
dim - the difference of position
grid - grid size
Returns:
true iff the move is possible (for this element point of view).

moveInfo

public boolean moveInfo(java.awt.Dimension dim)
Try to move the info field of the element.
Parameters:
dim - the difference of position
Returns:
true iff the move is possible (for this element point of view).

moveInfo

public boolean moveInfo(java.awt.Dimension dim,
                        java.awt.Dimension grid)
Try to move the info field of the element on a grid.
Parameters:
dim - the difference of position
grid - grid size
Returns:
true iff the move is possible (for this element point of view).

commitMove

public void commitMove()
Commit the move.

abortMove

public void abortMove()
Abort the move.

setInfo

public void setInfo(java.lang.String info)
Set the information field.
Parameters:
info - the information field as a String; if this parameter is null, an empty string is used as information field

setShown

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

setShownLabel

public void setShownLabel(boolean shown)
Specifiy is the label is shown.
Parameters:
shown - true iff the label must be shown

setShownInfo

public void setShownInfo(boolean shown)
Specifiy is the information field is shown.
Parameters:
shown - true iff the information field must be shown

setColor

public void setColor(java.awt.Color color)
Specifiy the color of the element.
Parameters:
color - the color