ilog.views
Class IlvDefaultManagerFrame

java.lang.Object
  extended by ilog.views.IlvDefaultManagerFrame
All Implemented Interfaces:
IlvManagerFrame, IlvResizableManagerFrame, IlvPersistentObject, Serializable
Direct Known Subclasses:
IlvConstantModeManagerFrame

public class IlvDefaultManagerFrame
extends Object
implements IlvResizableManagerFrame, Serializable, IlvPersistentObject

The default frame for an IlvManager. The IlvDefaultManagerFrame class defines the default frame that is drawn around an IlvManager when this manager is added into another manager. This class defines the margin that will be added around the manager. A title can be drawn on the top and you can specify the alignment of the title. By default the title is the name of the manager.

You can change the horizontal alignment of the title. The default is left aligned. Since JViews 8.0, you can specify the vertical alignment of the title. The default is top aligned, if you have not specified the vertical alignment. This allows you to keep the compatibility with previous versions.

Since:
JViews 5.0
See Also:
IlvManager.setFrame(ilog.views.IlvManagerFrame), Serialized Form

Field Summary
static int BOTTOM
          Defines the BOTTOM alignment for the title.
static int CENTER
          Defines the CENTER alignment for the title.
static int LEFT
          Defines the LEFT alignment for the title.
static int RIGHT
          Defines the RIGHT alignment for the title.
static int TOP
          Defines the TOP alignment for the title.
static int WRAPPED
          Indicates that the title can be wrapped.
 
Constructor Summary
IlvDefaultManagerFrame()
          Creates a default manager frame.
IlvDefaultManagerFrame(IlvDefaultManagerFrame source)
          Creates an IlvDefaultManagerFrame by copying the specified one.
IlvDefaultManagerFrame(IlvInputStream stream)
          Reads an IlvDefaultManagerFrame from an IlvInputStream.
 
Method Summary
protected  double checkZoomFactor(IlvTransformer t)
          This utility function checks the zoom factor of the given transformer.
 boolean contains(IlvManager manager, IlvPoint p, IlvPoint tp, IlvTransformer t)
          Tests if a point lies within the outline of the frame.
 IlvManagerFrame copy()
          Creates an IlvDefaultManagerFrame by copying this one.
 void draw(IlvManager manager, IlvRect bbox, Graphics g, IlvTransformer t)
          Draws the frame.
protected  void drawBackground(IlvManager manager, IlvRect bbox, Graphics grp, IlvTransformer transf)
          This method fills the given bounding box with the background color.
protected  void drawOutline(IlvManager manager, IlvRect bbox, Graphics grp, IlvTransformer transf)
          This method draws the border of the manager frame outline.
protected  void drawTitleBackground(IlvManager manager, IlvRect bbox, Graphics grp, IlvTransformer transf)
          This method fills the given bounding box with the background color.
protected  void drawTitleText(IlvManager manager, IlvRect bbox, Graphics grp, IlvTransformer transf)
          This method draws the title text within the title area.
 Paint getBackground()
          Returns the Paint object used to draw the background of the manager when the frame is opaque.
 float getBottomMargin()
          Returns the bottom margin.
 float getBottomMargin(IlvManager manager, IlvTransformer t)
          Returns the margin on the bottom of the specified manager.
 Font getFont()
          Returns the font used to draw the text of the title.
 Color getForeground()
          Returns the color used to draw the frame.
 float getLeftMargin()
          Returns the left margin.
 float getLeftMargin(IlvManager manager, IlvTransformer t)
          Returns the margin on the left of the specified manager.
 double getMaxTitleZoomFactor()
          Returns the maximum zoom factor for the title.
 double getMinTitleZoomFactor()
          Returns the minimum zoom factor for the title.
 float getRightMargin()
          Returns the right margin.
 float getRightMargin(IlvManager manager, IlvTransformer t)
          Returns the margin on the right of the specified manager.
 String getTitle()
          Returns the title of the frame.
