fr.ove.openmath.jome.ctrlview.bidim
Class DisplayLayout

java.lang.Object
  extended byfr.ove.openmath.jome.ctrlview.bidim.DisplayLayout
All Implemented Interfaces:
java.lang.Cloneable, java.awt.LayoutManager, java.awt.LayoutManager2, java.io.Serializable
Direct Known Subclasses:
AbstractStringLayout, HorizontalLayout, OneFormulaLayout, SlotLayout, SymbolLayout, VerticalCenteredLayout, VerticalLayout

public abstract class DisplayLayout
extends java.lang.Object
implements java.awt.LayoutManager2, java.io.Serializable, java.lang.Cloneable

A layout manager.

Version:
2.0 13/12/1999
Author:
© 1999 DIRAT Laurent
See Also:
Serialized Form

Field Summary
protected  Display displayToLay
          The display laid out by the instance.
 
Constructor Summary
DisplayLayout()
           
 
Method Summary
 void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
          Adds the specified component to the layout, using the specified constraint object.
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Adds the specified component with the specified name to the layout.
abstract  java.awt.Dimension computeAttributes()
          Computes the size of the display according to its children size (if any), and its different attributes.
 void deselectDisplay()
          Deselects the display.
 float getLayoutAlignmentX(java.awt.Container target)
          Returns the alignment along the x axis.
 float getLayoutAlignmentY(java.awt.Container target)
          Returns the alignment along the y axis.
 void initDisplay(Display displayToLay)
          According to the operator, the layout manager has to add some components (e.g. brackets, ...)
 void invalidateLayout(java.awt.Container target)
          Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
 java.awt.Dimension maximumLayoutSize(java.awt.Container target)
          Returns the maximum size of this component.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Calculates the minimum size dimensions for the specified panel given the components in the specified parent container.
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.
abstract  void rebuildDisplay()
          The display needs to be rebuilt.
 void removeLayoutComponent(java.awt.Component comp)
          Removes the specified component from the layout.
 void selectDisplay()
          Selects the display (and its children if any)
 boolean selectLeftDisplay()
          Returns true if during the selection, the display which is located to the left of the display that the instance lays, must be selected too.
 boolean selectRightDisplay()
          Returns true if during the selection, the display which is located to the right of the display that the instance lays, must be selected too.
 void updateLevel(int level)
          Updates the level of the display laid out.
abstract  void validateDeselection(Display display)
          Checks the validity of the deselection.
abstract  void validateSelection()
          Checks the validity of the selection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.LayoutManager
layoutContainer
 

Field Detail

displayToLay

protected Display displayToLay
The display laid out by the instance.

Constructor Detail

DisplayLayout

public DisplayLayout()
Method Detail

initDisplay

public void initDisplay(Display displayToLay)
According to the operator, the layout manager has to add some components (e.g. brackets, ...) or has to perform some "re-oganisation" before rendering.
As soon as the layout manager is set to the display, this mehtod MUST be called with the display laid out as parameter. This method serves as well as a registering method. So all sub-classes of the instance MUST call super.initDisplay(displayToLay).

Parameters:
displayToLay - the display laid by the instance

selectLeftDisplay

public boolean selectLeftDisplay()
Returns true if during the selection, the display which is located to the left of the display that the instance lays, must be selected too. false otherwise.


selectRightDisplay

public boolean selectRightDisplay()
Returns true if during the selection, the display which is located to the right of the display that the instance lays, must be selected too. false otherwise.


selectDisplay

public void selectDisplay()
Selects the display (and its children if any)


deselectDisplay

public void deselectDisplay()
Deselects the display.


updateLevel

public void updateLevel(int level)
Updates the level of the display laid out.

Parameters:
level - the level put to the display.

validateSelection

public abstract void validateSelection()
Checks the validity of the selection.


validateDeselection

public abstract void validateDeselection(Display display)
Checks the validity of the deselection.

Parameters:
display - the display which just has been deselected.

rebuildDisplay

public abstract void rebuildDisplay()
The display needs to be rebuilt. We do this.


computeAttributes

public abstract java.awt.Dimension computeAttributes()
Computes the size of the display according to its children size (if any), and its different attributes.

Returns:
the size of the display.

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Adds the specified component with the specified name to the layout.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Parameters:
name - the component name
comp - the component to be added

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Removes the specified component from the layout.

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Parameters:
comp - the component ot be removed

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Calculates the minimum size dimensions for the specified panel given the components in the specified parent container.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - the component to be laid out
See Also:
preferredLayoutSize(java.awt.Container)

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - the component to be laid out
See Also:
minimumLayoutSize(java.awt.Container)

addLayoutComponent

public void addLayoutComponent(java.awt.Component comp,
                               java.lang.Object constraints)
Adds the specified component to the layout, using the specified constraint object.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager2
Parameters:
comp - the component to be added
constraints - where/how the component is added to the layout.

maximumLayoutSize

public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
Returns the maximum size of this component.

Specified by:
maximumLayoutSize in interface java.awt.LayoutManager2
See Also:
Component.getMinimumSize(), Component.getPreferredSize(), LayoutManager

getLayoutAlignmentX

public float getLayoutAlignmentX(java.awt.Container target)
Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Specified by:
getLayoutAlignmentX in interface java.awt.LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(java.awt.Container target)
Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Specified by:
getLayoutAlignmentY in interface java.awt.LayoutManager2

invalidateLayout

public void invalidateLayout(java.awt.Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.

Specified by:
invalidateLayout in interface java.awt.LayoutManager2


Copyright © 1999-2007 Universit?© de Nice Sophia-Antipolis, I3S, Ove SARL, DFKI and Universit?§t des Saarlandes. All Rights Reserved.