ilog.views.graphic.composite.layout
Class IlvStackerLayout

java.lang.Object
  extended by ilog.views.graphic.composite.layout.IlvStackerLayout
All Implemented Interfaces:
IlvLayoutManager, IlvPersistentObject, Cloneable

public class IlvStackerLayout
extends Object
implements IlvLayoutManager

This class lays out the objects on a row or column basis, adding some space between them.

Since:
JViews 6.0

Constructor Summary
IlvStackerLayout()
          Creates a new instance of IlvStackerLayout
IlvStackerLayout(IlvInputStream stream)
          Reads the object from an IlvInputStream.
IlvStackerLayout(int orientation, int alignment, int spacing)
          Creates a new stacker graphic for the attribute or representation object, with the given characteristics for orientation, alignment and spacing.
 
Method Summary
 void attach(IlvAttachable target)
          Sets the constraints defined by the supplied IlvAttachable
protected  void checkValues()
          This method just checks if the values defined for the stacker characteristics are valid.
 Object clone()
          Creates a copy of this object.
protected  void computeChildrenAttachmentCoordinates(IlvAttachable target)
          Computes the attachment coordinates of the children.
 int getAlignment()
          Returns the alignment used in the stacker children.
 int getOrientation()
          Returns the current orientation.
 int getSpacing()
          Returns the spacing between child elements.
 void layoutGroup(IlvAttachable target)
          Lays out the specified IlvAttachablecontainer.
 void removeConstraints(IlvAttachable element)
          Removes the specified IlvAttachable from the layout.
 void reset()
          Remove all the constraints
 boolean resizeFirstChildOnly()
          Returns always false
 void setAlignment(int alignment)
          Returns the alignment used in the stacker children.
 void setConstraints(IlvAttachable element, Object constraints)
          The supplied IlvAttachable is added at the end of the stack.
 void setOrientation(int orientation)
          Returns the current orientation.
 void setSpacing(int spacing)
          Returns the spacing between child elements.
 void write(IlvOutputStream stream)
          Writes the attributes of a persistent object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvStackerLayout

public IlvStackerLayout()
Creates a new instance of IlvStackerLayout


IlvStackerLayout

public IlvStackerLayout(int orientation,
                        int alignment,
                        int spacing)
Creates a new stacker graphic for the attribute or representation object, with the given characteristics for orientation, alignment and spacing.

Parameters:
orientation - either SwingConstants.TOP or SwingConstants.BOTTOM or SwingConstants.LEFT or SwingConstants.RIGHT
alignment - either SwingConstants.TOP or SwingConstants.BOTTOM or SwingConstants.LEFT or SwingConstants.RIGHT or SwingConstants.CENTER

IlvStackerLayout

public IlvStackerLayout(IlvInputStream stream)
                 throws IlvReadFileException
Reads the object from an IlvInputStream.

Parameters:
stream - The input stream.
Throws:
IlvReadFileException - if the format is not correct.
Method Detail

checkValues

protected void checkValues()
This method just checks if the values defined for the stacker characteristics are valid. This method may modify the values to correct an internal value.


setOrientation

public void setOrientation(int orientation)
Returns the current orientation.


getOrientation

public int getOrientation()
Returns the current orientation.


setAlignment

public void setAlignment(int alignment)
Returns the alignment used in the stacker children.


getAlignment

public int getAlignment()
Returns the alignment used in the stacker children.


setSpacing

public void setSpacing(int spacing)
Returns the spacing between child elements.


getSpacing

public int getSpacing()
Returns the spacing between child elements.


setConstraints

public void setConstraints(IlvAttachable element,
                           Object constraints)
The supplied IlvAttachable is added at the end of the stack.

Specified by:
setConstraints in interface IlvLayoutManager
Parameters:
element - the IlvAttachable to be added
constraints - where/how the component is added to the layout.

removeConstraints

public void removeConstraints(IlvAttachable element)
Removes the specified IlvAttachable from the layout.

Specified by:
removeConstraints in interface IlvLayoutManager
Parameters:
element - the IlvAttachable>/code> object to be removed.

layoutGroup

public void layoutGroup(IlvAttachable target)
Lays out the specified IlvAttachablecontainer.

Specified by:
layoutGroup in interface IlvLayoutManager
Parameters:
target - the container to be laid out

attach

public void attach(IlvAttachable target)
Sets the constraints defined by the supplied IlvAttachable

Specified by:
attach in interface IlvLayoutManager
Parameters:
target - the container to be laid out
See Also:
IlvAttachable.getAttachables(), IlvAttachable.getConstraints()

computeChildrenAttachmentCoordinates

protected void computeChildrenAttachmentCoordinates(IlvAttachable target)
Computes the attachment coordinates of the children.

Parameters:
target - the container

reset

public void reset()
Remove all the constraints

Specified by:
reset in interface IlvLayoutManager

clone

public Object clone()
Creates a copy of this object.

Specified by:
clone in interface IlvLayoutManager
Overrides:
clone in class Object

resizeFirstChildOnly

public boolean resizeFirstChildOnly()
Returns always false

Specified by:
resizeFirstChildOnly in interface IlvLayoutManager

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the attributes of a persistent object.

Specified by:
write in interface IlvPersistentObject
Parameters:
stream - the output stream
Throws:
IOException - thrown when an exception occurs during the write operation for this object.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.