protected  String getTitle(IlvManager m)
          Returns the title of the frame.
 Color getTitleColor()
          Returns the color used to draw the text of the title.
 float getTitleHeight(IlvManager manager, IlvTransformer t)
          Returns the height of the frame title.
 int getTitleJustification()
          Returns the justification of the frame title.
 float getTopMargin()
          Returns the top margin.
 float getTopMargin(IlvManager manager, IlvTransformer t)
          Returns the total top margin for a specified manager.
 boolean isOpaque()
          Deprecated. Beginning with ILOG JViews 8.1, use isOpaque(IlvManager) instead.
 boolean isOpaque(IlvManager manager)
          Returns true if the frame is opaque meaning that the frame is filling the background of the manager.
 boolean isShowingTitle()
          Returns whether the title is visible or not.
 void managerChanged(IlvManager manager)
          This function adjusts the frame in reaction to the inner manager's change.
 boolean moveResize(IlvManager manager, IlvRect size)
          This function invalidates the frame and does not handle the inner manager's resizing.
 void setBackground(Paint p)
          Changes the Paint object used to draw the background of the manager when the frame is opaque.
 void setBottomMargin(float margin)
          Sets the bottom margin.
 void setFont(Font font)
          Changes the font used to draw the text of the title.
 void setForeground(Color color)
          Changes the color used to draw the frame.
 void setLeftMargin(float margin)
          Sets the left margin.
 void setMaxTitleZoomFactor(double maxTitleZoomFactor)
          Sets the maximum title zoom factor for the title.
 void setMinTitleZoomFactor(double minTitleZoomFactor)
          Sets the minimum zoom factor for the title.
 void setOpaque(boolean value)
          Changes the opacity of the frame.
 void setRightMargin(float margin)
          Sets the right margin.
 void setShowingTitle(boolean set)
          Shows or hides the title.
 void setTitle(String title)
          Sets the title of the frame.
 void setTitleColor(Color color)
          Changes the color used to draw the text of the title.
 void setTitleJustification(int value)
          Changes the justification of the frame title.
 void setTopMargin(float margin)
          Sets the top margin.
 void write(IlvOutputStream stream)
          Writes the frame to an IlvOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
Defines the LEFT alignment for the title.

See Also:
Constant Field Values

CENTER

public static final int CENTER
Defines the CENTER alignment for the title.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Defines the RIGHT alignment for the title.

See Also:
Constant Field Values

TOP

public static final int TOP
Defines the TOP alignment for the title.

Since:
JViews 8.0
See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Defines the BOTTOM alignment for the title.

Since:
JViews 8.0
See Also:
Constant Field Values

WRAPPED

public static final int WRAPPED
Indicates that the title can be wrapped.

Since:
JViews 8.0
See Also:
Constant Field Values
Constructor Detail

IlvDefaultManagerFrame

public IlvDefaultManagerFrame()
Creates a default manager frame.


IlvDefaultManagerFrame

public IlvDefaultManagerFrame(IlvDefaultManagerFrame source)
Creates an IlvDefaultManagerFrame by copying the specified one.

Parameters:
source - the origin of the copy.
See Also:
copy()

IlvDefaultManagerFrame

public IlvDefaultManagerFrame(IlvInputStream stream)
                       throws IOException,
                              IlvReadFileException
Reads an IlvDefaultManagerFrame from an IlvInputStream.

Parameters:
stream - The input stream.
Throws:
IOException
IlvReadFileException
Method Detail

copy

public IlvManagerFrame copy()
Creates an IlvDefaultManagerFrame by copying this one.

Specified by:
copy in interface IlvManagerFrame

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the frame to an IlvOutputStream.

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.

getTopMargin

public float getTopMargin(IlvManager manager,
                          IlvTransformer t)
Returns the total top margin for a specified manager.

The total top margin is the sum of the height of the title plus the top margin, if the title is top aligned.

Specified by:
getTopMargin in interface IlvManagerFrame
Parameters:
manager - The inner manager.
t - The transformer used to draw the manager and the frame.
Returns:
The total top margin for a specified manager.
See Also:
getTitleHeight(IlvManager, IlvTransformer), getTopMargin()

moveResize

public boolean moveResize(IlvManager manager,
                          IlvRect size)
This function invalidates the frame and does not handle the inner manager's resizing. The parameters are ignored.

Specified by:
moveResize in interface IlvResizableManagerFrame
Parameters:
manager - The submanager to be transformed.
size - The new size of the submanager.
Returns:
Always false.
Since:
JViews 8.0

managerChanged

public void managerChanged(IlvManager manager)
This function adjusts the frame in reaction to the inner manager's change. It is typically called by the afterTransform() method of the inner manager.

Specified by:
managerChanged in interface IlvResizableManagerFrame
Parameters:
manager - The inner manager that has been changed.
Since:
JViews 8.0

checkZoomFactor

protected double checkZoomFactor(IlvTransformer t)
This utility function checks the zoom factor of the given transformer.

Parameters:
t - The transformer to be checked.
Returns:
One of the 3 possibilities: 1) The zoom factor of the given transformer, if it is in the specified range. 2) The maximum zoom factor for the title. 3) The minimum zoom factor for the title.
Since:
JViews 8.1
See Also:
setMaxTitleZoomFactor(double), getMaxTitleZoomFactor(), setMinTitleZoomFactor(double), getMinTitleZoomFactor()
Internal method or field: do not use!

getTitleHeight

public float getTitleHeight(IlvManager manager,
                            IlvTransformer t)
Returns the height of the frame title.

Parameters:
manager - The inner manager.
t - The transformer used to draw both the manager and the frame.
Returns:
The frame title height. Returns 0 if the frame has no title or if isShowingTitle() returns false.
Since:
JViews 7.5
See Also:
isShowingTitle(), getTitle(IlvManager), getMinTitleZoomFactor(), getMaxTitleZoomFactor()

getTopMargin

public float getTopMargin()
Returns the top margin. This method does not take into account the title.


setTopMargin

public void setTopMargin(float margin)
Sets the top margin. This method does not take into account the title.


getBottomMargin

public float getBottomMargin(IlvManager manager,
                             IlvTransformer t)
Returns the margin on the bottom of the specified manager. It contains the title height if it is bottom aligned.

Specified by:
getBottomMargin in interface IlvManagerFrame
Parameters:
manager - The inner manager.
t - The transformer used to draw the manager and the frame.

getBottomMargin

public float getBottomMargin()
Returns the bottom margin.


setBottomMargin

public void setBottomMargin(float margin)
Sets the bottom margin.


getRightMargin

public float getRightMargin(IlvManager manager,
                            IlvTransformer t)
Returns the margin on the right of the specified manager.

Specified by:
getRightMargin in interface IlvManagerFrame
Parameters:
manager - The inner manager.
t - The transformer used to draw the manager and the frame.

getRightMargin

public float getRightMargin()
Returns the right margin.


setRightMargin

public void setRightMargin(float margin)
Sets the right margin.


getLeftMargin

public float getLeftMargin(IlvManager manager,
                           IlvTransformer t)
Returns the margin on the left of the specified manager.

Specified by:
getLeftMargin in interface IlvManagerFrame
Parameters:
manager - The inner manager.
t - The transformer used to draw the manager and the frame.

getLeftMargin

public float getLeftMargin()
Returns the left margin.


setLeftMargin

public void setLeftMargin(float margin)
Sets the left margin.


isOpaque

public boolean isOpaque(IlvManager manager)
Returns true if the frame is opaque meaning that the frame is filling the background of the manager.

Specified by:
isOpaque in interface IlvManagerFrame
Parameters:
manager - The inner manager.
See Also:
setOpaque(boolean)

isOpaque

public boolean isOpaque()
Deprecated. Beginning with ILOG JViews 8.1, use isOpaque(IlvManager) instead.

Returns true if the frame is opaque meaning that the frame is filling the background of the manager.

See Also:
setOpaque(boolean)

setOpaque

public void setOpaque(boolean value)
Changes the opacity of the frame. When the frame is opaque the frame is filling the background of the manager.

Parameters:
value - The new opacity.
See Also:
isOpaque(IlvManager), getBackground()

getTitleColor

public Color getTitleColor()
Returns the color used to draw the text of the title.

See Also:
setTitleColor(java.awt.Color)

setTitleColor

public void setTitleColor(Color color)
Changes the color used to draw the text of the title.

Parameters:
color - The new color.
See Also:
getTitleColor()

getFont

public Font getFont()
Returns the font used to draw the text of the title.

See Also:
setTitleColor(java.awt.Color)

setFont

public void setFont(Font font)
Changes the font used to draw the text of the title.

Parameters:
font - The new font.
See Also:
getFont()

getBackground

public Paint getBackground()
Returns the Paint object used to draw the background of the manager when the frame is opaque.

See Also:
setBackground(java.awt.Paint), setOpaque(boolean)

setBackground

public void setBackground(Paint p)
Changes the Paint object used to draw the background of the manager when the frame is opaque.

See Also:
getBackground(), setOpaque(boolean)

getForeground

public Color getForeground()
Returns the color used to draw the frame.

See Also:
setForeground(java.awt.Color)

setForeground

public void setForeground(Color color)
Changes the color used to draw the frame.

Parameters:
color - The new color.
See Also:
getForeground()

isShowingTitle

public boolean isShowingTitle()
Returns whether the title is visible or not.

See Also:
setShowingTitle(boolean), getTitle(), getTitleColor(), getFont(), getTitleJustification()

setShowingTitle

public void setShowingTitle(boolean set)
Shows or hides the title.

Parameters:
set - The new value.
See Also:
isShowingTitle(), getTitle(), getTitleColor(), getFont(), getTitleJustification()

setTitleJustification

public void setTitleJustification(int value)
Changes the justification of the frame title. If the vertical alignment is not specified, the default is TOP aligned.

Parameters:
value - The new justification can be a combination from the next 3 groups:
  • Only one of the LEFT, CENTER, RIGHT for horizontal alignment;
  • Only one of the TOP, BOTTOM for vertical alignment. If not specified, the default is TOP;
  • WRAPPED, the default is not wrapped.
Examples: LEFT, LEFT|BOTTOM, CENTER|BOTTOM|WRAPPED
See Also:
setTitleJustification(int), isShowingTitle()

getTitleJustification

public int getTitleJustification()
Returns the justification of the frame title. See setTitleJustification(int) for possible values.

See Also:
setTitleJustification(int), isShowingTitle()

draw

public void draw(IlvManager manager,
                 IlvRect bbox,
                 Graphics g,
                 IlvTransformer t)
Draws the frame.

Specified by:
draw in interface IlvManagerFrame
Parameters:
manager - The inner manager.
bbox - The bounding box of the manager.
g - The Graphics used to draw the frame.
t - The transformer used to draw the frame.

drawTitleText

protected void drawTitleText(IlvManager manager,
                             IlvRect bbox,
                             Graphics grp,
                             IlvTransformer transf)
This method draws the title text within the title area. It is called internally by the main draw method (draw(IlvManager, IlvRect, Graphics, IlvTransformer)).

If needed, sublcasses can override this method.

Parameters:
manager - The inner manager.
bbox - The bounding box of the title area.
grp - The Graphics used to draw the text.
transf - The transformer from identity to drawing space.
Since:
JViews 8.1
Internal method or field: do not use!

drawTitleBackground

protected void drawTitleBackground(IlvManager manager,
                                   IlvRect bbox,
                                   Graphics grp,
                                   IlvTransformer transf)
This method fills the given bounding box with the background color. It is called internally by the main draw method (draw(IlvManager, IlvRect, Graphics, IlvTransformer)) to handle the drawing of the background of the text area.

If needed, subclasses can override this method.

Parameters:
manager - The inner manager.
bbox - The bounding box of the title area.
grp - The Graphics used to draw the text.
transf - The transformer from identity to drawing space.
Since:
JViews 8.1
Internal method or field: do not use!

drawBackground

protected void drawBackground(IlvManager manager,
                              IlvRect bbox,
                              Graphics grp,
                              IlvTransformer transf)
This method fills the given bounding box with the background color. It is called internally by the main draw method (draw(IlvManager, IlvRect, Graphics, IlvTransformer)) to handle the drawing of the background of the frame (excluding the title area).

If needed, subclasses can override this method.

Parameters:
manager - The inner manager.
bbox - The bounding box of the title area.
grp - The Graphics used to draw the text.
transf - The transformer from identity to drawing space.
Since:
JViews 8.1
Internal method or field: do not use!

drawOutline

protected void drawOutline(IlvManager manager,
                           IlvRect bbox,
                           Graphics grp,
                           IlvTransformer transf)
This method draws the border of the manager frame outline. It is called internally by the main draw method (draw(IlvManager, IlvRect, Graphics, IlvTransformer)) to handle the drawing of the outline of the frame (including the text area).

If needed, subclasses can override this method.

Parameters:
manager - The inner manager.
bbox - The bounding box of the title area.
grp - The Graphics used to draw the text.
transf - The transformer from identity to drawing space.
Since:
JViews 8.1
Internal method or field: do not use!

contains

public boolean contains(IlvManager manager,
                        IlvPoint p,
                        IlvPoint tp,
                        IlvTransformer t)
Tests if a point lies within the outline of the frame.

Specified by:
contains in interface IlvManagerFrame
Parameters:
manager - The inner manager.
p - The point to be tested.
tp - The point p transformed by the transformer t.
t - The transformation that is used to draw the frame.

getTitle

protected String getTitle(IlvManager m)
Returns the title of the frame. If setTitle(java.lang.String) was called with a non-null title string, this string is returned. Otherwise, this method returns the name of the manager (IlvGraphic.getName()). If the manager has no name, it returns the string 'Untitled'.


setTitle

public void setTitle(String title)
Sets the title of the frame.

Parameters:
title - The new title of the frame.
Since:
JViews 5.5
See Also:
getTitle(ilog.views.IlvManager)

getTitle

public String getTitle()
Returns the title of the frame.

Since:
JViews 5.5
See Also:
setTitle(java.lang.String), getTitle(ilog.views.IlvManager)

getMinTitleZoomFactor

public double getMinTitleZoomFactor()
Returns the minimum zoom factor for the title.

Returns:
The minimum zoom factor for the title.
Since:
JViews 6.0

setMinTitleZoomFactor

public void setMinTitleZoomFactor(double minTitleZoomFactor)
Sets the minimum zoom factor for the title.

Parameters:
minTitleZoomFactor - The new minimum zoom factor.
Since:
JViews 6.0

getMaxTitleZoomFactor

public double getMaxTitleZoomFactor()
Returns the maximum zoom factor for the title.

Returns:
The maximum zoom factor for the title.
Since:
JViews 6.0

setMaxTitleZoomFactor

public void setMaxTitleZoomFactor(double maxTitleZoomFactor)
Sets the maximum title zoom factor for the title.

Parameters:
maxTitleZoomFactor - The new zoom factor for the title.
Since:
JViews 6.0


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